Tuple Semantics - Rationale'?
Tim Daneliuk
tundra at tundraware.com
Thu Jul 12 13:20:02 EDT 2001
Steve Holden wrote:
>
> "Aahz Maruch" <aahz at panix.com> wrote in message
> news:9ij8ss$puj$1 at panix2.panix.com...
> > In article <3B4CA0A8.20B53230 at tundraware.com>,
> > Tim Daneliuk <tundra at tundraware.com> wrote:
> > >
> > >Supposed I did want 0 argument pairs in that tuple, but I wanted to
> prepare
> > >the way for adding some later. Would I use:
> > >
> > > (()), (), ((,)) ???
> >
> > Um. Tuples are immutable. How do you add more later?
>
> With a text editor: he's talking about modifying constant data structures as
> design proceeds.
>
Right, I'm using this structure as an entry in a Jump Table for a command
interpreter. I want to be able to add recognized commands and/or features
simply by changing/adding things in the table.
This thread has been illunminating on a couple of levels. If I may
summarize:
1) The syntatic constructor for tuples is ',' not '(' - the latter being
just another grouping character. (Someone pointed out the former in
a private email, and it all suddenly made sense).
2) There is some stylistic difference of opinion when/where it is advisable
to depart from a complex data structure and start using a class instead.
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com
More information about the Python-list
mailing list