diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-31 15:26:04 +0000 |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-31 15:26:04 +0000 |
| commit | e974571d36009e327a97bb83389cf05c2b858288 (patch) | |
| tree | 2f4985227e462222cdb88331aa6aa04c29d71a00 /Doc/library/operator.rst | |
| parent | 65b4af34d706206f45f0a4fb5768548b176f977e (diff) | |
| download | cpython-git-e974571d36009e327a97bb83389cf05c2b858288.tar.gz | |
Issue #10160: Speed up operator.attrgetter. Patch by Christos Georgiou.
Diffstat (limited to 'Doc/library/operator.rst')
| -rw-r--r-- | Doc/library/operator.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index 2d030615cc..efefaa690e 100644 --- a/Doc/library/operator.rst +++ b/Doc/library/operator.rst @@ -336,6 +336,8 @@ expect a function argument. b.date)``. Equivalent to:: def attrgetter(*items): + if any(not isinstance(item, str) for item in items): + raise TypeError('attribute name must be a string') if len(items) == 1: attr = items[0] def g(obj): |
