Skip to content

change: Trigger instance events after package is loaded? #346

@pawamoy

Description

@pawamoy

Is your change request related to a problem? Please describe.

Extensions parse docstrings and modify the cached parsed attribute to append/remove sections. But now parsers fetch annotations from inherited members. And both inherited members and resolved bases are cached... they will be cached too early. Even if we stop caching them, parsers won't be able to fetch inherited members if they run before the whole package is loaded.

Describe the solution you'd like

First, and most urgent: stop caching resolved bases and inherited members.

Then, either:

  • modify hooks so that "instance" hooks always run once the whole package is loaded (still requires that other necessary packages are pre-loaded before that)
  • go back to "uncache parsed docstrings", and force extensions to modify the value attribute (with parsing/splitting + re-dumping/insertion/deletion). Docstring styles must anyway be set correctly before attempting any splitting/parsing, caching or not doesn't change that fact.

Describe alternatives you've considered

/

Additional context

#340

Metadata

Metadata

Assignees

Labels

refactorChange suggestion, not a bug nor a feature.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions