Proper annotations
See original GitHub issueRight now mypy, pyright and other static type analyzers are screaming from annotations like this: id: Integer(primary_key=True)
mypy error:
lmat/db/models.py:33: error: Invalid type comment or annotation [valid-type]
lmat/db/models.py:33: note: Suggestion: use Integer[...] instead of Integer(...)
pyright error:
Expected class type but received "Integer" Pyright (reportGeneralTypeIssues)
Why id = Integer(primary_key=True)
syntax is not used (like in orm
)? I guess it is because of the way you extract annotations, do you consider changing the approach? I would like to use this library in one project, but it is unusable in this state (I cannot just put # type: ignore[valid-type]
on every line in models)
Can help with this when I have some spare time, unfortunately I am forced to go back to orm
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
How to Annotate | English Composition I
First, determine how you will annotate the text you are about to read. ... Write any comments or observations you feel appropriate to...
Read more >Annotating a Text - Hunter College - CUNY
Annotating a text, or marking the pages with notes, is an excellent, if not essential, way to make the most out of the...
Read more >Annotating a Text - Reading and Study Strategies
Annotating is any action that deliberately interacts with a text to enhance the reader's understanding of, recall of, and reaction to the ...
Read more >Annotation Tips for Students : Hypothesis
In many cases, this means analyze don't summarize — what your teachers have been telling you in English class since middle school. But...
Read more >4 ways to Annotate a text:
Annotating a text, or marking the pages with notes, is an excellent, ... Annotations make it easy to find important information quickly when....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Suffering from this right now. In VSCode I have Pylance type checking on. It is based on Pyright and Mypy.
So when I don’t use annotation, like this:
size = ormar.Integer(minimum=0, default=0)
no screamingBut, when I add annotation:
size: int = ormar.Integer(minimum=0, default=0)
i get the error:Adding
# type: ignore
to the file top of the file or to separate line hides the errorSorry for late answer, will try to tackle this one in the nearest future. Any help welcomed! 😊