Skip to content

Fix _CountingAttr hack with attrs master #47

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 2 commits into from
Aug 30, 2018
Merged

Fix _CountingAttr hack with attrs master #47

merged 2 commits into from
Aug 30, 2018

Conversation

benbovy
Copy link
Member

@benbovy benbovy commented Aug 30, 2018

A workaround before (hopefully) a cleaner solution (see python-attrs/attrs#340).

Re-use argument list from attr.attrib for _CountingAttr.__init__(). It should at least reduce the risk of breaking the code when new arguments are introduced.

@benbovy
Copy link
Member Author

benbovy commented Aug 30, 2018

Monkey patching _CountingAttr is probably better, after all (but still a hack). It adds the compute decorator for all attr.ib and not just for on_demand variables, but we could just ignore it when we don't need it.

@benbovy benbovy merged commit b3e3bec into master Aug 30, 2018
@benbovy benbovy deleted the fix-attr-hack branch September 23, 2019 14:24
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.

1 participant