What license do I have to use if I wanted to publish and maintain a deprecated stdlib module

From what I can gather, stdlib modules are under PSF License. Am I just supposed to copy it? If not, what license am I supposed to use if I’m planning to:

  1. Publish it to pypi
  2. maintain it with my own changes

As I understand, the license doesn’t say anything like “if you publish a derived work you must use the same license/a compatible license”, that means you can choose whichever license you want, or even make it closed source.

provided, however, that PSF’s License Agreement and PSF’s notice of copyright, i.e., “Copyright © 2001-2023 Python Software Foundation; All Rights Reserved” are retained

You must retain the copyright notice and include a copy of the PSF license somewhere in the repo. But it doesn’t mean you distribute the code under that license, it’s just to acknowledge where you originally get the code from.


How would I go about doing this? Include a LICENSE-PSF in root of my repo along with my own LICENSE? Can I just include the PSF license and call it a day or do I have to include a seperate one of my own?

And this is where there’d normally want to be one of those “I am not a lawyer, this is not legal advice” reminders. (Unless you ARE a lawyer?) You may find these pages of value:

And if you need to get in touch with the PSF about legal matters, they have a contact address for that.

One thing you’ll want to be aware of is that the PSF does own the rights to the name Python. It may well be that you’re allowed to distribute a modified version, but only if you also rename it. (Again, not legal advice, but this should at least fit with common sense - people need to be able to know whether they’re getting the official Python standard library or something else.)

I’m assuming here that you’re making (or planning to make) substantive changes. That means that what you’re publishing isn’t just the PSF’s original, Your changes are protected by copyright, and as long as you’re complying with the license terms for what you started with, you have every right to choose license terms for your own contributions. That would be a good reason to include both licenses, either as two separate files, or as one file with two sections in it.

Ultimately, if you’re making real, useful contributions by maintaining something outside of the stdlib, you deserve the credit for doing that! :slight_smile:


Thanks Chris, I don’t really care about copyright since I’ll just put it under a Foss license anyway. I just don’t want trouble by unknowingly not complying with an existing license or disrespecting the original authors.

The path of least resistance would just be keeping the PSF license as both the original and current license (if that’s allowed? I’m not a PSF member after all). Otherwise if I had to include two, what’s would be the “proper” way to handle it? What should I call the license files and how should they go in the pyproject.toml for example

I’m wholly ignorant on the legalities of things, so apologies for being a bit slow to understand here.

Also, just want to thank everyone who’s chipped in to explain things :smile:

Copyright is what powers licenses :slight_smile: You need to own something before you can permit people to use it. Plus, we like to give credit where it’s due!

Yeah same.

I can’t answer your specific questions about the PSF license though. You might need to fire off a message to the PSF legal team.

1 Like

Haha true, should have phrased it better.

I guess I’ll do that then. Thank you!

You CANNOT distribute you work under the PSF license because that license is specific to the PSF rather than being generic. If you contribute it to the PSF and it gets accepted and incorporated into CPython, then the PSF distributes it (under the PSF license).

A derived work MUST give the acknowledgement specified in clause 2 and the summary specified in clause 3. For the latter, “This module includes corrections and new features as documented in its ” should be a start. For promotional purposes, you will likely want to say more.

1 Like

As I understand, no one in this thread suggested distributing third-party code under the PSF license. What was being considered was vendoring the deleted stdlib module verbatim into a third-party repository, and declaring that that specific module was licensed by the PSF license.

I’m not a lawer etc, but as far as I understand, @Rosuav’s suggestion was compatible with the PSF License:

[...] PSF hereby grants Licensee a [...] license to [...]
display publicly, prepare derivative works, distribute,
and otherwise use Python 3.12.3 alone or in any
derivative version, provided, however, that PSF's License
Agreement and PSF's notice of copyright, i.e., "Copyright
© 2001-2023 Python Software Foundation; All Rights
Reserved" are retained [...] in any derivative version
prepared by Licensee.
1 Like

Is there a repository that’s already dealt with this? I really would like to see a real example to better understand this.