Repository navigation
gh-159240: Deprecate __{author,credits,copyright}__ attributes in stdlib modules - #159241
Conversation
…in stdlib modules
Documentation build overview
175 files changed ·
|
|
Please remove me from those attributions that include me. I'm "original author" of half the stdlib, after all, and I don't need to see my name repeated. |
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| """ | ||
| # Copyright (c) 2001-2006 Gregory P. Ward. All rights reserved. | ||
| # Copyright (c) 2002 Python Software Foundation. All rights reserved. |
There was a problem hiding this comment.
I don't think we need to retain the licensing though as it's the PSF one (?) otherwise this may conflict with the one that we currently use.
There was a problem hiding this comment.
I thought about this, but I wasn't sure, and I'm no lawyer. @gward would this be alright?
There was a problem hiding this comment.
Other stdlib modules don't have explicit license text. IANAL, but it does seem either redundant or contradictory to include it. Who would be the PSF licensing person to double-check with?
|
Hi Stan, I will have a closer look later today. Just wanted to mention that removing authorship and copyright notices will most likely not work without the author's consent. Thanks.
--
Marc-Andre Lemburg
https://malemburg.com/
…On 12 October 2026 22:34:46 EEST, Stan Ulbrych ***@***.***> wrote:
@StanFromIreland requested your review on: python/cpython#159241 gh-159240: Deprecate `__{author,credits,copyright}__` attributes in stdlib modules.
--
Reply to this email directly or view it on GitHub:
#159241 (comment)
You are receiving this because your review was requested.
Message ID: ***@***.***>
|
malemburg
left a comment
There was a problem hiding this comment.
Ok, so it looks like you are only removing the attributes from the code and moving the notices to comments. This should be fine. There's one catch, though, you should be aware of: if you put the notices into an attribute, they will be available in the PYCs and the live code when used at runtime as well. Having the notices in comments does not have the same effect.
Personally, I'm fine with not having the notices for e.g. platform.py in attributes anymore, but others may feel differently about this.
|
Thank you for the review.
Since we're keeping the information, I think we should generally be alright here?
Yes, but I don't think anyone needs programmatic access to this information, which is often misleading or outdated. At least, no one has expressed such a need in the discussion. |
nedbat
left a comment
There was a problem hiding this comment.
Ideally we'd resolve the question about the license, but that could also be a follow-on PR.
|
Regarding licenses in the code base: Usually, only the copyright holders can give permission to remove those licenses or copyright notices (most licenses require to include the text in all copies). Also note that unless an author has assigned copyright to the PSF, the PSF only gets redistribution rights via the CLA. The author retains the copyright. |
|
If there are no objections, I'll merge this Friday week. |
hugovk
left a comment
There was a problem hiding this comment.
Refactor suggestion: we have a lot of repeated boilerplate, like:
class TestModule(unittest.TestCase):
def test_deprecated__version__(self):
with self.assertWarnsRegex(
DeprecationWarning,
"'__version__' is deprecated and slated for removal in Python 3.20",
) as cm:
getattr(ttk, "__version__")
self.assertEqual(cm.filename, __file__)
def test_deprecated__author__(self):
with self.assertWarnsRegex(
DeprecationWarning,
"'__author__' is deprecated and slated for removal in Python 3.20",
) as cm:
getattr(ttk, "__author__")
self.assertEqual(cm.filename, __file__)These two functions target the same removal version and could be merged into a single test_deprecated_dunder_attributes function.
But between this PR and the existing __version__ deprecations, that still means lots of boilerplate across test files.
Let's create a single test helper that takes one or more attribute names and their removal version.
vstinner
left a comment
There was a problem hiding this comment.
LGTM. I'm fine with remove these attributes, and it's good that authors are kept in comments.
| __author__ = "Lars Gust\u00e4bel ([email protected])" | ||
| __credits__ = "Gustavo Niemeyer, Niels Gust\u00e4bel, Richard Townsend." | ||
| # Original author: Lars Gustäbel ([email protected]) | ||
| # Credits: Gustavo Niemeyer, Niels Gustäbel, Richard Townsend. |
hugovk
left a comment
There was a problem hiding this comment.
Thanks!
If there are no objections, I'll merge this Friday week.
I'm not sure if you meant today, Friday 23rd, or next Friday 30th. In my English, "this Friday week" means "a week on Friday", that is, the Friday after the upcoming Friday, so would be the 30th.
(Whereas "Friday this week" means today the 23rd!)
Anyway, either is fine by me :)
(This PR has merge conflicts.)
Sorry for the Irish-English! ;-) I meant Friday the 30th.
I presume a few more will pop up till next week, so I'll get them all then. Thanks for the review! |
|
Thanks for all the reviews! |
__author__,__credits__and__copyright__attributes in stdlib modules #159240