MCPcopy Create free account
hub / github.com/cloudpipe/cloudpickle / _get_bases

Function _get_bases

cloudpickle/cloudpickle.py:633–644  ·  view source on GitHub ↗
(typ)

Source from the content-addressed store, hash-verified

631
632
633def _get_bases(typ):
634 if "__orig_bases__" in getattr(typ, "__dict__", {}):
635 # For generic types (see PEP 560)
636 # Note that simply checking `hasattr(typ, '__orig_bases__')` is not
637 # correct. Subclasses of a fully-parameterized generic class does not
638 # have `__orig_bases__` defined, but `hasattr(typ, '__orig_bases__')`
639 # will return True because it's defined in the base class.
640 bases_attr = "__orig_bases__"
641 else:
642 # For regular class objects
643 bases_attr = "__bases__"
644 return getattr(typ, bases_attr)
645
646
647def _make_dict_keys(obj, is_ordered=False):

Callers 1

_class_getnewargsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected