-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Replace validating property boilerplate w/ custom descriptors. #1075
Replace validating property boilerplate w/ custom descriptors. #1075
Conversation
Addresses point #3 of: #1072 (comment)
@dhermes PTAL: I think you'll like the linecount reduction. |
return self | ||
return getattr(instance._configuration, self._backing_name) | ||
|
||
def _validate(self, value): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
General comment: this is awesome. Let's also file a bug to do this for other discovery-based APIs and then put these classes in core? |
|
||
:raises: ValueError for invalid value types. | ||
""" | ||
if not isinstance(value, bool): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
LGTM. Do or don't update the error message for multiple types (e.g. |
Replace validating property boilerplate w/ custom descriptors.
…oogleCloudPlatform/python-docs-samples#1075) In particular, this change: - changes to use a consistent "_id" suffix for resource name components - uses "data" instead of "text", since encryption is not restricted to text - substitutes "ciphertext" for "encrypted {text, data}" - spells "crypto key" and "key ring" each as two separate words, as in the API Tracking bug: http://b/64758639
Addresses point
#3
of:#1072 (comment)