https://pantsbuild.org/ logo
#development
Title
# development
b

bitter-ability-32190

09/22/2022, 2:57 PM
Need some type hint help:
Copy code
_GoalSubsystemT = TypeVar("_GoalSubsystemT", bound=GoalSubsystem)

async def _get_subpartitions(
    subsystem: type[_GoalSubsystemT],
): ...

...
    _get_subpartitions(lint_subsystem)

# Note: `LintSubsystem` is `class LintSubsystem(GoalSubsystem):`
yields
Copy code
error: Argument 1 to "_get_subpartitions" has incompatible type "LintSubsystem"; expected "Type[<nothing>]"  [arg-type]
https://mypy.readthedocs.io/en/stable/kinds_of_types.html#the-type-of-class-objects makes me think what I'm doing is OK
1
a

ancient-vegetable-10556

09/22/2022, 3:03 PM
👀
b

bitter-ability-32190

09/22/2022, 3:04 PM
The
<nothing>
is what kills me 😐
a

ancient-vegetable-10556

09/22/2022, 3:04 PM
what’s the value of
lint_subsystem
?
I don’t see where it’s set
b

bitter-ability-32190

09/22/2022, 3:04 PM
`LintSubsystem`(...). It's a param of a rule
posting PR soon
a

ancient-vegetable-10556

09/22/2022, 3:05 PM
the mypy thing says that you have an instance of
LintSubsystem
, rather than the type object itself
b

bitter-ability-32190

09/22/2022, 3:06 PM
DOH
🙏 Thank you
a

ancient-vegetable-10556

09/22/2022, 3:07 PM
Not a problem. Please consider taking a break and getting one of your morning bootstrap beverages of choice, or some nice fresh air
b

bitter-ability-32190

09/22/2022, 3:17 PM
I was actually racing the clock because I got a Drs visit to be at 😅