Question about None

MRAB python at mrabarnett.plus.com
Sun Jun 14 14:00:26 EDT 2009


Andre Engels wrote:
> On Sun, Jun 14, 2009 at 6:49 PM, Paul
> LaFollette<paul.lafollette at gmail.com> wrote:
>> Now, suppose that I want to generate, say, the set of all ordered
>> trees with N nodes.   I need to be able to represent the empty ordered
>> tree, i.e. the tree with with zero nodes.  There are a lot of ways I
>> could do this.  The problem is that I might tomorrow be looking
>> instead at rooted trees, or free trees, or Young tableaux and in each
>> case I will need to represent the empty rooted tree, or the empty free
>> tree, or the empty Young tableau.
>>
>> In a very real sense, the empty Young tableau IS a Young tableau and
>> the empty ordered tree IS an ordered tree.  But in an equally real
>> sense they are the same "ghost of a thing" looked at in different
>> universes of discourse.
> 
> But do you also want the empty Young tableau to BE an ordered tree? A
> number? A diddlewoodaddy? It seems much more logical to me to define
> your Young tableaus such that the definition includes the empty one as
> well.
> 
For strings there's the empty string with the same methods. It's not the
same as None.

For lists there's the empty list with the same methods. It's not the
same as None.

For dicts there's the empty dict with the same methods. It's not the
same as None.

For sets there's the empty set with the same methods. It's not the same
as None.

etc.



More information about the Python-list mailing list