Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created October 31, 2026 17:55
Show Gist options
  • Select an option

  • Save mypy-play/2a9f47bdc25dabe6c7445ce1fc314d1d to your computer and use it in GitHub Desktop.

Select an option

Save mypy-play/2a9f47bdc25dabe6c7445ce1fc314d1d to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from typing import Any
class Person():
def __init__(self, name: str, age: int, characteristics: type):
self.name = name
self.age = age
self.characteristics = characteristics
def foo(person: Person) -> None:
reveal_type(person.characteristics) # N: Revealed type is "builtins.type"
class Sub(person.characteristics): pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment