On Sun, Apr 4, 2010 at 1:44 PM, Steven D'Aprano <steve at pearwood.info> wrote: > On Mon, 5 Apr 2010 09:03:17 am average wrote: >> presently). That includes dir() too and probably others. > > You are confused -- globals() and locals() don't return lists. Yeah, this thread is mostly a mess (what would nonlocals() return anyway?), but there is one serious suggestion in there. Maybe dir() should return a set. Points in its favor: * The results of dir() are non-repeating * The order of items returned by dir() is not especially important * It would make "method" in dir(obj) marginally faster Points against: * It would break code that tried dir(obj)[0] (but why would anyone 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. Overall: -0 My two bits. -- Carl Johnson
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