Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
attr._make.Converter Class Reference

Public Member Functions

 __init__ (self, converter, *takes_self=False, takes_field=False)
 
 __getstate__ (self)
 
 __setstate__ (self, state)
 

Public Attributes

 converter
 
 takes_self
 
 takes_field
 

Protected Member Functions

str _fmt_converter_call (self, str attr_name, str value_var)
 

Static Protected Member Functions

str _get_global_name (str attr_name)
 

Protected Attributes

 _first_param_type
 

Detailed Description

Stores a converter callable.

Allows for the wrapped converter to take additional arguments. The
arguments are passed in the order they are documented.

Args:
    converter (Callable): A callable that converts the passed value.

    takes_self (bool):
        Pass the partially initialized instance that is being initialized
        as a positional argument. (default: `False`)

    takes_field (bool):
        Pass the field definition (an :class:`Attribute`) into the
        converter as a positional argument. (default: `False`)

.. versionadded:: 24.1.0

Member Function Documentation

◆ __getstate__()

attr._make.Converter.__getstate__ (   self)
Return a dict containing only converter and takes_self -- the rest gets
computed when loading.

◆ __setstate__()

attr._make.Converter.__setstate__ (   self,
  state 
)
Load instance from state.

◆ _fmt_converter_call()

str attr._make.Converter._fmt_converter_call (   self,
str  attr_name,
str  value_var 
)
protected
Return a string that calls the converter for an attribute name
*attr_name* and the value in variable named *value_var* according to
`self.takes_self` and `self.takes_field`.

◆ _get_global_name()

str attr._make.Converter._get_global_name ( str  attr_name)
staticprotected
Return the name that a converter for an attribute name *attr_name*
would have.

The documentation for this class was generated from the following file: