map/filter/reduce/lambda opinions and background unscientific mini-survey
Ron Adam
rrr at ronadam.com
Thu Jul 7 23:45:17 EDT 2005
Erik Max Francis wrote:
> Ron Adam wrote:
>
>> It's not an empty tuple, it's an empty parenthesis. Using tuples it
>> would be.
>>
>> (a,) == (,)
>>
>> which would be the same as:
>>
>> (,) == (,)
>
>
> >>> ()
> ()
> >>> a = ()
> >>> type(a)
> <type 'tuple'>
> >>> (,)
> File "<stdin>", line 1
> (,)
> ^
> SyntaxError: invalid syntax
>
> You've wandered way off into the woods now.
Yes, ummm seems soo... err.
This is one of those Python isn't quite consistent for practical reasons
area. I don't create empty tuples that way very often, but [] is to ()
is to {} is pretty obvious so I don't really have a good excuse.
>>> (1)
1
>>> ()
()
>>> (((((1)))))
1
>>> ((()))
()
Well in my previous explanation I *mean* it to be empty parenthesis.
Does that help?
Cheers,
Ron
More information about the Python-list
mailing list