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/2008-May/079142.html below:

[Python-Dev] Dotted/indexed defs ? Re: PEP 8: Discourage named lambdas?

[Python-Dev] Dotted/indexed defs ? Re: PEP 8: Discourage named lambdas? [Python-Dev] Dotted/indexed defs ? Re: PEP 8: Discourage named lambdas?Boris Borcic bborcic at gmail.com
Mon May 5 12:43:14 CEST 2008
Mike Klaas wrote:

> Another thing to consider is that the def() pattern is only possible 
> when the bound variable has no dots.  A common pattern for me is to 
> replace an instances method with a lambda to add monitoring hooks or 
> disable certain functionality:
> 
> inst.get_foo = lambda: FakeFoo()

Good point. That one may write eg

     for inst.bar in range(10) : do_something()

makes one wonder whether

     def inst.bar(...) : ...

or even

     def fn[k](...) : ...

should be similarly permitted. Has this ever been discussed ?

Regards, BB

More information about the Python-Dev 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