Bas van Beek

Results 59 comments of Bas van Beek

> If you really need to describe a module as a type, one option is to use a protocol class to describe the interface provided by the module in question....

Correct, I'll see if I can make some time next week to review the issue but this is by no means a blocker.

> If possible it would be nice to have a unit test proving that both the context manager syntax and the normal syntax work. Sorry, but considering the PLAMS test...

LGTM, though it might be good to verify if the currently available downstream implementations properly satisfy subtype the protocol as this could potentially reveal some typing-related corner cases that we've...

It's (unfortunately) more contrived than ideal, but the typing itself is perfectly solid. Just to give a bit more background: It's long been possible to create an object (well... a...

> Or would we have to change all functions to classes with __call__ methods? The latter I'm afraid, or at least for all functions that you'd like to include in...

> My hope is to have this library be installable and useful for type-checking purposes and as ABCs (protocols are ABCs when used as a base class). Once we have...

I did some trial and error yesterday and managed to cobble a script together for automatically carrying out this `def ...` -> `class ...` conversion. Turns out it's not all...

> I'm a little surprised that no one noticed this on SciPy or NumPy yet - IDE and static analysis tools seem to work okay there with editable installs which...

Prior to 3.10 you can always use `builtins.ellipsis`. It's a bit of a semi-private type-check only type (xref https://github.com/python/typeshed/issues/7580), but it's fully functional otherwise and correctly type checks. EDIT: `types.EllipsisType`...