A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/349058.html below:

Silly function call lookup stuff?

Silly function call lookup stuff? Silly function call lookup stuff?simonwittber at gmail.com simonwittber at gmail.com
Wed Sep 28 10:15:01 EDT 2005
> > I guess because the function name may be re-bound between loop iterations.
> >  Are there good applications of this?  I don't know.

I have iterator like objects which dynamically rebind the .next method
in order to different things. When I want a potentially infinite
iterator to stop, I rebind its .next method to another method which
raises StopIteration. This saves lots of messy if/elif state checking
in the .next method, which I _need_ to be very fast.

>
> Yuk I'd hate that. I think it would be extremely rare.
>

I use it all the time. Dynamically rebinding methods is a nice way to
change and maintain state between calls.

Sw.


More information about the Python-list mailing list

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