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 — bpo-47084: Clear cached representations on finalization by jkloth · Pull Request #32032 · python/cpython Conversation
|
| ('off', 'import __hello__'), | ||
| ('on', 'import __hello__'), | ||
| ) | ||
| for flag, stmt in tests: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can you please use with self.subTest(flag=flag, stmt=stmt):? Otherwise, it will be more complicated to debug if a test fails. With that, you can omit f"{xopt}, stmt='{stmt}' -> {out}") below.
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.
Didn't know about TestCase.subTest(), thanks.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
|
|
||
| void | ||
| _PyStaticUnicode_Dealloc(PyObject *op) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to share code between this function and unicode_dealloc()? Maybe add an unicode_dealloc_common() function?
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, there is the duplication of the PyObect_Free() calls, but not really to the level of what I would consider "in common". I did, however, refactor out the duplication of the 1-character singletons and frozen strings deallocation into a standalone static function.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
What started out as different behavior for each type ended up being identical after edge cases were discovered.
|
Merged, thanks! Well spotted! |
Sorry, something went wrong.
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.