Example #1
0
 def __getnewargs__(self):
     return (deconstruct_generic(self.type_), )
Example #2
0
def test_custom_metaclass_deconstructible(args):
    t = KindaGeneric[args]
    decons = deconstruct_generic(t)
    recons = reconstruct_generic(decons)
    assert recons is t
Example #3
0
def test_deconstruct_reconstruct_type(type_):
    assert reconstruct_generic(deconstruct_generic(type_)) == type_
Example #4
0
def test_deconstruct_reconstruct_type(generic, type_):
    t = generic[type_]
    assert reconstruct_generic(deconstruct_generic(t)) == t
Example #5
0
 def __init__(self, name, return_type, doc=None):
     self.return_type = deconstruct_generic(return_type)
     super().__init__(name, doc=doc)