Primary
vars() ⚬ᵖʸ|Documentation|1st|20251021210211-00-⌔
Built-in Functions — Python 3 documentation#vars
vars()
vars(object,/)Return the
__dict__attribute for a module, class, instance, or any other object with a__dict__attribute.Objects such as modules and instances have an updateable
__dict__attribute; however, other objects may have write restrictions on their__dict__attributes (for example, classes use atypes.MappingProxyTypeto prevent direct dictionary updates).Without an argument,
vars()acts likelocals().A
TypeErrorexception is raised if an object is specified but it doesn’t have a__dict__attribute (for example, if its class defines the__slots__attribute).Changed in version 3.13: The result of calling this function without an argument has been updated as described for the
locals()builtin.Printed 2026-06-28.
(echo:: @ ᯤ)
Link to original
Secondary
• • •