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

Posted by Cristi Diaconescu on Stack Overflow See other posts from Stack Overflow or by Cristi Diaconescu
Published on 2010-04-30T13:59:31Z Indexed on 2010/04/30 14:17 UTC
Read the original article Hit count: 284

Filed under:
|

Given a string "VAR=value" I want to split it at the first '=' sign, something like this:

var, sep, value = "VAR=value".partition('=')

Is there a way to NOT declare a variable 'sep'? Like this (just made up the syntax):

var, -, value = "VAR=value".partition('=')

Just for completeness, I'm targetting Python v 2.6

© Stack Overflow or respective owner

Related posts about python

Related posts about syntax