Thomas M Kehrenberg

Results 112 comments of Thomas M Kehrenberg

I think you can just copy the signature of `np.mean`? Returning a `Union` is not so nice, because then the type checker always has to deal with all the types...

I am also missing this feature, as I am migrating some code from `pipenv` to `poetry`. `pipenv` has `PIPENV_IGNORE_VIRTUALENVS` which has [exactly the effect](https://stackoverflow.com/questions/48680012/force-pipenv-to-create-a-new-virtualenv) that's wished for here.

The title of the issue should probably be something like "stubgen drops default values for function arguments". Saying it "drops types" seems a bit misleading.

The problem is that there is a lot of code out there that relies on this pattern. But I believe that `pyre-check` has the behavior that you want. The downside...

> If you are using protocols for mixins, why not ABCs? With ABCs, there is the problem that I can't define abstract attributes, like the `len: int` in the example...

There's also [Hjson](https://hjson.github.io/) which looks like this: ```hjson version: 1 title: My Document abstract: ''' This is my very, very, very, long abstract... ''' toc: true author: [ { name:...

I opened a discussion with a syntax proposal and some examples: https://github.com/python/typing/discussions/1387

Yeah, mypy doesn't narrow on tuples. I commented on it here: https://github.com/python/mypy/pull/12267#issuecomment-1058132318 But apparently the worry is that it is too computationally expensive. EDIT: hmm, maybe it's not the same...

I have a PR to fix this, #13797, but it doesn't look like it'll get merged.

From the mypy primer output it seems like you need to exclude class definitions in stub files from your check.