-
-
Notifications
You must be signed in to change notification settings - Fork 252
Closed
Labels
Description
Thanks for the excellent bpython.
I would like to propose some different behaviour for displaying private/internal attributes (i.e., those prefixed with _). This is the current behaviour:
>>> a=""
>>> a.
┌──────────────────────────────────────────────────────────────┐
│__add__ __class__ │
│__contains__ __delattr__ │
│__doc__ __eq__ │
│__format__ __ge__ │
│__getattribute__ __getitem__ │
│__getnewargs__ __getslice__ │
│__gt__ __hash__ │
│__init__ __le__ │
│__len__ __lt__ │
│__mod__ __mul__ │
│__ne__ __new__ │
│__reduce__ __reduce_ex__ │
│__repr__ __rmod__ │
│__rmul__ __setattr__ │
│__sizeof__ __str__ │
│__subclasshook__ _formatter_field_name_split │
│_formatter_parser capitalize │
│center count │
│decode encode │
│endswith ... │
└──────────────────────────────────────────────────────────────┘
I propose two changes:
Change the sorting behaviour, so that attributes prefixed with _ appear after all other attributes. This means public members are seen first. It shouldn't change the sorting behaviour of attribute names that contain an _ in a different position.
Add an option to disable the display of these attributes. The user can still get those completions, but they have to type a._ to force those completions to become visible.
- Bitbucket: https://bitbucket.org/bobf/bpython/issue/62
- Originally Reported By: Ben Papworth
- Originally Created At: 2009-09-23T17:57:00.844
Reactions are currently unavailable