Matthew Hoffman

Results 20 comments of Matthew Hoffman

> I think this should be handled with some sort of flag (`--consider-annotations-are-correct`). I support this. If we could assume hinted return types were correct, I would think we could...

I don't think this is an arbitrary thing to support. PEP 518, the spec for `pyproject.toml`, specifically has a section describing the [tool table](https://peps.python.org/pep-0518/#tool-table), "where any tool related to your...

> Is there any progress on it? I don't think it is planned for this project.

@casperdcl is this reviewable? I'd really like to consume this fix for VS Code

The difference in behavior between `add_params` and `remove_params` seems to come from [this line in `check_self_arg `](https://github.com/python/mypy/blob/2c225659f3ae3089a597b9ab148050dd97c48cc9/mypy/checkmember.py#L860): ```python if subtypes.is_subtype(dispatched_arg_type, erase_typevars(erase_to_bound(selfarg))): ``` | `name` | `selfarg` | `dispatched_arg_type` | `subtypes.is_subtype(...)`...

What was the error you were seeing?

Seems like it got its return type from `flyte_entity_call_handler`: https://github.com/flyteorg/flytekit/blob/cba830ea0c9844f8079342ae99a2105b507eca2e/flytekit/core/promise.py#L1132-L1134 also there is a `type: ignore` comment on the return of `Task.__call__`. Maybe we can start with making sure this...

Getting a similar problem with `pylint` on [`torch.nn.Module.to()`](https://github.com/pytorch/pytorch/blob/8dc60010573fd8249657d7711f39cc1e339a6b11/torch/nn/modules/module.py#L1030-L1043): ```python from __future__ import annotations from typing import Any, Union, overload class device: ... class Tensor: ... class dtype: ... class Module:...

I think `Any` is a good choice. That is the default for untyped parameters for most type checkers. ```python def foo(x: int, y) -> None: ... reveal_type(foo) # pyright reveals...

I was asking about this over at https://github.com/microsoft/pyright/issues/4331 and got back a few suggestions... and the virtual superclass approach was not one of them. I will have to play around...