gh-119698: deprecate `symtable.Class.get_methods` (#121902)

This commit is contained in:
Bénédikt Tran 2024-07-22 16:04:17 +02:00 committed by GitHub
parent dc93d1125f
commit c09d4c4a26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 53 additions and 16 deletions

View file

@ -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 = {}