mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
20 lines
355 B
Python
20 lines
355 B
Python
from __future__ import print_function
|
|
import warnings
|
|
|
|
|
|
class ClassWithDeprecatedProperty:
|
|
@property
|
|
def x(self):
|
|
warnings.warn("This property is deprecated!")
|
|
return 42
|
|
|
|
|
|
obj = ClassWithDeprecatedProperty()
|
|
|
|
warnings.warn("This warning should appear in the output.")
|
|
|
|
del globals()['__warningregistry__']
|
|
|
|
print(obj.x)
|
|
print(obj)
|