add static facility and apply to register (#49737)

* add static facility and apply to register

* added warning

* added test for templated register

* test register 'static' status

* rely on subshell to deal with quote context

* use corrects pb for test

* bring constants back cause new code in devel
This commit is contained in:
Brian Coca 2019-01-24 11:51:52 -05:00 committed by GitHub
parent ffac260c66
commit be776daefe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 1 deletions

View file

@ -41,6 +41,7 @@ class Attribute:
alias=None,
extend=False,
prepend=False,
static=False,
):
"""
@ -86,6 +87,7 @@ class Attribute:
self.alias = alias
self.extend = extend
self.prepend = prepend
self.static = static
if default is not None and self.isa in _CONTAINERS and not callable(default):
raise TypeError('defaults for FieldAttribute may not be mutable, please provide a callable instead')