GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-116021: Deprecate support for instantiating abstract AST nodes by brianschubert · Pull Request #137865 · python/cpython Conversation
|
| check(_ast.AST(), size('P')) | ||
| with self.assertWarns(DeprecationWarning): | ||
| check(_ast.AST(), size('P')) |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think this should probably be rewritten, but I'm not sure I understand the goal of this test well enough to do that. Suggestions welcome!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's to check that objects in Python/ have the correct types. I don't know why it's actually in test_sys though. I think we should split this test and move each check to the module it belongs (ast.AST's size should be checked in test_ast).
For now, leave it here. A separate issue should be opened.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think it's here because it's arguably testing sys.getsizeof. Maybe it could be changed to test a concrete AST class instead?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
check(_ast.Module(), size('3P')) might work then? (not sure if I'm counting the object size right)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@JelleZijlstra @picnixz any further thoughts re: above? Happy to update this is someone can confirm a good substitute
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, what you suggest should work (haven't verified the object size is right).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looking again 3P seems right, updated!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would it be easier to have a module function checking if a node is abstract? say _ast.is_abstract(node) (in the C module, not the Python module). That way we don't need an additional method on AST objects (which could be shadowed).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| check(_ast.AST(), size('P')) | ||
| with self.assertWarns(DeprecationWarning): | ||
| check(_ast.AST(), size('P')) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's to check that objects in Python/ have the correct types. I don't know why it's actually in test_sys though. I think we should split this test and move each check to the module it belongs (ast.AST's size should be checked in test_ast).
For now, leave it here. A separate issue should be opened.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| return result; | ||
| } | ||
|
|
||
| /* Helper for checking if a node class is abstract in the tests. */ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think we should use clinic here, but this would create a new file as we don't use it at all. Maybe we can do it in a follow-up PR though.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Bénédikt Tran <[email protected]>
3.14 + 5 = 3.19
| check(_ast.AST(), size('P')) | ||
| with self.assertWarns(DeprecationWarning): | ||
| check(_ast.AST(), size('P')) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think it's here because it's arguably testing sys.getsizeof. Maybe it could be changed to test a concrete AST class instead?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Jelle Zijlstra <[email protected]>
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.