[Python-Dev] a nicer looking dir() (original) (raw)
Mike Klaas mike.klaas at gmail.com
Thu Feb 19 02:53:52 CET 2009
- Previous message: [Python-Dev] Duck-typing self
- Next message: [Python-Dev] Peephole Optimization
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Someone has implemented a version of dir() which is much nicer for
human consumption. The difference is striking enough that I thought
it would be bringing to python-dev's attention.
http://github.com/inky/see/tree/master
pencil_case = [] dir(pencil_case) ['add', 'class', 'contains', 'delattr', 'delitem',
'delsli ce', 'doc', 'eq', 'ge', 'getattribute',
'getitem', 'gets lice', 'gt', 'hash', 'iadd',
'imul', 'init', 'iter', ' le', 'len', 'lt',
'mul', 'ne', 'new', 'reduce', 'r educe_ex',
'repr', 'reversed', 'rmul', 'setattr', 'setitem ',
'setslice', 'str', 'append', 'count', 'extend', 'index',
'insert', 'p op', 'remove', 'reverse', 'sort'] see(pencil_case)
? [] for in + * += *= < <= == != > >= len() .append() .count()
.extend() .index() .insert() .pop() .remove() .reverse() .sort()
I'm not sure that this type of functionality merits a new built-in,
but it might be useful as part of help()'s output.
-Mike
- Previous message: [Python-Dev] Duck-typing self
- Next message: [Python-Dev] Peephole Optimization
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]