Created
December 7, 2025 13:15
-
-
Save mypy-play/d0d5de9a216936fd220dd091ee7a7e3e to your computer and use it in GitHub Desktop.
Shared via mypy Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Welcome to the Pyrefly Sandbox, this is a page | |
| # where you can write, share and learn about typing in Python. | |
| # | |
| # Here are a couple features of this sandbox: | |
| # - Get real-time type checking feedback | |
| # - Use reveal_type() to inspect inferred types | |
| # - experiment with the IDE features that we support (e.g. autocomplete, go-to-definition, hover, etc) | |
| # - Write and run Python code directly in your browser | |
| from typing import * | |
| from dataclasses import dataclass, replace | |
| @dataclass | |
| class Foo: | |
| x: int | |
| y: str | |
| f = Foo(1, "a") | |
| replace(f, x="wrong") # expect type error | |
| replace(f, z=3) # expect type error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment