I've faced with the following problems during the type checking using pyright tool. (Python 3.11, pyright 1.1.310) My code: class TypeCast(str, enu ...
I've faced with the following problems during the type checking using pyright tool. (Python 3.11, pyright 1.1.310) My code: class TypeCast(str, enu ...
Here is an example: class A: def __init__(self, a=1, b=2, c=3): self.a = a self.b = b self.c = c class B(A): def __i ...
I have the code below, where I want to pass a request object to an Http Get function Why does get accept the object from helperObj and not the interf ...
I have an issue with mypy giving the following error: Incompatible return value type (got "Dict[str, Pin]", expected "Union[Dict[str, Input], Dict[st ...
Problem Statement The TypeScript 4.8 static type inference/check seems to be inconsistent: I find it odd that one of the methods gives a different ...
I'm trying to figure out the type hinting for a couple of abstract classes that I want to use as base classes for classes have a create function. Spec ...
I'm looking for a Method type that I could use to annotate imported instance methods, since Callable[[Self, ...], ...] doesn't works. Example: mod_m ...
New to TypeScript here. I'm trying to define an interface for "things that have a .toString() method", where the .toString() can accept any number of ...
How does mypy apply the Liskov substitution principle to *args, **kwargs parameters? I thought the following code should fail a mypy check since some ...
I wrote some SPA web application. In it, fetch nested data from a web API. The interfaces are following: interface A { id: string arrayOfB: B[] } ...
This is the code I have so far, but my input can be a boolean or a list of size 2 (str and int). Here is part of the code : But I get the error : ...
How can I check which subclass an instance belongs to, without using isinstance? (My understanding is that using isinstance is considered bad practice ...
I currently have this code But I think the T in the alias Grid is bound to a different T in the return type of the function. How do I define Grid ...
While trying to specify the return type of a function that returns a list of functions, I am experiencing some difficulties. The typechecker retrurns: ...
I wonder why mypy produces so many "Returning Any from function declared to return ..." errors when it has to deal with numpy. In the example below, a ...
I am creating a model where the field is constrained by decimal places and is positive. I could just create a custom validator, but I was hoping to ha ...
Okay, I have a set of dictionaries that contain a key/ID and a function. Said dictionaries are used as identifiers that point to a specific cache key ...
I want something like the style prop in the default HTML components: style itself is an optional prop, and the fields inside the object passed to s ...
. Answers to this question are eligible for a +50 reputation bounty. Al ...
I'm trying to bring together typing class attributes via generic types pointing at the current instance and inheritance. I ran into a problem that myp ...