Alex Hall wrote:
On 10/21/11, Steven D'Aprano wrote:
[...]
The one exception to this is if your class changes the method signature.
E.g. if A.method takes no arguments, but B.method requires an argument.
super cannot help you now. But changing the signature of methods is
almost always the wron
On 10/21/11, Steven D'Aprano wrote:
> Alex Hall wrote:
>> Hi all,
>> I am just curious: I have seen classes that are subclasses initialize
>> their parents through both super and parentClass.__init__. What is the
>> difference, if any, and is one "better" or "more pythonic" than the
>> other?
>
>
Prasad, Ramit wrote:
Interesting thread and webpages. Insightful, but is this really
used as a technique in daily practice? It feels a bit like a hack
to me. Like the author of one of the websites said: rule #1 don't
mess with this.
I think the problem with rule #1 is that this can occur when y
On 21/10/11 17:37, Crusier wrote:
want to learn more about Web Praser. I know there is something called
Beautiful Soup but I think it is kind of difficult for me at this
stage.
One of the objectives of Beautiful Soup is to make parsing fairly easy.
Its certainly easier than most of the other
Alex Hall wrote:
Hi all,
I am just curious: I have seen classes that are subclasses initialize
their parents through both super and parentClass.__init__. What is the
difference, if any, and is one "better" or "more pythonic" than the
other?
A simple question with a complicated answer...
Firs
On 21/10/11 21:40, Albert-Jan Roskam wrote:
Interesting thread and webpages. Insightful, but is this really used as
a technique in daily practice?
Yes, one example is where you use it for a counter to
determine how often a function gets called:
def reserveScarceResource(p1,p2,count = [0]): :
Hi all,
I am just curious: I have seen classes that are subclasses initialize
their parents through both super and parentClass.__init__. What is the
difference, if any, and is one "better" or "more pythonic" than the
other?
--
Have a great day,
Alex (msg sent from GMail website)
mehg...@gmail.com
>Interesting thread and webpages. Insightful, but is this really used as a
>technique in daily practice? It feels a bit like a hack to me. Like the author
>of one of the websites said: rule #1 don't mess with this.
I think the problem with rule #1 is that this can occur when you do *not*
under
Interesting thread and webpages. Insightful, but is this really used as a
technique in daily practice? It feels a bit like a hack to me. Like the author
of one of the websites said: rule #1 don't mess with this.
Cheers!!
Albert-Jan
>The same thing occurs when you use a mutable object like a list or a
>dict. The default value is assigned once, and once only. But notice that
>you can modify the default value, say by appending to it:
Not sure this will work exactly the same way in other IDEs, but in mine:
>>> a = []
>>> def
Crusier wrote:
Hi,
I am new to programming. I want to know what I should look at if I
want to learn more about Web Praser. I know there is something called
Beautiful Soup but I think it is kind of difficult for me at this
stage.
What do you mean by "web parser"? The web (world wide web) is a n
Praveen Singh wrote:
In function-
"Default value is *evaluated only once*.This makes different when the
default is a mutable object such as a list, dictionary or instance of most
classes."
I am not getting it properly-evaluated once?? different behaviour???--
please explain this.
Look at an
Hi,
I am new to programming. I want to know what I should look at if I
want to learn more about Web Praser. I know there is something called
Beautiful Soup but I think it is kind of difficult for me at this
stage.
Thank you
Regards,
Crusier
___
Tutor m
On 2011/10/21 03:00 PM, Praveen Singh wrote:
In function-
"Default value is *evaluated only once*.This makes different when the
default is a mutable object such as a list, dictionary or instance of
most classes."
I am not getting it properly-evaluated once?? different behaviour???--
please
In function-
"Default value is *evaluated only once*.This makes different when the
default is a mutable object such as a list, dictionary or instance of most
classes."
I am not getting it properly-evaluated once?? different behaviour???--
please explain this.
_
15 matches
Mail list logo