Attribute definition, WHY?
bragib at my-deja.com
bragib at my-deja.com
Tue Sep 12 13:17:42 EDT 2000
More information about the Python-list mailing list
Tue Sep 12 13:17:42 EDT 2000
- Previous message (by thread): Attribute definition, WHY?
- Next message (by thread): Attribute definition, WHY?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Why would you want to do the following:
class A:
attr1 = [1,2]
def __init__(self,name):
self.name = name
and not
class A:
def __init__(self,name):
self.name = name
self.attr1 = [1,2]
Are there benefits to the first definition?
Bragi
Sent via Deja.com http://www.deja.com/
Before you buy.
- Previous message (by thread): Attribute definition, WHY?
- Next message (by thread): Attribute definition, WHY?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list