On Wednesday April 28 2010 20:57:27 C M Caine wrote:
> Thank you all. One tangentially related question: what does (self,
> *args, **kwargs) actually mean? How does one reference variables given
> to a function that accepts these inputs?
*args is a tuple containing the positional arguments;
**kwa
Thank you all. One tangentially related question: what does (self,
*args, **kwargs) actually mean? How does one reference variables given
to a function that accepts these inputs?
Colin
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subs
On Wednesday April 28 2010 13:04:30 Steven D'Aprano wrote:
> On Wed, 28 Apr 2010 04:53:06 pm Walter Wefft wrote:
> > Steven D'Aprano wrote:
> > > And for guru-level mastery, replace to call to dict.__init__ with
> > > ...
> >
> > nothing at all, because dict.__init__ doesn't do anything.
>
> [..
On 4/28/2010 9:32 AM Walter Wefft said...
Emile van Sebille wrote:
On 4/28/2010 3:20 AM Walter Wefft said...
You reiterate my point. To say that dict.__init__ can be omitted in a
subclass's __init__ with no effect, is not a correct statement.
It wasn't the omitted case that exhibits the diff
Emile van Sebille wrote:
On 4/28/2010 3:20 AM Walter Wefft said...
spir ☣ wrote:
On Wed, 28 Apr 2010 07:53:06 +0100
Walter Wefft wrote:
===
class MyDict0(dict):
pass
class MyDict1(dict):
def __init__(self, *args, **kw):
pass
class MyDict2(dict):
def __init__(self
On 4/28/2010 3:20 AM Walter Wefft said...
spir ☣ wrote:
On Wed, 28 Apr 2010 07:53:06 +0100
Walter Wefft wrote:
===
class MyDict0(dict):
pass
class MyDict1(dict):
def __init__(self, *args, **kw):
pass
class MyDict2(dict):
def __init__(self, *args, **kw):
dict.__ini
On Wed, 28 Apr 2010 04:53:06 pm Walter Wefft wrote:
> Steven D'Aprano wrote:
> > And for guru-level mastery, replace to call to dict.__init__ with
> > ...
>
> nothing at all, because dict.__init__ doesn't do anything.
[...]
> Behaviour is different depending on whether you call the superclass
> _
spir ☣ wrote:
On Wed, 28 Apr 2010 07:53:06 +0100
Walter Wefft wrote:
Steven D'Aprano wrote:
> And for guru-level mastery, replace to call to dict.__init__ with ...
nothing at all, because dict.__init__ doesn't do anything.
>
>
>
(Sorry, should have sent to list).
I don't understand thi
On Wed, 28 Apr 2010 07:53:06 +0100
Walter Wefft wrote:
> Steven D'Aprano wrote:
> > And for guru-level mastery, replace to call to dict.__init__ with ...
> nothing at all, because dict.__init__ doesn't do anything.
> >
> >
> >
>
> (Sorry, should have sent to list).
>
> I don't understand t
Steven D'Aprano wrote:
> And for guru-level mastery, replace to call to dict.__init__ with ...
nothing at all, because dict.__init__ doesn't do anything.
>
>
>
(Sorry, should have sent to list).
I don't understand this - it must do something:
class MyDict1(dict):
def __init__(self, *args,
"Steven D'Aprano" wrote
On Wed, 28 Apr 2010 07:24:48 am C M Caine wrote:
I'm writing a class that inherits the inbuilt dict class and want
some of my own code to run at initialisation, on the other hand, I
still want the original dict.__init__ function to run. ...
This is the general techni
On Wed, 28 Apr 2010 08:08:12 am Steven D'Aprano wrote:
> Some people argue that you must call dict.__init__ even though it
> doesn't do anything. Their reasoning is, some day its behaviour might
> change, and if you don't call it in your subclass, then your class
> may break. This is true, as far
On Wed, 28 Apr 2010 07:24:48 am C M Caine wrote:
> I'm writing a class that inherits the inbuilt dict class and want
> some of my own code to run at initialisation, on the other hand, I
> still want the original dict.__init__ function to run. Can I ask the
> class to run the original __init__ and t
I'm writing a class that inherits the inbuilt dict class and want some
of my own code to run at initialisation, on the other hand, I still
want the original dict.__init__ function to run. Can I ask the class
to run the original __init__ and then my own function at
initialisation automatically? If s
14 matches
Mail list logo