Add properties for defining aliases and type enforcement.
Review Request #10495 — Created April 2, 2019 and submitted
This introduces a couple of specialized properties that help with
deprecating older APIs and enforcing type safety with minimal effort.
AliasPropertyforwards on any property access (sets and gets) to
another attribute, optionally converting the new or existing value, and
optionally emitting a deprecation warning.
TypedPropertytakes one or more value types that are allowed to be
set, and checks any new values against those types, optionally allowing
These make use of a new function,
can locate the attribute of a descriptor/property in a class and return
the attribute name. It's used by these properties for error reporting
and for setting an attribute on a class instance based on the property's
Unit tests passed.
Made use of these in some upcoming changes.
E501 line too long (80 > 79 characters)
Fixed a line length issue.
Revision 2 (+886)
Checks run (2 succeeded)