This repository has been archived by the owner on Apr 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Integration with mypy #119
Labels
feature
New feature or request
Comments
rossmacarthur
changed the title
Can this library be used with MyPy?
Support Python >=3.5 type annotations
Nov 24, 2019
Hi @radix at the moment import datetime
import uuid
from serde import Model
class Artist(Model):
id: uuid.UUID
name: str
birthday: datetime.date See the following for a list of types that are supported like this: Lines 1308 to 1331 in ad6d24b
In the future I want to make this library automatically convert from serde import Model
from typing import List, Tuple
class Example(Model):
things: List[Tuple[str, int, str]] |
rossmacarthur
changed the title
Support Python >=3.5 type annotations
Support Python >=3.5 typing module / integrate with mypy
Nov 25, 2019
rossmacarthur
changed the title
Support Python >=3.5 typing module / integrate with mypy
Integration with mypy
Feb 8, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm not sure if the serde field type annotations are compatible with MyPy. For example, with this code:
Running mypy on the code gives the following result (in addition to an error about the fact that
serde
doesn't have a type definition module):So, on the surface, it seems that this library is incompatible with MyPy. Is this true, or is there a way to get them to work together?
The text was updated successfully, but these errors were encountered: