If I do this:

    foo = [ "bar", "baz" "slop", "crud" ]

Python silently accepts that and makes the middle term "bazslop".

BUT, if I do this:

    foo = [ "bar", "baz" 1, "crud" ]

or this:

    foo = [ "bar", 2 1, "crud" ]

The interpreter throws a syntax error.

This is more of an intellectual curiosity than anything else, but why do 
strings silently
concatenate like that, while all other case blow up with an error.  i.e., What 
is about
the language the promotes this behavior.  At first blush, it seems 
inconsistent, but what
do I know ...




-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to