Skip to content

Commit 707b638

Browse files
embraynstarman
authored andcommitted
[astropy#11094] Mark OrderedDescriptor and OrderedDescriptorContainer as
deprecated
1 parent 3b89381 commit 707b638

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎astropy/utils/misc.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,17 @@ def did_you_mean(s, candidates, n=3, cutoff=0.8, fix=None):
494494
return ''
495495

496496

497+
_ordered_descriptor_deprecation_message = """\
498+
The {func} {obj_type} is deprecated and may be removed in a future version.
499+
500+
You can replace its functionality with a combination of the
501+
__init_subclass__ and __set_name__ magic methods introduced in Python 3.6.
502+
See https://github.com/astropy/astropy/issues/11094 for recipes on how to
503+
replicate their functionality.
504+
"""
505+
506+
507+
@deprecated('4.3', _ordered_descriptor_deprecation_message)
497508
class OrderedDescriptor(metaclass=abc.ABCMeta):
498509
"""
499510
Base class for descriptors whose order in the class body should be
@@ -578,6 +589,7 @@ def __lt__(self, other):
578589
return NotImplemented
579590

580591

592+
@deprecated('4.3', _ordered_descriptor_deprecation_message)
581593
class OrderedDescriptorContainer(type):
582594
"""
583595
Classes should use this metaclass if they wish to use `OrderedDescriptor`

0 commit comments

Comments
 (0)