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 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 ac
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
>
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 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)
>
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 _
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 i
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 = a
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
>> >
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
> >
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
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):
>
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 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):
>
14 matches
Mail list logo