I am using Python's support for nested classes to group and organise class definitions. Some of these inner classes are pure data classes and I am benefitting from the boilerplate reduction of @dataclass ( __init__
, __repr__
etc).
Unfortunately, when I try to create an instance of the inner class, PyCharm can't seem to get the arguments' type hinting correct and puts a wigglie (wiggly line indicating, usually, poor code) under the first argument. Note that:
@dataclass
on a module level class produces no such issue.@dataclass
and manually inserting the boilerplate for __init__
It is a bug, please vote for https://youtrack.jetbrains.com/issue/PY-35698 (thumbs up near the title)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.