[Python-modules-commits] [astroid] 01/04: Import astroid_1.4.4.orig.tar.gz

Sandro Tosi morph at moszumanska.debian.org
Thu Jan 28 19:38:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository astroid.

commit a06d33a8cf30f751f2ccac8e7bf36a9f3c734a32
Author: Sandro Tosi <morph at debian.org>
Date:   Thu Jan 28 19:32:26 2016 +0000

    Import astroid_1.4.4.orig.tar.gz
---
 ChangeLog                         | 19 +++++++++++++++++++
 PKG-INFO                          |  2 +-
 astroid.egg-info/PKG-INFO         |  2 +-
 astroid/__pkginfo__.py            |  2 +-
 astroid/brain/brain_stdlib.py     |  9 +++++++++
 astroid/node_classes.py           |  7 +++----
 astroid/objects.py                |  6 +++++-
 astroid/tests/unittest_lookup.py  |  7 ++++---
 astroid/tests/unittest_objects.py | 20 +++++++++++++++++++-
 astroid/tests/unittest_utils.py   | 10 +++++++++-
 setup.cfg                         |  4 ++--
 11 files changed, 73 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 197d6f3..759b6c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,25 @@
 Change log for the astroid package (used to be astng)
 =====================================================
 
+2016-01-15 -- 1.4.4
+
+    * unpack_infer raises InferenceError if it can't operate
+      with the given sequences of nodes.
+
+    * Support accessing properties with super().
+
+    * Enforce strong updates per frames.
+
+      When looking up a name in a scope, Scope.lookup will return
+      only the values which will be reachable after execution, as seen
+      in the following code:
+      
+           a = 1
+           a = 2
+
+      In this case it doesn't make sense to return two values, but
+      only the last one.
+
 2015-12-24 -- 1.4.3
 
     * pkg_resources brain tips are a bit more specific,
diff --git a/PKG-INFO b/PKG-INFO
index 7816049..7deb7e3 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: astroid
-Version: 1.4.3
+Version: 1.4.4
 Summary: A abstract syntax tree for Python with inference support.
 Home-page: http://bitbucket.org/logilab/astroid
 Author: Logilab
diff --git a/astroid.egg-info/PKG-INFO b/astroid.egg-info/PKG-INFO
index 7816049..7deb7e3 100644
--- a/astroid.egg-info/PKG-INFO
+++ b/astroid.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: astroid
-Version: 1.4.3
+Version: 1.4.4
 Summary: A abstract syntax tree for Python with inference support.
 Home-page: http://bitbucket.org/logilab/astroid
 Author: Logilab
diff --git a/astroid/__pkginfo__.py b/astroid/__pkginfo__.py
index d3ce966..87f5c6d 100644
--- a/astroid/__pkginfo__.py
+++ b/astroid/__pkginfo__.py
@@ -20,7 +20,7 @@ distname = 'astroid'
 
 modname = 'astroid'
 
-numversion = (1, 4, 3)
+numversion = (1, 4, 4)
 version = '.'.join([str(num) for num in numversion])
 
 install_requires = ['six', 'lazy_object_proxy', 'wrapt']
diff --git a/astroid/brain/brain_stdlib.py b/astroid/brain/brain_stdlib.py
index cbc9736..ac73188 100644
--- a/astroid/brain/brain_stdlib.py
+++ b/astroid/brain/brain_stdlib.py
@@ -156,6 +156,15 @@ class deque(object):
 
 def pkg_resources_transform():
     return AstroidBuilder(MANAGER).string_build('''
+def require(*requirements):
+    return pkg_resources.working_set.require(*requirements)
+
+def run_script(requires, script_name):
+    return pkg_resources.working_set.run_script(requires, script_name)
+
+def iter_entry_points(group, name=None):
+    return pkg_resources.working_set.iter_entry_points(group, name)
+
 def resource_exists(package_or_requirement, resource_name):
     return get_provider(package_or_requirement).has_resource(resource_name)
 
diff --git a/astroid/node_classes.py b/astroid/node_classes.py
index 5b231c8..ca773c3 100644
--- a/astroid/node_classes.py
+++ b/astroid/node_classes.py
@@ -35,6 +35,7 @@ from astroid import util
 BUILTINS = six.moves.builtins.__name__
 
 
+ at bases.raise_if_nothing_inferred
 def unpack_infer(stmt, context=None):
     """recursively generate nodes inferred by the given statement.
     If the inferred value is a list or a tuple, recurse on the elements
@@ -196,8 +197,7 @@ class LookupMixIn(object):
 
             if self.statement() is myframe and myframe.parent:
                 myframe = myframe.parent.frame()
-        if not myframe is frame or self is frame:
-            return stmts
+
         mystmt = self.statement()
         # line filtering if we are in the same frame
         #
@@ -217,9 +217,8 @@ class LookupMixIn(object):
             if mylineno > 0 and stmt.fromlineno > mylineno:
                 break
             assert hasattr(node, 'assign_type'), (node, node.scope(),
-                                                  node.scope()._locals)
+                                                  node.scope().locals)
             assign_type = node.assign_type()
-
             if node.has_base(self):
                 break
 
diff --git a/astroid/objects.py b/astroid/objects.py
index 8ff75a5..d2f4270 100644
--- a/astroid/objects.py
+++ b/astroid/objects.py
@@ -31,7 +31,7 @@ import six
 from astroid import MANAGER
 from astroid.bases import (
     BUILTINS, NodeNG, Instance, _infer_stmts,
-    BoundMethod,
+    BoundMethod, _is_property
 )
 from astroid.decorators import cachedproperty
 from astroid.exceptions import (
@@ -172,6 +172,10 @@ class Super(NodeNG):
                     yield infered
                 elif self._class_based or infered.type == 'staticmethod':
                     yield infered
+                elif _is_property(infered):
+                    # TODO: support other descriptors as well.
+                    for value in infered.infer_call_result(self, context):
+                        yield value
                 else:
                     yield BoundMethod(infered, cls)
 
diff --git a/astroid/tests/unittest_lookup.py b/astroid/tests/unittest_lookup.py
index 93bfd76..bd1786d 100644
--- a/astroid/tests/unittest_lookup.py
+++ b/astroid/tests/unittest_lookup.py
@@ -55,13 +55,14 @@ class LookupTest(resources.SysPathSetup, unittest.TestCase):
         a = next(astroid.nodes_of_class(nodes.Name))
         self.assertEqual(a.lineno, 2)
         if sys.version_info < (3, 0):
-            self.assertEqual(len(astroid.lookup('b')[1]), 2)
-            self.assertEqual(len(astroid.lookup('a')[1]), 3)
+            self.assertEqual(len(astroid.lookup('b')[1]), 1)
+            self.assertEqual(len(astroid.lookup('a')[1]), 1)
             b = astroid._locals['b'][1]
         else:
             self.assertEqual(len(astroid.lookup('b')[1]), 1)
-            self.assertEqual(len(astroid.lookup('a')[1]), 2)
+            self.assertEqual(len(astroid.lookup('a')[1]), 1)
             b = astroid._locals['b'][0]
+
         stmts = a.lookup('a')[1]
         self.assertEqual(len(stmts), 1)
         self.assertEqual(b.lineno, 6)
diff --git a/astroid/tests/unittest_objects.py b/astroid/tests/unittest_objects.py
index af17e56..da9f0c8 100644
--- a/astroid/tests/unittest_objects.py
+++ b/astroid/tests/unittest_objects.py
@@ -495,7 +495,7 @@ class SuperTests(unittest.TestCase):
             inferred.super_mro()
         with self.assertRaises(exceptions.SuperArgumentTypeError):
             inferred.super_mro()
-
+
     def test_super_pytype_display_type_name(self):
         node = test_utils.extract_node('''
         class A(object):
@@ -506,6 +506,24 @@ class SuperTests(unittest.TestCase):
         self.assertEqual(inferred.pytype(), "%s.super" % bases.BUILTINS)
         self.assertEqual(inferred.display_type(), 'Super of')
         self.assertEqual(inferred.name, 'A')
+
+    def test_super_properties(self):
+        node = test_utils.extract_node('''
+        class Foo(object):
+            @property
+            def dict(self):
+                return 42
+
+        class Bar(Foo):
+            @property
+            def dict(self):
+                return super(Bar, self).dict
+
+        Bar().dict
+        ''')
+        inferred = next(node.infer())
+        self.assertIsInstance(inferred, nodes.Const)
+        self.assertEqual(inferred.value, 42)
 
 
 if __name__ == '__main__':
diff --git a/astroid/tests/unittest_utils.py b/astroid/tests/unittest_utils.py
index 3858dce..ef83225 100644
--- a/astroid/tests/unittest_utils.py
+++ b/astroid/tests/unittest_utils.py
@@ -18,6 +18,7 @@
 import unittest
 
 from astroid import builder
+from astroid import InferenceError
 from astroid import nodes
 from astroid import node_classes
 from astroid import test_utils
@@ -110,7 +111,14 @@ class InferenceUtil(unittest.TestCase):
         self.assertTrue(all(elt is astroid_util.YES
                             for elt in unpacked))
 
+    def test_unpack_infer_empty_tuple(self):
+        node = test_utils.extract_node('''
+        ()
+        ''')
+        inferred = next(node.infer())
+        with self.assertRaises(InferenceError):
+            list(node_classes.unpack_infer(inferred))
+
 
 if __name__ == '__main__':
     unittest.main()
-
diff --git a/setup.cfg b/setup.cfg
index caf8563..3f8d96b 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,7 +2,7 @@
 universal = 1
 
 [egg_info]
-tag_date = 0
-tag_svn_revision = 0
 tag_build = 
+tag_svn_revision = 0
+tag_date = 0
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/astroid.git



More information about the Python-modules-commits mailing list