]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40208: Remove deprecated has_exec method of SymbolTable (GH-19396)
authorBatuhan Taşkaya <batuhanosmantaskaya@gmail.com>
Mon, 13 Apr 2020 23:51:32 +0000 (02:51 +0300)
committerGitHub <noreply@github.com>
Mon, 13 Apr 2020 23:51:32 +0000 (08:51 +0900)
Doc/library/symtable.rst
Doc/whatsnew/3.9.rst
Lib/symtable.py
Lib/test/test_symtable.py
Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst [new file with mode: 0644]

index 7c6ac4dccf8b76d4ddb8a9f01d5dbac9aa8b4515..3efdecb5af7102f19bff70c342c38c6b9c0f9b3e 100644 (file)
@@ -67,10 +67,6 @@ Examining Symbol Tables
       Return ``True`` if the block has nested namespaces within it.  These can
       be obtained with :meth:`get_children`.
 
-   .. method:: has_exec()
-
-      Return ``True`` if the block uses ``exec``.
-
    .. method:: get_identifiers()
 
       Return a list of names of symbols in this table.
index 1bbcae36a1a10e38d323746b09e77059bd726cb7..afb099a4ec558380bd127d24ddfc2da9e09cce12 100644 (file)
@@ -753,6 +753,10 @@ Removed
   the ``__annotations__`` attribute instead.
   (Contributed by Serhiy Storchaka in :issue:`40182`.)
 
+* The :meth:`symtable.SymbolTable.has_exec` method has been removed. It was
+  deprecated since 2006, and only returning ``False`` when it's called.
+  (Contributed by Batuhan Taskaya in :issue:`40208`)
+
 
 Porting to Python 3.9
 =====================
index ac0a64ff58f795ad1a50aa750f2703136e01bf64..a711676582f649f52d370367a1978742d94b7d1a 100644 (file)
@@ -82,10 +82,6 @@ class SymbolTable(object):
     def has_children(self):
         return bool(self._table.children)
 
-    def has_exec(self):
-        """Return true if the scope uses exec.  Deprecated method."""
-        return False
-
     def get_identifiers(self):
         return self._table.symbols.keys()
 
index 98d718c8ab1b1efe9471639a432b7c55ca6ec8c6..d19355888e4b347140ea30158377ed5258f7647c 100644 (file)
@@ -65,7 +65,6 @@ class SymtableTest(unittest.TestCase):
 
     def test_optimized(self):
         self.assertFalse(self.top.is_optimized())
-        self.assertFalse(self.top.has_exec())
 
         self.assertTrue(self.spam.is_optimized())
 
diff --git a/Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst b/Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst
new file mode 100644 (file)
index 0000000..a06d5ea
--- /dev/null
@@ -0,0 +1 @@
+Remove deprecated :meth:`symtable.SymbolTable.has_exec`.