Repository: sympy/sympy

Issue:
Missing deprecated stubs for ordered and default_sort_key
There was a rush to get #22357 in at the time because of merge conflicts but it looks like the TODOs where not all done. In particular the deprecated stubs are missing for e.g.:
```
from sympy.utilities.iterables import ordered
```
This needs to be fixed before 1.10 release.

CC @oscargus

Discussion:

Patch:
diff --git a/sympy/utilities/iterables.py b/sympy/utilities/iterables.py
index cfb156b7c9..1e32925790 100644
--- a/sympy/utilities/iterables.py
+++ b/sympy/utilities/iterables.py
@@ -2993,15 +2993,29 @@ def is_sequence(i, include=None):
             isinstance(i, include))
 
 
-@deprecated(useinstead="sympy.core.traversal.postorder_traversal",
+@deprecated(useinstead="from sympy import postorder_traversal",
     deprecated_since_version="1.10", issue=22288)
 def postorder_traversal(node, keys=None):
     from sympy.core.traversal import postorder_traversal as _postorder_traversal
     return _postorder_traversal(node, keys=keys)
 
 
-@deprecated(useinstead="sympy.interactive.traversal.interactive_traversal",
+@deprecated(useinstead="from sympy import interactive_traversal",
             issue=22288, deprecated_since_version="1.10")
 def interactive_traversal(expr):
     from sympy.interactive.traversal import interactive_traversal as _interactive_traversal
     return _interactive_traversal(expr)
+
+
+@deprecated(useinstead="from sympy import default_sort_key",
+            deprecated_since_version="1.10", issue=22352)
+def default_sort_key(*args, **kwargs):
+    from sympy import default_sort_key as _default_sort_key
+    return _default_sort_key(*args, **kwargs)
+
+
+@deprecated(useinstead="from sympy import ordered",
+            deprecated_since_version="1.10", issue=22352)
+def ordered(*args, **kwargs):
+    from sympy import ordered as _ordered
+    return _ordered(*args, **kwargs)


Test patch:
diff --git a/sympy/utilities/tests/test_iterables.py b/sympy/utilities/tests/test_iterables.py
index 0c391d507c..77c6e7b1ee 100644
--- a/sympy/utilities/tests/test_iterables.py
+++ b/sympy/utilities/tests/test_iterables.py
@@ -24,11 +24,19 @@
     factoring_visitor, multiset_partitions_taocp )
 
 from sympy.core.singleton import S
-from sympy.testing.pytest import raises
+from sympy.testing.pytest import raises, warns_deprecated_sympy
 
 w, x, y, z = symbols('w,x,y,z')
 
 
+def test_deprecated_iterables():
+    from sympy.utilities.iterables import default_sort_key, ordered
+    with warns_deprecated_sympy():
+        assert list(ordered([y, x])) == [x, y]
+    with warns_deprecated_sympy():
+        assert sorted([y, x], key=default_sort_key) == [x, y]
+
+
 def test_is_palindromic():
     assert is_palindromic('')
     assert is_palindromic('x')