Title: Misleading __version__ attribute of modules in standard library
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: abukaj, barry, cryvate, eric.araujo, ncoghlan, petr.viktorin, pitrou, rhettinger, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-10-20 13:21 by abukaj, last changed 2020-02-04 10:54 by cryvate.

Pull Requests
URL Status Linked Edit
PR 17977 merged cjw296, 2020-02-04 09:27
Messages (7)
msg304654 - (view) Author: Jakub Mateusz Dzik (abukaj) Date: 2017-10-20 13:21
Several modules of the standard library (at least `re` and `csv`) have `__version__` strings.

The string is the same for Python 2.7-3.6:

    >>> import re, csv; print(re.__version__, csv.__version__)
    2.2.1 1.0

while documentation indicates changes in the modules.

Semantic versioning (recommended by PEP 440) suggests that at least minor version should change in such case.

I suspect it to be a "code fossil" which may be removed according to PEP 396.
msg304763 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-10-22 21:26
I would support just removing the version attributes for csv and re.
msg304765 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-10-22 21:27
+1 for removing __version__ on all stdlib modules which are not externally maintained.
msg304779 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-10-23 03:56
+1 from me for dropping these, and noting which modules were affected in the Porting section of the 3.7 What's New (I'd be surprised if anyone was depending on them existing, but it doesn't hurt to mention it, and may help if someone is trying to figure out what changed)
msg304780 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-10-23 06:15
Please do leave version in the decimal module where it has a precise meaning, tracking a particular version of the spec that was implemented and tested.
msg304823 - (view) Author: √Čric Araujo (eric.araujo) * (Python committer) Date: 2017-10-23 17:04
The version in distutils is derived from sys.version and should be left as is too.  Thanks!
msg361340 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2020-02-04 09:27
PR for removing __version__ from mock:
Date User Action Args
2020-02-04 10:54:36cryvatesetnosy: + cryvate
2020-02-04 09:32:47petr.viktorinsetstage: patch review -> needs patch
2020-02-04 09:27:22cjw296setkeywords: + patch
stage: patch review
pull_requests: + pull_request17717
2020-02-04 09:27:07petr.viktorinsetnosy: + petr.viktorin
messages: + msg361340
2017-10-23 17:04:40eric.araujosetnosy: + eric.araujo
messages: + msg304823
2017-10-23 06:15:42rhettingersetmessages: + msg304780
2017-10-23 03:56:14ncoghlansetmessages: + msg304779
2017-10-22 21:27:44pitrousetnosy: + pitrou

messages: + msg304765
versions: - Python 2.7, Python 3.6
2017-10-22 21:26:10rhettingersetnosy: + rhettinger, ncoghlan
messages: + msg304763
2017-10-20 19:04:30terry.reedysetnosy: + barry, serhiy.storchaka

versions: + Python 3.7, - Python 3.4, Python 3.5
2017-10-20 13:21:04abukajcreate