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.
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
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
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
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
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
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
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*
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;
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]):
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...
First
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
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
On 10/21/11, Steven D'Aprano st...@pearwood.info 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?
14 matches
Mail list logo