You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [3]: from koerce import Annotable
In [4]: class Bar(Annotable):
...: x: int
...:
In [5]: class Foo(Annotable):
...: bar: Bar = Bar(1)
...:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[5], line 1
----> 1 class Foo(Annotable):
2 bar: Bar = Bar(1)
File koerce/_internal.pyx:3169, in koerce._internal.AnnotableMeta.__new__()
File koerce/_internal.pyx:2687, in koerce._internal.Parameter.__init__()
File koerce/_internal.pyx:1391, in koerce._internal.AsCoercible.match()
File koerce/_internal.pyx:3284, in koerce._internal.Annotable.__coerce__()
TypeError: __coerce__() takes exactly 2 positional arguments (1 given)
The text was updated successfully, but these errors were encountered:
cpcloud
changed the title
can't nest annotable objects
can't nest annotable objects with defaults
Sep 1, 2024
In [6]: class Foo(Annotable):
...: bar: Bar
...:
In [7]: Foo(Bar(1))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[7], line 1
----> 1 Foo(Bar(1))
File koerce/_internal.pyx:3196, in koerce._internal.AnnotableMeta.__call__()
File koerce/_internal.pyx:3101, in koerce._internal.AnnotableSpec.new()
File koerce/_internal.pyx:1391, in koerce._internal.AsCoercible.match()
File koerce/_internal.pyx:3284, in koerce._internal.Annotable.__coerce__()
TypeError: __coerce__() takes exactly 2 positional arguments (1 given)
Ooops, can you just delete Annotable.__coerce__? My original idea was to allow coercing dictionaries to annotable objects, but I haven't finished the implementation of that.
The text was updated successfully, but these errors were encountered: