A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-December/018847.html below:

[Python-Dev] nested scopes confusion

[Python-Dev] nested scopes confusion [Python-Dev] nested scopes confusionJeremy Hylton jeremy@zope.com
Tue, 4 Dec 2001 15:06:53 -0500 (EST)
>>>>> "TH" == Thomas Heller <thomas.heller@ion-tof.com> writes:

  >> > How do I achieve the desired effect? Note that the default
  >> > argument trick (def mth(i=i): ...) does not work because *args
  >> > is present.
  >>
  >> Use a class with a __call__ method:

  TH> That's what I was trying to avoid, because it is too slow.

Calling a regular method on an instance is about 5x faster than
calling an instance that defines an __call__().  

But the performance characteristics of class vs. function is really
the bottleneck of your application?  Are you sure that nested fuctions
are really cheaper?

Jeremy




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4