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

Lazily create attributes that are created often, but read rarely. #674

Open
markshannon opened this issue May 7, 2024 · 0 comments
Open

Comments

@markshannon
Copy link
Member

There are objects that we create frequently that have attributes that are rarely used and can be computed lazily.
We should compute these lazily to save the overhead of creating and destroying them in most cases.

Most of these attributes are mutable, so we still need a field for them. We can initialize the field to NULL and compute it on demand.

  • Function
    • __name__
    • __qualname__
    • __doc__
  • Generator
    • __name__
    • __qualname__
  • Traceback
    • tb_lineno

Others?

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