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

Abc simple #43

Merged
merged 4 commits into from
Jun 5, 2019
Merged

Abc simple #43

merged 4 commits into from
Jun 5, 2019

Conversation

cdonovick
Copy link
Collaborator

@cdonovick cdonovick commented May 28, 2019

When building the FP library I ran into some annoyances in how I was binding types with getitem. I had been using lookup tables in the metaclass to store information however, this meant the info was not available until after class construction was complete. To avoid this I reserved the name _info_ and inserted the required information into the the namespace.

This pull requests does something similar for the other metaclasses. This in many ways simplifies the metaclasses / classes as there are no more crazy redirects through weakref dictionaries. Instead information is stored in _info_ for types constructed by AbstractBitVectorMeta and _fields_ / _field_table_ for those constructed by BoundMeta.

This should have no effect on user code unless it was using one of the reserved names.

Both peak and lassen pass travis with this branch:
https://travis-ci.org/phanrahan/peak/builds/538426697
https://travis-ci.com/StanfordAHA/lassen/builds/113493648

@cdonovick cdonovick requested a review from leonardt May 28, 2019 20:37
Copy link
Owner

@leonardt leonardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I didn't follow the changes in full detail, but at a high level it makes sense and the tests pass. It seems like it simplifies the overall logic by removing indirection so it should make maintenance easier.

hwtypes/util.py Outdated Show resolved Hide resolved
@cdonovick cdonovick merged commit 4ccd27e into master Jun 5, 2019
@cdonovick cdonovick deleted the abc-simple branch June 5, 2019 21:26
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