mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
gh-119698: deprecate `symtable.Class.get_methods
` (#121902)
This commit is contained in:
parent
dc93d1125f
commit
c09d4c4a26
5 changed files with 53 additions and 16 deletions
|
@ -237,6 +237,12 @@ class Class(SymbolTable):
|
|||
def get_methods(self):
|
||||
"""Return a tuple of methods declared in the class.
|
||||
"""
|
||||
import warnings
|
||||
typename = f'{self.__class__.__module__}.{self.__class__.__name__}'
|
||||
warnings.warn(f'{typename}.get_methods() is deprecated '
|
||||
f'and will be removed in Python 3.16.',
|
||||
DeprecationWarning, stacklevel=2)
|
||||
|
||||
if self.__methods is None:
|
||||
d = {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue