Misunderstanding classes (newbie)
2jerry at writeme.com
Wed Feb 23 00:07:41 CET 2000
This is just a list of class elements ? no ?
def __init__(self, last=None,first=None,age=0):
Is that you want ?
Best Regard, Jerry the foolish dracomorpheus, - france -
sorry at spam.invalid a écrit dans le message ...
>I'm a Python newbie (and an OOP newbie) trying to
>construct a class that:
> (a) behaves like a list but has a FORTRAN-like variable
> starting index,
> (b) has per-index attributes.
>i.e. Each element of the list has two (or more) attributes,
> and, by default, the first element is at x.
>e.g. x.lastname, x.firstname, x.age
> x.lastname, x.firstname, x.age
>I seem to be able to get each part of the solution
>independently (the first part by using UserList and
>__getitem__), but when I attempt to combine them, I
>clearly don't understand what I'm doing.
>P.S. Please respond to the list.
More information about the Python-list