This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年10月30日 02:34 by ivank, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| dict.update.__doc__.patch | ivank, 2010年10月30日 02:34 | mention fast path and .keys() | ||
| Messages (5) | |||
|---|---|---|---|
| msg119954 - (view) | Author: ivank (ivank) | Date: 2010年10月30日 02:34 | |
It would be nice if dict.update.__doc__ conveyed some of the subtleties of the update algorithm. See the patch. I changed __doc__ to mention the fast path for dicts, and changed one instance of E: -> E.keys(): |
|||
| msg119961 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2010年10月30日 06:07 | |
I'm not sure that we should mention the fast path for dicts. That is an implementation detail and may not be present in IronPython, PyPy, Jython, etc. The current version includes: D.updated(E, **F) --> None. Updated D for dict/iterable E and F. ISTM that covers the semantics of what it does. Your proposed modification gets into how it does it. |
|||
| msg119962 - (view) | Author: ivank (ivank) | Date: 2010年10月30日 06:32 | |
CPython's dict(obj) ignores `keys` and `__iter__` if obj is a subclass of dict. I thought this was an important language detail, not just an implementation quirk. But, I just tested pypy 1.3, and it is calling .keys() on dicts. Oh well. I think the __doc__ can still be slightly improved; ignore my patch and just change the first E: to E.keys(): - that would be more accurate. |
|||
| msg119978 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2010年10月30日 12:59 | |
Maybe the fastpath should do a strict check and not be used for subclasses of dict? |
|||
| msg214412 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2014年03月21日 22:09 | |
> Maybe the fastpath should do a strict check and not > be used for subclasses of dict? This code is ancient and well-established. IMO, nothing good can come from changing it (besides slowing down code that is already deployed and working fine). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:08 | admin | set | github: 54449 |
| 2014年09月01日 07:19:45 | rhettinger | set | status: open -> closed resolution: rejected |
| 2014年08月31日 07:41:27 | berker.peksag | set | nosy:
- berker.peksag |
| 2014年03月21日 22:09:31 | rhettinger | set | assignee: docs@python -> rhettinger messages: + msg214412 |
| 2014年03月21日 08:54:34 | berker.peksag | set | nosy:
+ berker.peksag, docs@python assignee: docs@python components: + Documentation, - Interpreter Core versions: + Python 3.4, Python 3.5, - Python 3.1, Python 3.2 |
| 2010年11月02日 19:02:18 | eric.araujo | set | nosy:
+ eric.araujo versions: - Python 2.6, Python 2.5, Python 3.3 |
| 2010年10月30日 12:59:48 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg119978 |
| 2010年10月30日 06:32:32 | ivank | set | messages: + msg119962 |
| 2010年10月30日 06:07:24 | rhettinger | set | nosy:
+ rhettinger messages: + msg119961 |
| 2010年10月30日 02:34:06 | ivank | create | |