agronholm / agronholm/typeguard

Add support for generic classes

Aberta
#21 7 comentários 5 reações 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
Python
Estrelas
1.8k
Forks
146
Merge médio
8d 12h
PRs com merge (30d)
1

Descrição

It would be great to be able to do runtime type checking of generic classes, e.g.:

```python
from typing import Generic, TypeVar
T = TypeVar('T')

class A(Generic[T]):
@typechecked
def __init__(self, obj: T):
self.obj = obj

class IntA(A[int]):
pass

a = IntA(7) # good!
a = IntA('foo') # bad!
```

I sketched out something like this already: https://gist.github.com/chadrik/54d7b3d051839f90983676a47368526b

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.