python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Use a generic parameter as a Literal
I'm trying to play around with creating an api and I have different functions that handle requests to the api.
Some of the methods return a 204 rersponse and I want to typehint the return type of the ...
404kuso
Votes: 0
Answers: 1
Determining if object is of typing.Literal type
I need to check if object is descendant of typing.Literal, I have annotation like this:
GameState: Literal['start', 'stop']
And I need to check GameState annotation type:
def parse_values(ann)
if ...
Moder New
Votes: 0
Answers: 3
Python typing: Avoid `cast TypedDict` when filtering dict
I have a TypedDict definition and want the typechecker to recognize that a certain dictionary, dynamically created by filtering another dictionary, is complying with the type definition:
from typing i...

Jonathan Scholbach
Votes: 0
Answers: 1