Skip to content

Conversation

@steven-johnson
Copy link
Contributor

Changes Python Generators to require explicit inheritance from hl.Generator (rather than forbidding it).

Not particularly happy about this change, but it seems to be the short path to getting code that is compliant with pytype.

Hopefully we'll find a better workaround and can soften this requirement.

@alexreinking alexreinking changed the title Require explicit inheritance fro python Generators Require explicit inheritance for python Generators Sep 15, 2022
@alexreinking
Copy link
Member

I am accepting this PR because it's externally important that these features land soon. However, I am alarmed by a few things:

  1. No Python type-checking tools are standard and type-checking is still far from the norm for Python.
  2. There was no discussion early on that passing pytype was a requirement. If it had been known, we would have had a chance to find a solution that appeases pytype while maintaining good UX.
  3. There is still no GHA workflow or buildbot step that runs pytype. Playing telephone with other companies' CI systems is unsustainable.
  4. This patch makes the UX worse.
  5. This patch doesn't fix a real type error.

@steven-johnson steven-johnson changed the title Require explicit inheritance for python Generators Allow explicit inheritance for python Generators Sep 16, 2022
@steven-johnson steven-johnson merged commit f3608db into srj/pygen-three Sep 16, 2022
@steven-johnson steven-johnson deleted the srj/pygen-expl branch September 16, 2022 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants