[Python-checkins] Clarify that example in comment is about fromkeys() (GH-8141)

Raymond Hettinger webhook-mailer at python.org
Fri Jul 6 11:52:32 EDT 2018


https://github.com/python/cpython/commit/dc9bc548994066897ca4edfdbf36ea9272bfdee9
commit: dc9bc548994066897ca4edfdbf36ea9272bfdee9
branch: master
author: Raymond Hettinger <rhettinger at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018年07月06日T08:52:26-07:00
summary:
Clarify that example in comment is about fromkeys() (GH-8141)
files:
M Lib/collections/__init__.py
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index cd2d2bfc1073..4724b0edf33a 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -610,7 +610,7 @@ def elements(self):
 @classmethod
 def fromkeys(cls, iterable, v=None):
 # There is no equivalent method for counters because the semantics
- # would be ambiguous in cases such as Counter('aaabbc', v=2).
+ # would be ambiguous in cases such as Counter.fromkeys('aaabbc', v=2).
 # Initializing counters to zero values isn't necessary because zero
 # is already the default value for counter lookups. Initializing
 # to one is easily accomplished with Counter(set(iterable)). For


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /