Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé
Module « inspect » Python 3.13.2

Classe « Signature »

Informations générales

Héritage

builtins.object
    Signature

Définition

class Signature(builtins.object):

help(Signature)

A Signature object represents the overall signature of a function.
It stores a Parameter object for each parameter accepted by the
function, as well as information specific to the function itself.

A Signature object has the following public attributes and methods:

* parameters : OrderedDict
    An ordered mapping of parameters' names to the corresponding
    Parameter objects (keyword-only arguments are in the same order
    as listed in `code.co_varnames`).
* return_annotation : object
    The annotation for the return type of the function if specified.
    If the function has no annotation for its return type, this
    attribute is set to `Signature.empty`.
* bind(*args, **kwargs) -> BoundArguments
    Creates a mapping from positional and keyword arguments to
    parameters.
* bind_partial(*args, **kwargs) -> BoundArguments
    Creates a partial mapping from positional and keyword arguments
    to parameters (simulating 'functools.partial' behavior.)

Constructeur(s)

Signature du constructeur Description
__init__(self, parameters=None, *, return_annotation, __validate_parameters__=True) Constructs Signature from the given list of Parameter [extrait de __init__.__doc__]

Liste des propriétés

Nom de la propriétéDescription
parameters
return_annotation

Liste des opérateurs

Signature de l'opérateur Description
__eq__(self, other)

Opérateurs hérités de la classe object

__ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__hash__(self)
__reduce__(self)
__replace__(self, *, parameters=<class 'inspect._void'>, return_annotation=<class 'inspect._void'>) Creates a customized copy of the Signature. [extrait de replace.__doc__]
__repr__(self)
__setstate__(self, state)
__str__(self)
bind(self, /, *args, **kwargs) Get a BoundArguments object, that maps the passed `args` [extrait de bind.__doc__]
bind_partial(self, /, *args, **kwargs) Get a BoundArguments object, that partially maps the [extrait de bind_partial.__doc__]
format(self, *, max_width=None) Create a string representation of the Signature object. [extrait de format.__doc__]
from_callable(obj, *, follow_wrapped=True, globals=None, locals=None, eval_str=False) Constructs Signature for the given callable object. [extrait de from_callable.__doc__]
replace(self, *, parameters=<class 'inspect._void'>, return_annotation=<class 'inspect._void'>) Creates a customized copy of the Signature. [extrait de replace.__doc__]

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __init_subclass__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Vous êtes un professionnel et vous avez besoin d'une formation ? RAG (Retrieval-Augmented Generation)
et Fine Tuning d'un LLM
Voir le programme détaillé