Avasam
Avasam
Related question: What should be done when `__all__` is wrong? Specifically when it includes a symbol that can't be imported at runtime / doesn't exist. Should the stub omit those...
> You should fix it upstream ;-) Fair, but a decision still has to be taken in the mean time while developping stubs >.< I think the best is to...
> Add to this that it also crashes when trying to check JSON files with comments: [...] Sorry to bump on this. I still haven't found any open-source all-in-one solution...
For what it's worth, I changed from flake8 to Ruff, so this is less of a priority to get nitpick working for me.
I'm less concerned about a user doing `from module import __all__`, but more about `from module import *` and not having the correct imported symbols because it was forgotten in...
I now have an actual example where enforcing this would've helped a typeshed contributor other than myself: https://github.com/python/typeshed/pull/10544#discussion_r1312361085
It shouldn't be too hard to add progressively with `.*\.__all__` allowlist entries anyway right? I imagine a lot of `__all__` will be non-trivial due to missing symbols (or worst: invalid...
Is this considered "referencing at the top level"? ```py import os import sys def __get_auto_split_directory(): return os.path.dirname(sys.executable if frozen else os.path.abspath(__file__)) frozen = hasattr(sys, "frozen") """Running from build made by...
@HeWeMel You can create a new `nographs.Infinity` type based on `float("inf")` (https://docs.python.org/3/library/typing.html#newtype) and expose an instance of it as a helper constant (`nographs.INFINITY` for example). Similarly to how the math...
How would `AnyOf[SomeClass, Any/Unknow]` be treated? I ask because of complex cases like this: https://github.com/python/typeshed/pull/9461 Where we could do the following without having to rely on installing all 4 libraries....