Python set constructor syntax -
does know justification confusing set construction syntax? spent day unable find bug because missed comma in constructing set.
> {1 2} syntaxerror: invalid syntax # makes sense. > {'a' 'b'} = set(['ab']) # not.
this has nothing sets.
two string literals separated whitespace considered one string literal.
rationale = ('this quite useful when need construct ' 'a long literal without useless "+" , without ' 'the indentation , newlines triple-quotes bring.')
Comments
Post a Comment