b3j0f.utils.proxy module

b3j0f.utils.proxy.get_proxy(elt, bases=None, _dict=None)[source]

Get proxy from an elt.

Parameters:
  • elt (object or function/method) – elt to proxify.
  • bases – base types to enrich in the result cls if not None.
  • _dict – class members to proxify if not None.
b3j0f.utils.proxy.proxify_routine(routine, impl=None)[source]

Proxify a routine with input impl.

Parameters:
  • routine – routine to proxify.
  • impl – new impl to use. If None, use routine.
b3j0f.utils.proxy.proxify_elt(elt, bases=None, _dict=None)[source]

Proxify a class with input elt.

Parameters:
  • elt – elt to proxify.
  • bases – elt class base classes.
  • _dict – elt class content.
Returns:

proxified element.

Raises:

TypeError if elt does not implement all routines of bases and _dict.

b3j0f.utils.proxy.is_proxy(elt)[source]

Return True if elt is a proxy.

Parameters:elt – elt to check such as a proxy.
Returns:True iif elt is a proxy.
Return type:bool
b3j0f.utils.proxy.proxified_elt(proxy)[source]

Get proxified element.

Parameters:proxy – proxy element from where get proxified element.
Returns:proxified element. None if proxy is not proxified.