-
Notifications
You must be signed in to change notification settings - Fork 270
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
Type hint plumbing functions #600
Comments
I thought about that too. The project structure was intended to be roughly this:
The distinction between plumbing and drainage primarily has to do with import cycle issues. According to above description, large parts of plumbing would belong into drainage, but it was tricky to plan that ahead properly. So I made sure the porcelain is properly typed, but of course I'll try and add types when I have some spare time. The problem I see is that annotating has a cascading effect, and adding a 1-2 annotations led to our mypy going nuts. |
i had some time to play around with this. the strict flag is comprised of a whole bunch of flags. We can definitely improve the types, but some of the errors are so pedantic that i doubt we can fix them without a serious amount of jumping through burning hoops. Half of the flags do pass though: #620 |
My issues were fixed in So I'll close this issue 🚀 |
Functions like
plumbing.build_basic_type()
are used by users that develop customOpenApiSerializerFieldExtension
and similar. If those users usemypy --strict
to check their code, because some ofdrf-spectacular
is typed and includespy.typed
, the following mypy errors are thrown.The types of this function need to be applied:
Ideally, all functions would be typed, but that could take some effort.
plumbing
seems to have a lot of functions that could be used by end users, so that could be a good place to focus.The text was updated successfully, but these errors were encountered: