Message403311
If I understand the problem correctly, these mis-attributions of roles (to 'data' instead of 'class' come about when a thing that is technically a class is defined in source using simple assignment, as with UnionType.
Problematic entries will thus have 'data' as role, and their identifiers will be camel-cased.
So, as a quick search to identify likely candidates:
>>> import re, sphobjinv as soi
>>> from pprint import pprint
>>> inv = soi.Inventory(url="https://docs.python.org/3.10/objects.inv")
# Find entries where the first character after the final period
# is uppercase, and the second character after the final period
# is lowercase.
>>> pat = re.compile(r"([.][A-Z][a-z])[^.]*$")
>>> pprint([obj.name for obj in inv.objects if obj.role == "data" and pat.search(obj.name)])
['_thread.LockType',
'ast.PyCF_ALLOW_TOP_LEVEL_AWAIT',
'ast.PyCF_ONLY_AST',
'ast.PyCF_TYPE_COMMENTS',
'importlib.resources.Package',
'importlib.resources.Resource',
'socket.SocketType',
'types.AsyncGeneratorType',
'types.BuiltinFunctionType',
'types.BuiltinMethodType',
'types.CellType',
'types.ClassMethodDescriptorType',
'types.CoroutineType',
'types.EllipsisType',
'types.FrameType',
'types.FunctionType',
'types.GeneratorType',
'types.GetSetDescriptorType',
'types.LambdaType',
'types.MemberDescriptorType',
'types.MethodDescriptorType',
'types.MethodType',
'types.MethodWrapperType',
'types.NoneType',
'types.NotImplementedType',
'types.UnionType',
'types.WrapperDescriptorType',
'typing.Annotated',
'typing.Any',
'typing.AnyStr',
'typing.Callable',
'typing.ClassVar',
'typing.Concatenate',
'typing.Final',
'typing.Literal',
'typing.NoReturn',
'typing.Optional',
'typing.ParamSpecArgs',
'typing.ParamSpecKwargs',
'typing.Tuple',
'typing.TypeAlias',
'typing.TypeGuard',
'typing.Union',
'weakref.CallableProxyType',
'weakref.ProxyType',
'weakref.ProxyTypes',
'weakref.ReferenceType']
I would guess those 'ast.PyCF...' objects can be ignored, they appear to be constants? |
|
Date |
User |
Action |
Args |
2021-10-06 15:13:37 | bskinn | set | recipients:
+ bskinn, docs@python, lukasz.langa, gaborjbernat |
2021-10-06 15:13:37 | bskinn | set | messageid: <1633533217.29.0.0731385416598.issue45391@roundup.psfhosted.org> |
2021-10-06 15:13:37 | bskinn | link | issue45391 messages |
2021-10-06 15:13:36 | bskinn | create | |
|