@@ -397,6 +397,7 @@ are always available. They are listed here in alphabetical order.
397397 string. The string must be the name of one of the object's attributes. The
398398 function deletes the named attribute, provided the object allows it. For
399399 example, ``delattr(x, 'foobar') `` is equivalent to ``del x.foobar ``.
400+ *name * need not be a Python identifier (see :func: `setattr `).
400401
401402
402403.. _func-dict :
@@ -738,6 +739,7 @@ are always available. They are listed here in alphabetical order.
738739 value of that attribute. For example, ``getattr(x, 'foobar') `` is equivalent to
739740 ``x.foobar ``. If the named attribute does not exist, *default * is returned if
740741 provided, otherwise :exc: `AttributeError ` is raised.
742+ *name * need not be a Python identifier (see :func: `setattr `).
741743
742744 .. note ::
743745
@@ -1582,6 +1584,12 @@ are always available. They are listed here in alphabetical order.
15821584 object allows it. For example, ``setattr(x, 'foobar', 123) `` is equivalent to
15831585 ``x.foobar = 123 ``.
15841586
1587+ *name * need not be a Python identifier as defined in :ref: `identifiers `
1588+ unless the object chooses to enforce that, for example in a custom
1589+ :meth: `~object.__getattribute__ ` or via :attr: `~object.__slots__ `.
1590+ An attribute whose name is not an identifier will not be accessible using
1591+ the dot notation, but is accessible through :func: `getattr ` etc..
1592+
15851593 .. note ::
15861594
15871595 Since :ref: `private name mangling <private-name-mangling >` happens at
0 commit comments