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
dict.fromkeys() #37531
Comments
Implements dict.sequpdate() as discussed on python- def sequpdate(self, iterable, value=True):
for k in iterable:
self[k] = value
return self |
Logged In: YES I see no reason why d.sequpdate() should return self. Also, as I suggested on python-dev, a fromseq() constructor >>> dict.fromseq('End Quit Stop Abort'.split())
{'End': True, 'Quit': True, 'Stop': True, 'Abort': True}
>>> |
Logged In: YES One more thing: I'd say the default value should be None. |
Logged In: YES Attached revised patch incorporating all of the review Tests, docs, and news item revised accordingly. Ready for BDFL pronouncement. |
Logged In: YES Hm, but the convention for "alternate constructors" is that |
Logged In: YES Done! Revise patch attached. It is now a class method and uses cls for the type of the |
Logged In: YES It seems the code and the docs are out of sync in The docs say "fromseq(sequence, value=True)" while the |
Logged In: YES Fixed news item. |
Logged In: YES
|
Logged In: YES dang, that should've read "you should NOT incref d at the end". |
Logged In: YES Okay, fixed decrefs, eliminated i; used for(;;). |
Logged In: YES Btw. I was looking for more info on METH_CLASS and came http://mail.python.org/pipermail/python-dev/2002-April/023566.html |
Logged In: YES I'm ok with this, but I haven't had time to review the code. |
Logged In: YES After more code review, added PyDict_Check. Also, discussion on python-dev showed a need to rename Checked-in as: |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: