Skip to content

Handle types.EllipsisType (and friends?) #498

Closed
@flying-sheep

Description

@flying-sheep

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#$ │ -        │
╰───┴────────────────────────┴────────┴───────┴──────────┴──────────────────────┴──────────╯

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions