Skip to content
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

Audit all compat interfaces for breaking changes in argument parsing #231

Closed
whitequark opened this issue Sep 23, 2019 · 3 comments
Closed

Comments

@whitequark
Copy link
Contributor

Changing arguments from positional to keyword-only is a breaking change in Python (which is why it is better to introduce any new argument as keyword-only, and relax later...) Because of the way nMigen reuses classes, there are probably some constructors that were broken when arguments changed type, moved, or were renamed. It is necessary to manually audit all such cases and add compat shims, either like it was done in 89c4b3d, or using a more elegant approach.

@whitequark whitequark added this to the 0.1 milestone Sep 23, 2019
@whitequark
Copy link
Contributor Author

It's not clear how to actually do this. Using a function to adjust argument syntax breaks isinstance; using inheritance for the same task makes transforms slower, and they're already slow. This doesn't seem to cause any issues acutely, so let's punt on it for now.

@whitequark whitequark removed this from the 0.1 milestone Nov 10, 2019
@whitequark
Copy link
Contributor Author

Because we already use inheritance for this in many cases in nmigen.compat, I think it's fine to continue doing that. Any alternatives are very laborous and don't seem to bring any actual benefit, given that it is easy to adjust either downstream code, or nmigen.compat code, should any incompatibility appear.

@whitequark
Copy link
Contributor Author

To be more precise, we use both inheritance and functions to adjust interfaces, and neither seem to cause any problems so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant