[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

about 'setattr(o, name, value)' and 'inspect.signature(f)'

in CPython,

instead of trying each object and function,

is there any rules can help me answer the following questions ?

or is there any third part documentations
[community driven docs ? wiki ?]
that can answer them ?

1. 'setattr(o, name, value)' can be used for what kind of objects ?

   section '2. Built-in Functions'
   of the official documentation says :

   > The function assigns the value to the attribute, provided the object allows it.

2. what kind of functions does not have signature,
   so that 'inspect.signature(f)' can be used for them ?

   section '29.12.3. Introspecting callables with the Signature object'
   of the official documentation says :

   > Some callables may not be introspectable in certain implementations of Python.
   > For example, in CPython, some built-in functions defined in C
   > provide no metadata about their arguments.

   this is depends on implementation, so I ask for CPython.