diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2014-07-03 18:58:22 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2014-07-03 18:58:22 +0300 |
commit | 99974751cd6c7fbb54b8b607f7960bfc188e677e (patch) | |
tree | a76e3e6456822d0e31974bc8b668b221cc289048 /scoped_nodes.py | |
parent | 05df58447680a54ca4f6444edae06783efe312ea (diff) | |
download | astroid-git-99974751cd6c7fbb54b8b607f7960bfc188e677e.tar.gz |
Make islots private.
--HG--
branch : slots
Diffstat (limited to 'scoped_nodes.py')
-rw-r--r-- | scoped_nodes.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scoped_nodes.py b/scoped_nodes.py index 88b86422..95d45a5d 100644 --- a/scoped_nodes.py +++ b/scoped_nodes.py @@ -1136,8 +1136,10 @@ class Class(Statement, LocalsDictNodeNG, FilterStmtsMixin): break return klass - def islots(self): + def _islots(self): """ Return an iterator with the inferred slots. """ + if '__slots__' not in self.locals: + return for slots in self.igetattr('__slots__'): # check if __slots__ is a valid type for meth in ITER_METHODS: @@ -1184,4 +1186,4 @@ class Class(Statement, LocalsDictNodeNG, FilterStmtsMixin): @cached def slots(self): """ Return all the slots for this node. """ - return list(self.islots()) + return list(self._islots()) |