-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Weakref unsupported in AST #81
Comments
My use case: My library does analysis of graphql queries, including figuring out the schema type of each node (for later directive finding). The slots & no weakref situation means that I can't attach data directly to nodes, I'll keep the nodes around if I keep them in a dictionary, and I'll leak data if I use the object IDs. |
Thanks for the feedback, @astronouth7303. Does it solve your problem when we add |
Yup, that'll fix it up nice. I think there might be a slight memory increase, something like an extra pointer per instance. I'm not intimately familiar with what |
graphql.language.ast
makes extensive use of__slots__
but__weakref__
is given, breaking theweakref
module.__slots__
The use of
__slots__
without__weakref__
makes it very hard to track data about AST nodes in a non-leaky way.The text was updated successfully, but these errors were encountered: