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

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -