A couple questions

Gonçalo Rodrigues op73418 at mail.telepac.pt
Wed May 15 12:33:44 EDT 2002


Hi, just a couple a questions,

1. If I have a class as in

class Somesuch(object):
    <whatever>

in the __init__ method should I/must I call object.__init__? I am asking
this because in GvR's descintro, the object cass __init__ method is said
to be a no-op (it does nothing).

2. What is the pythonic way to traverse a list while modifying it? Put
in another way, is

for i in range(len(mylist)):
    <change mylist here>

safe or am I bound to use a while loop with an explicit counter?

TIA and all the best,
Gonçalo Rodrigues



More information about the Python-list mailing list