diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2014-05-07 17:14:48 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2014-05-07 17:14:48 +0300 |
commit | cd08d8724ec41f4630b143a62f0d4e5479ab0607 (patch) | |
tree | 436e1040e9de8e5f9f4dc58aa72dce1811deac9a /rebuilder.py | |
parent | b13ef13e8365348b957e77105fdeeeb5bde69c49 (diff) | |
download | astroid-git-cd08d8724ec41f4630b143a62f0d4e5479ab0607.tar.gz |
Function nodes can detect if they are decorated with subclasses of builtin descriptors when determining their type (`classmethod` and `staticmethod`).
--HG--
branch : classmethod_subclasses
Diffstat (limited to 'rebuilder.py')
-rw-r--r-- | rebuilder.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rebuilder.py b/rebuilder.py index ef8e7635..40a614f8 100644 --- a/rebuilder.py +++ b/rebuilder.py @@ -516,16 +516,16 @@ class TreeRebuilder(object): frame = newnode.parent.frame() if isinstance(frame, new.Class): if newnode.name == '__new__': - newnode.type = 'classmethod' + newnode._type = 'classmethod' else: - newnode.type = 'method' + newnode._type = 'method' if newnode.decorators is not None: for decorator_expr in newnode.decorators.nodes: if isinstance(decorator_expr, new.Name): if decorator_expr.name in ('classmethod', 'staticmethod'): - newnode.type = decorator_expr.name + newnode._type = decorator_expr.name elif decorator_expr.name == 'classproperty': - newnode.type = 'classmethod' + newnode._type = 'classmethod' frame.set_local(newnode.name, newnode) return newnode |