[issue47213] arrow at wrong place

2022-04-04 Thread apostofes


New submission from apostofes :

arrow should be after `a`

--
components: Library (Lib)
files: Screenshot (1044).png
messages: 416663
nosy: apostofes
priority: normal
severity: normal
status: open
title: arrow at wrong place
type: enhancement
versions: Python 3.7
Added file: https://bugs.python.org/file50718/Screenshot (1044).png

___
Python tracker 
<https://bugs.python.org/issue47213>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47254] enhanced dir?

2022-04-07 Thread apostofes


New submission from apostofes :

current dir gives output like this,
```
from collection import OrderedDict
od = OrderedDict({'a': 1, 'b': 2, 'c': 3})
print(dir(od))
```
```
['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__',
 '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__',
 '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__',
 '__iter__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__reduce__',
 '__reduce_ex__', '__repr__', '__reversed__', '__setattr__', '__setitem__',
 '__sizeof__', '__str__', '__subclasshook__', 'clear', 'copy', 'fromkeys',
 'get', 'items', 'keys', 'move_to_end', 'pop', 'popitem', 'setdefault',
 'update', 'values']
```
but wouldn't it be better if the output was like this,
```

{'OrderedDict': {'__contains__', '__delitem__', '__dir__', '__eq__',
  '__format__', '__ge__', '__getitem__', '__gt__', '__init__', 
'__init_subclass__',
  '__iter__', '__le__', '__lt__', '__ne__', '__reduce__', 
'__reduce_ex__',
  '__repr__', '__reversed__', '__setitem__', '__sizeof__', 
'__subclasshook__',
  'clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 
'move_to_end', 'pop',
  'popitem', 'setdefault', 'update', 'values'},
'dict': {'__getattribute__', '__len__', '__new__'},
'object': {'__delattr__', '__setattr__', '__str__'}}
```
???

--
messages: 416948
nosy: apostofes
priority: normal
severity: normal
status: open
title: enhanced dir?
type: enhancement
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue47254>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47254] enhanced dir?

2022-04-07 Thread apostofes


Change by apostofes :


--
keywords: +patch
pull_requests: +30433
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32408

___
Python tracker 
<https://bugs.python.org/issue47254>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47254] enhanced dir?

2022-04-07 Thread apostofes


apostofes  added the comment:

would adding an argument to dir be a possible solution,
like,
```
l = [1, 2, 3]
dir(l, categorize=True)
```

--

___
Python tracker 
<https://bugs.python.org/issue47254>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47254] enhanced dir?

2022-04-07 Thread apostofes


apostofes  added the comment:

plus I would want it to have some more methods,
```
l = [1, 2, 3]
```
using enhanced dir should give,
```
{'list': {'__add__', '__contains__', '__delitem__', '__eq__', '__ge__',
 '__getattribute__', '__getitem__', '__gt__', '__iadd__', '__imul__',
 '__init__', '__init_subclass__', '__iter__', '__le__', '__len__',
 '__lt__', '__mul__', '__ne__', '__new__', '__repr__',
 '__reversed__', '__rmul__', '__setitem__', '__sizeof__',
 '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend',
 'index', 'insert', 'pop', 'remove', 'reverse', 'sort'},
'object': {'__delattr__', '__dir__', '__format__', '__reduce__', 
'__reduce_ex__', '__setattr__', '__str__'}}
```
obtained from, (here only printing, made a dictionary in the implementation in 
the PR)
```
for j in dir(l):
print(f'l.{j}.__qualname__')
```
this check fails for,
```
{'list': {'__doc__', '__hash__', '__class__'}}
```
I would also want these,
```
{'list': {'__instancecheck__','__subclasscheck__', '__subclasses__', 'mro'},
 'type': {'__call__', '__prepare__'}}
```
which were obtained from,
```
for j in set(dir(type(l))) - set(dir(l)):
print(f'l.{j}.__qualname__')
```

and it fails for,
```
{'list': {'__abstractmethods__', '__base__', '__bases__', '__basicsize__', 
'__dict__', '__dictoffset__',
   '__flags__', '__itemsize__', '__module__', '__mro__',
   '__name__', '__qualname__', '__text_signature__', 
'__weakrefoffset__'}
```

--

___
Python tracker 
<https://bugs.python.org/issue47254>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com