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-161635: Add PyList_AsTupleAndClear() function by vstinner · Pull Request #161637 · python/cpython Conversation
|
Documentation build overview
|
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.
Great stuff! This would be useful for us in msgspec's type convertion :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| self.assertEqual(lst, []) | ||
|
|
||
| lst = [] # empty list | ||
| self.assertIs(list_as_tuple_and_clear(lst), ()) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
question: is () being a singleton a contract or implementation detail? if the former, it would be better to compare the equality.
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.
Ah, that's a tricky question. It's more an implementation detail. But I would like to test this implementation detail, to check that we don't loose this optimization in a future refatoring.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@vstinner should we do the same with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I found a few functions calling
So only make_union() with its I'm not sure that it's worth it to add a public PySet_AsFrozenSetAndClear() function right now. ... Also, I'm working on |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
No, I would prefer to have a well-designed public API :) |
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.