Attach docstrings to NewTypes at runtime#441
Attach docstrings to NewTypes at runtime#441Seth Fitzsimmons (mojodna) wants to merge 1 commit intodevfrom
Conversation
Bare triple-quoted strings after NewType assignments are expression statements that Python never attaches to the NewType object, leaving __doc__ as None. Convert each to an explicit __doc__ assignment so codegen and introspection tools can read them at runtime. Same pattern DocumentedEnum uses for enum member docs.
|
Can we talk about this? It breaks the documentation generator ( |
|
Interesting... I had to do this to support Markdown/code generation because the docstrings that come after the |
|
I also ran into the same issue where rather than explicit An other related issue I've come across has been with the Segment alias which is also not know anymore at runtime which I had solved using |
Summary
NewTypeassignments into explicit__doc__assignments so docstrings are accessible at runtimeNewTypeobject (__doc__staysNone)DocumentedEnumuses for enum member docsAffected packages
overture-schema-system(primitives, strings, ref/id)overture-schema-core(names, opening_hours)