diff options
author | Ćukasz Rogalski <rogalski.91@gmail.com> | 2017-01-30 22:01:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-30 22:01:57 +0100 |
commit | ac425e60a2c243eaf0b41ba1eb33b84a49d11eb7 (patch) | |
tree | 5dca9c5c887130845e624f52ba0fa752571c9410 /astroid/tree/scoped_nodes.py | |
parent | 61f49f4dee7cda2976866ea1441973c4ab55dda6 (diff) | |
download | astroid-git-2.0.tar.gz |
Mark __init_subclass__ as classmethod (#388)2.0.experimental2.0
Diffstat (limited to 'astroid/tree/scoped_nodes.py')
-rw-r--r-- | astroid/tree/scoped_nodes.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/astroid/tree/scoped_nodes.py b/astroid/tree/scoped_nodes.py index 7e44b27a..626c10e8 100644 --- a/astroid/tree/scoped_nodes.py +++ b/astroid/tree/scoped_nodes.py @@ -13,6 +13,7 @@ new local scope in the language definition : Module, ClassDef, FunctionDef (and Lambda, GeneratorExp, DictComp and SetComp to some extent). """ +import sys import collections import io import itertools @@ -915,6 +916,8 @@ class FunctionDef(LambdaFunctionMixin, lookup.LocalsDictNode, if isinstance(frame, ClassDef): if self.name == '__new__': return 'classmethod' + elif sys.version_info >= (3, 6) and self.name == '__init_subclass__': + return 'classmethod' else: type_name = 'method' |