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 of colon ':' in type hints
When type annotating a variable of type dict, typically you'd annotate it like this:
numeralToInteger: dict[str, int] = {...}
However I rewrote this using a colon instead of a comma:
numeralToInteger...
Magmurrr
Votes: 0
Answers: 2
Python 3 type Dict with required and arbitrary keys
I'm trying to type a function that returns a dictionary with one required key, and some additional ones.
I've run into TypedDict, but it is too strict for my purpose. At the same time Dict is too leni...
balbok
Votes: 0
Answers: 0
How to specify types for itertools groupby?
I've a list of string to be operated upon. And the return type is something like group type consisting of int as a key and a list of string as value.
What i've tried?
from typing import List, Dict, It...
Surya Bhusal
Votes: 0
Answers: 1
Pyright type error with Flask error handler
I'm working my way towards strict type checking using Pyright, and I'm running into an issue with a Flask error handler. I'm not yet familiar enough with type hints to know if this is an error in my c...
Freddy The Horse
Votes: 0
Answers: 0