Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle types.EllipsisType (and friends?) #498

Open
flying-sheep opened this issue Oct 25, 2024 · 0 comments
Open

Handle types.EllipsisType (and friends?) #498

flying-sheep opened this issue Oct 25, 2024 · 0 comments

Comments

@flying-sheep
Copy link
Contributor

flying-sheep commented Oct 25, 2024

s-a-t tries to document types.EllipsisType as :class:`types.EllipsisType` , but its index entry as data, so it needs special handling, together with a few friends:

sphobjinv co json -u https://docs.python.org/3/objects.inv - | get entries | where name =~ '^types\.' and role == 'data'
╭────┬─────────────────────────────────┬────────┬──────┬──────────┬──────────────────────┬──────────╮
│  # │              name               │ domain │ role │ priority │         uri          │ dispname │
├────┼─────────────────────────────────┼────────┼──────┼──────────┼──────────────────────┼──────────┤
│  0 │ types.AsyncGeneratorType        │ py     │ data │ 1        │ library/types.html#$ │ -        │
│  1 │ types.BuiltinFunctionType       │ py     │ data │ 1        │ library/types.html#$ │ -        │
│  2 │ types.BuiltinMethodType         │ py     │ data │ 1        │ library/types.html#$ │ -        │
│  3 │ types.CellType                  │ py     │ data │ 1        │ library/types.html#$ │ -        │
│  4 │ types.ClassMethodDescriptorType │ py     │ data │ 1        │ library/types.html#$ │ -        │
│  5 │ types.CoroutineType             │ py     │ data │ 1        │ library/types.html#$ │ -        │
│  6 │ types.EllipsisType              │ py     │ data │ 1        │ library/types.html#$ │ -        │
│  7 │ types.FrameType                 │ py     │ data │ 1        │ library/types.html#$ │ -        │
│  8 │ types.FunctionType              │ py     │ data │ 1        │ library/types.html#$ │ -        │
│  9 │ types.GeneratorType             │ py     │ data │ 1        │ library/types.html#$ │ -        │
│ 10 │ types.GetSetDescriptorType      │ py     │ data │ 1        │ library/types.html#$ │ -        │
│ 11 │ types.LambdaType                │ py     │ data │ 1        │ library/types.html#$ │ -        │
│ 12 │ types.MemberDescriptorType      │ py     │ data │ 1        │ library/types.html#$ │ -        │
│ 13 │ types.MethodDescriptorType      │ py     │ data │ 1        │ library/types.html#$ │ -        │
│ 14 │ types.MethodType                │ py     │ data │ 1        │ library/types.html#$ │ -        │
│ 15 │ types.MethodWrapperType         │ py     │ data │ 1        │ library/types.html#$ │ -        │
│ 16 │ types.NoneType                  │ py     │ data │ 1        │ library/types.html#$ │ -        │
│ 17 │ types.NotImplementedType        │ py     │ data │ 1        │ library/types.html#$ │ -        │
│ 18 │ types.WrapperDescriptorType     │ py     │ data │ 1        │ library/types.html#$ │ -        │
╰────┴─────────────────────────────────┴────────┴──────┴──────────┴──────────────────────┴──────────╯

others do have class as they should, so the solution can’t do data references for all types.* members:

sphobjinv co json -u https://docs.python.org/3/objects.inv - | get entries | where name =~ '^types\.' and role == 'class'
╭───┬────────────────────────┬────────┬───────┬──────────┬──────────────────────┬──────────╮
│ # │          name          │ domain │ role  │ priority │         uri          │ dispname │
├───┼────────────────────────┼────────┼───────┼──────────┼──────────────────────┼──────────┤
│ 0 │ types.CapsuleType      │ py     │ class │ 1        │ library/types.html#$ │ -        │
│ 1 │ types.CodeType         │ py     │ class │ 1        │ library/types.html#$ │ -        │
│ 2 │ types.GenericAlias     │ py     │ class │ 1        │ library/types.html#$ │ -        │
│ 3 │ types.MappingProxyType │ py     │ class │ 1        │ library/types.html#$ │ -        │
│ 4 │ types.ModuleType       │ py     │ class │ 1        │ library/types.html#$ │ -        │
│ 5 │ types.SimpleNamespace  │ py     │ class │ 1        │ library/types.html#$ │ -        │
│ 6 │ types.TracebackType    │ py     │ class │ 1        │ library/types.html#$ │ -        │
│ 7 │ types.UnionType        │ py     │ class │ 1        │ library/types.html#$ │ -        │
╰───┴────────────────────────┴────────┴───────┴──────────┴──────────────────────┴──────────╯
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant