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/2010-April/099074.html below:

[Python-Dev] nonlocals() function?

[Python-Dev] nonlocals() function? [Python-Dev] nonlocals() function?Greg Ewing greg.ewing at canterbury.ac.nz
Mon Apr 5 10:32:41 CEST 2010
Carl M. Johnson wrote:

> * It would make "method" in dir(obj) marginally faster

Wouldn't hasattr(obj, "method") be a better way
to do that?


> * Even though the order isn’t important for code, it’s convenient at
> the interactive prompt to see the methods of an item in alphabetical
> order for quick scanning.

Since I suspect this is most people's main use for
dir(), I think it's a good enough reason for leaving
things as they are.

-- 
Greg

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