Re:Practical Python Programming
by kqr on Friday June 19, 2020 @06:09AM
(#23572928)
> For example, let's say you use Mongoengine. Now, you can query a collection by using MyObject.objects.get(...) and it will return a MyObject. You might be able to make that work in Mypy. Now, you use some fancy aggregation feature, passing a dict into Mongoengine and it changes the type of the result you get back. How will you typehint that? I think the only way would be to special case it for all your queries.
Isnt this the case any time you use a DSL to query external data? Only sometimes someone else have type-hinted the things for you.
I work in a strongly typed language (F#) that interops with JS, and one of our principles is to do the type checking on the F#--JS boundary and then not have to worry about it again.
Isnt this the case any time you use a DSL to query external data? Only sometimes someone else have type-hinted the things for you.
I work in a strongly typed language (F#) that interops with JS, and one of our principles is to do the type checking on the F#--JS boundary and then not have to worry about it again.