On 01/17/10 12:29, Ethan Furman wrote:
> Lie Ryan wrote:
>> On 01/14/10 05:33, Albert van der Horst wrote:
>>
>>> (I encountered this before. A dictionary is a natural for a
>>> boardgame position, i.e. chess. Now we want to look up chess
>>> positions.)
>>
>>
>> or use collections.namedtuple
>
>
Lie Ryan wrote:
On 01/14/10 05:33, Albert van der Horst wrote:
(I encountered this before. A dictionary is a natural for a
boardgame position, i.e. chess. Now we want to look up chess
positions.)
or use collections.namedtuple
Which is great until you want to make a move. ;)
~Ethan~
--
ht
On 01/14/10 05:33, Albert van der Horst wrote:
> (I encountered this before. A dictionary is a natural for a
> boardgame position, i.e. chess. Now we want to look up chess
> positions.)
or use collections.namedtuple
--
http://mail.python.org/mailman/listinfo/python-list
Albert van der Horst wrote:
> I have a type of objects that have complicated enough properties
> to warrant a special class for its type.
> The class has built in dictionary for all the properties.
>
> Something along the line of
> a = ctype({"poker":True})
> b = ctype({"footbal":True, "gender":"
Albert van der Horst writes:
> I have a type of objects that have complicated enough properties
> to warrant a special class for its type.
> The class has built in dictionary for all the properties.
>
> Something along the line of
> a = ctype({"poker":True})
> b = ctype({"footbal":True, "gender":
I have a type of objects that have complicated enough properties
to warrant a special class for its type.
The class has built in dictionary for all the properties.
Something along the line of
a = ctype({"poker":True})
b = ctype({"footbal":True, "gender":"m"})
c = ctype({"chess":True, "residence":"