Python - is there a “don't care” symbol for tuple assignments?

前端 未结 9 1902
你的背包
你的背包 2020-12-03 04:17

Given a string \"VAR=value\" I want to split it (only) at the first \'=\' sign (< value > may contain more \'=\' signs), something like this:

<         


        
9条回答
  •  -上瘾入骨i
    2020-12-03 05:01

    There isn't anything official in the language for that; you can just use any throw-away variable. As far as standards go, I've seen underscores used occasionally in Python and other languages. The only issue there is that underscore is used as an alias for gettext when localizing. But if you aren't doing localization, or aren't using the global-binding for it, then underscore should work fine.

提交回复
热议问题