Skip to content

Allow explicit inheritance for python Generators #7021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 16, 2022

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.

2 participants