Skip to content

Commit

Permalink
bpo-40208: Remove deprecated has_exec method of SymbolTable (pythonGH…
Browse files Browse the repository at this point in the history
  • Loading branch information
isidentical authored Apr 13, 2020
1 parent a1a0eb4 commit 990ea42
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
4 changes: 0 additions & 4 deletions Doc/library/symtable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions Doc/whatsnew/3.9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=====================
Expand Down
4 changes: 0 additions & 4 deletions Lib/symtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ def is_nested(self):
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()

Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_symtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def test_type(self):

def test_optimized(self):
self.assertFalse(self.top.is_optimized())
self.assertFalse(self.top.has_exec())

self.assertTrue(self.spam.is_optimized())

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove deprecated :meth:`symtable.SymbolTable.has_exec`.

0 comments on commit 990ea42

Please sign in to comment.