strip-hints
strip-hints copied to clipboard
Ignore dataclasses
Running strip-hints on a dataclass makes it invalid. strip-hints should warn about this and not strip type hints from it.
any update or workaround on this?
Many people seem to be using this tool. I'm curious what the use-case is when you want dataclasses but also want to strip the rest of the hints.
I'm testing a workaround where commented lines like # strip-hints: off and # strip-hints: on would toggle stripping.
I just pushed out version 0.1.13. Any comment line that starts with # strip-hints: off will turn off stripping until another comment line that starts with # strip-hints: on. These examples toggle stripping for the dataclass:
@dataclass
class Point:
# strip-hints: off
x: int
y: int
# strip-hints: on
# strip-hints: off
@dataclass
class Point:
x: int
y: int
# strip-hints: on