In article [EMAIL PROTECTED],
M.-A. Lemburg [EMAIL PROTECTED] wrote:
It is always good practice to provide default values for instance
variables in the class definition, both to enhance readability and to
allow adding documentation regarding the variables, e.g.
Actually, my company uses an
On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote:
Is it better to do this:
class Class_a():
def __init__(self, args):
self.a = args.a
self.b = args.b
self.c = args.c
self.d = args.d
def method_ab(self):
On 25 Nov, 08:27, John O'Hagan [EMAIL PROTECTED] wrote:
Is it better to do this:
class Class_a():
def __init__(self, args):
self.a = args.a
self.b = args.b
self.c = args.c
self.d = args.d
def
On 2008-11-25 08:27, John O'Hagan wrote:
Is it better to do this:
class Class_a():
def __init__(self, args):
self.a = args.a
self.b = args.b
self.c = args.c
self.d = args.d
def method_ab(self):
snip
It is always good practice to provide default values for
instance variables in the class definition, both to enhance
readability and to allow adding documentation regarding
the variables, e.g.
class Class_a:
# Foo bar
a = None
# Foo baz
b = None
snip
Those are not
On Tue, 25 Nov 2008, Marc 'BlackJack' Rintsch wrote:
On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote:
Is it better to do this:
class Class_a():
def __init__(self, args):
self.a = args.a
self.b = args.b
self.c = args.c
On Tue, 25 Nov 2008 10:48:01 +, John O'Hagan wrote:
On Tue, 25 Nov 2008, Marc 'BlackJack' Rintsch wrote:
On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote:
Is it better to do this:
class Class_a():
def __init__(self, args):
self.a = args.a
self.b =
On Nov 25, 5:48 pm, John O'Hagan [EMAIL PROTECTED] wrote:
On Tue, 25 Nov 2008, Marc 'BlackJack' Rintsch wrote:
On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote:
Is it better to do this:
class Class_a():
def __init__(self, args):
self.a = args.a
M.-A. Lemburg a écrit :
(snip)
It is always good practice to provide default values for
instance variables in the class definition, both to enhance
readability and to allow adding documentation regarding
the variables, e.g.
Your opinion. As far as I'm concerned, using class variables this way
On Tue, 25 Nov 2008, Rafe wrote:
On Nov 25, 5:48 pm, John O'Hagan [EMAIL PROTECTED] wrote:
On Tue, 25 Nov 2008, Marc 'BlackJack' Rintsch wrote:
On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote:
Is it better to do this:
class Class_a():
def __init__(self, args):
On Nov 25, 8:49 pm, John O'Hagan [EMAIL PROTECTED] wrote:
is there an
difference in efficiency (for large enough number of methods and arguments)
between
a) passing all arguments to __init__() and accessing them via self within
individual methods:
class = Class(all_class_args)
John O'Hagan [EMAIL PROTECTED] writes:
insofar as one is only interested in accessing methods, is there an
difference in efficiency (for large enough number of methods and
arguments) between
a) passing all arguments to __init__() and accessing them via self
within individual methods:
On Tue, 25 Nov 2008 10:21:18 +0100, M.-A. Lemburg wrote:
It is always good practice to provide default values for instance
variables in the class definition, both to enhance readability and to
allow adding documentation regarding the variables, e.g.
class Class_a:
# Foo bar
a =
On Wed, 26 Nov 2008, Ben Finney wrote:
John O'Hagan [EMAIL PROTECTED] writes:
insofar as one is only interested in accessing methods, is there an
difference in efficiency (for large enough number of methods and
arguments) between
a) passing all arguments to __init__() and accessing them
Is it better to do this:
class Class_a():
def __init__(self, args):
self.a = args.a
self.b = args.b
self.c = args.c
self.d = args.d
def method_ab(self):
return self.a + self.b
def
15 matches
Mail list logo