ways to declare empty set variable

Steve Holden steve at holdenweb.com
Wed Feb 13 00:50:49 CET 2008


Ben Finney wrote:
[...]
> 
> Note that '()' is syntactically null. Parentheses don't declare a
> tuple literal, commas do. Parentheses are for grouping within
> expressions, not specifying type.
> 
Tell that to the interpreter:

 >>> type(())
<type 'tuple'>
 >>> tuple() is ()
True
 >>>

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list