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
{{ message }}
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
Is one of the purposes of this issue / feature request to provide type hinting in VSCode and PyCharm?
fromdatetimeimportdateimporttypesystemclassArtist(typesystem.Schema):
name=typesystem.String(max_length=100) # type: strclassAlbum(typesystem.Schema):
title=typesystem.String(max_length=100) # type: strrelease_date=typesystem.Date() # type: dateartist=typesystem.Reference(Artist) # type: Artistalbum=Album.validate({
"title": "Double Negative",
"release_date": "2018-09-14",
"artist": {"name": "Low"}
})
album.artist.name# the expected resultant type of name is str but the inspector shows Field unless I add the # type as above.
Is your issue about making Field class more of a mix-in (or use composition instead of inheritance)?
I am interested because this lack of correct type being provided by the inspector is a deal breaker for my team. The #type type override is perhaps an acceptable band-aid though as ugly as it is.
NOTE: pydantic, although not nearly as elegant and simple to use as typesystem in my opinion, provides the expected field type to the inspector by using the plain type. Perhaps that project should be mentioned in the Alternatives section of README.md.
Is one of the purposes of this issue / feature request to provide type hinting in VSCode and PyCharm?
Not specficially, but I guess that's a bit related. I'm just not convinced by my earlier design decision to have the schemas be instances themselves. I think it'd likely be neater if they were just that classes that provided the validate/serialize behavior. (And have the actually instances themselves be whatever actual type you want to use for the models)
Btw. Very welcome to add pydantic to the relevant README section if you'd like, yup.
Activity
skewty commentedon May 12, 2019
Is one of the purposes of this issue / feature request to provide type hinting in VSCode and PyCharm?
Is your issue about making
Fieldclass more of a mix-in (or use composition instead of inheritance)?I am interested because this lack of correct type being provided by the inspector is a deal breaker for my team. The
#typetype override is perhaps an acceptable band-aid though as ugly as it is.NOTE: pydantic, although not nearly as elegant and simple to use as typesystem in my opinion, provides the expected field type to the inspector by using the plain type. Perhaps that project should be mentioned in the Alternatives section of README.md.
Thanks!
lovelydinosaur commentedon May 21, 2019
Not specficially, but I guess that's a bit related. I'm just not convinced by my earlier design decision to have the schemas be instances themselves. I think it'd likely be neater if they were just that classes that provided the
validate/serializebehavior. (And have the actually instances themselves be whatever actual type you want to use for the models)Btw. Very welcome to add pydantic to the relevant README section if you'd like, yup.
update alternatives
update alternatives (#100)