On Thu, Jul 29, 2021 at 10:00 AM <pa...@lexyr.com> wrote:
>
> I'm with you on the backwards-compatibility front. Changing Python fast and 
> for no particular reason incurs a big cost. Is the reason good enough to 
> justify removing a chunk of the interface? Good question.
>

Answer: Almost never. Case in point:

Python 3.10.0b2+ (heads/3.10:33a7a24288, Jun  9 2021, 20:47:39) [GCC
8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import threading
>>> threading.currentThread().getName()
<stdin>:1: DeprecationWarning: currentThread() is deprecated, use
current_thread() instead
<stdin>:1: DeprecationWarning: getName() is deprecated, get the name
attribute instead
'MainThread'

The threading module *STILL* has these methods, despite them having
been deprecated since Python 2.6. The benefit of removing them is
almost zero, and the cost of removing them is breakage. So they are
still there.

(In this case, since there's a perfect equivalence -
threading.current_thread() and Thread.name - the deprecated ones are
no longer listed in the docs, but the code still works.)

The bar for removing functionality and breaking code is high.

>
> To your dict argument: if there was a native Pythonic way to make a frozen 
> list, what would a tuple's purpose be then, if not just another name for 
> that? That also seems like an appropriate analogy.
>

The question would first be: what is a frozen list's purpose that a
tuple is not doing? Once you answer that, you can then answer the
question of whether a tuple is still necessary. In the case of
namedtuple and dataclass, this has already been answered.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/ITYVZAZTRT3WR54QAD26MYE76FZU5IEO/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to