Atributos especiales

Atributos especiales de los objetos en Python

__dict__

Contiene un diccionario u otro objeto del tipo de colección de datos que almacena los atributos modificables de un objeto.



fuente: https://docs.python.org/3/reference/datamodel.html#types

__doc__

The function’s documentation string, or None if unavailable; not inherited by subclasses.

Writable

__name__

The function’s name.

Writable

__qualname__

The function’s qualified name.

New in version 3.3.

Writable

__module__

The name of the module the function was defined in, or None if unavailable.

Writable

__defaults__

A tuple containing default argument values for those arguments that have defaults, or None if no arguments have a default value.

Writable

__code__

The code object representing the compiled function body.

Writable

__globals__

A reference to the dictionary that holds the function’s global variables — the global namespace of the module in which the function was defined.

Read-only

__dict__

The namespace supporting arbitrary function attributes.

Writable

__closure__

None or a tuple of cells that contain bindings for the function’s free variables. See below for information on the cell_contents attribute.

Read-only

__annotations__

A dict containing annotations of parameters. The keys of the dict are the parameter names, and 'return' for the return annotation, if provided. For more information on working with this attribute, see Annotations Best Practices.

Writable

__kwdefaults__

A dict containing defaults for keyword-only parameters.

Writable

Comentarios

Entradas populares