Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError on deserialization into Tuple[T, ...] #11

Closed
haluzpav opened this issue Feb 19, 2019 · 1 comment
Closed

AttributeError on deserialization into Tuple[T, ...] #11

haluzpav opened this issue Feb 19, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@haluzpav
Copy link
Contributor

When running following code

from typing import Tuple
import jsons
from dataclasses import dataclass

@dataclass
class A:
    tup: Tuple[str, ...]

a = A(('abc', 'qwe', '123'))
a_ser = jsons.dump(a)
a_deser = jsons.load(a_ser, A)

I get exception AttributeError: 'ellipsis' object has no attribute '__origin__' on the last line.

I can simply use List[str] as type, but it would be nice to be able to deserialize into tuple of variable length.

@ramonhagenaars ramonhagenaars added the bug Something isn't working label Feb 20, 2019
@ramonhagenaars
Copy link
Owner

Thank you haluzpav. This issue has been resolved in jsons 0.6.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants