diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-09-29 23:25:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-29 23:25:29 (GMT) |
commit | 0688f110a660999828a544bfb7cef263cdd41d62 (patch) | |
tree | b6cfd0441289ec7316631305eea87053b6106aa6 /Doc/glossary.rst | |
parent | b7b261a8f353384784e57f1e72340789a0c1aaa2 (diff) | |
download | cpython-0688f110a660999828a544bfb7cef263cdd41d62.zip cpython-0688f110a660999828a544bfb7cef263cdd41d62.tar.gz cpython-0688f110a660999828a544bfb7cef263cdd41d62.tar.bz2 |
gh-96397: Document that attributes need not be identifiers (GH-96454)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
(cherry picked from commit 9a11ed8e50492d327e4de0a8f3a473e788b14a6f)
Co-authored-by: Jeff Allen <ja.py@farowl.co.uk>
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r-- | Doc/glossary.rst | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 24daf19..aa9768f 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -136,10 +136,17 @@ Glossary :exc:`StopAsyncIteration` exception. Introduced by :pep:`492`. attribute - A value associated with an object which is referenced by name using - dotted expressions. For example, if an object *o* has an attribute + A value associated with an object which is usually referenced by name + using dotted expressions. + For example, if an object *o* has an attribute *a* it would be referenced as *o.a*. + It is possible to give an object an attribute whose name is not an + identifier as defined by :ref:`identifiers`, for example using + :func:`setattr`, if the object allows it. + Such an attribute will not be accessible using a dotted expression, + and would instead need to be retrieved with :func:`getattr`. + awaitable An object that can be used in an :keyword:`await` expression. Can be a :term:`coroutine` or an object with an :meth:`__await__` method. |