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

Make abstract classproperty error message nicer #7429

Conversation

Projects
None yet
2 participants
@cosmicexplorer
Copy link
Contributor

commented Mar 25, 2019

Problem

def classproperty(func):
"""Use as a decorator on a method definition to make it a class-level attribute.

You can use @classproperty with @abstractproperty, but the error message is 'abstractproperty' object is not callable, which is pretty opaque.

Solution

  • Check for the case where the underlying object is an abstractproperty, and provide a nice error message.

cosmicexplorer added some commits Mar 25, 2019

@cosmicexplorer cosmicexplorer requested review from stuhood and jsirois Mar 25, 2019

@cosmicexplorer cosmicexplorer merged commit 7c263d9 into pantsbuild:master Mar 28, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.