X Tutup
The Wayback Machine - https://web.archive.org/web/20221223204008/https://github.com/jython/jython/issues/217
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPython3.12a1 still has special case support for PyStringMap #217

Closed
sobolevn opened this issue Nov 14, 2022 · 2 comments
Closed

CPython3.12a1 still has special case support for PyStringMap #217

sobolevn opened this issue Nov 14, 2022 · 2 comments

Comments

@sobolevn
Copy link

sobolevn commented Nov 14, 2022

Hi! I am CPython contributor :)
And I've recently noticed that for the last 22 years we have some special casing for org.python.core.PyStringMap.

Here are they:

The question is: do we still need it?

Some concerns:

  1. It imports code from some third-party module in the stdlib. This is the only place (there might be some other cases that I am not familiar with, please proove me wrong) where we do it. It might be a source of some unexpected results if user has the same package structure. It might be even related to security, because importing third-party modules is never safe in Python
  2. Jython seems to only support 2.7 a the moment, so we might not need this anymore in our core library 🤔

Please, share your vision on this 🙂

@jeff5
Copy link
Member

jeff5 commented Nov 14, 2022

tl;dr: It's fine to remove from 3.x; I assume you have no interest in doing so from 2.7.

Jython copies the CPython stdlib, and shadows parts of it with modified versions. This is a pain to maintain so it was always the ambition to have one stdlib that worked with both. We mostly haven't managed to back port changes.

You'll find the occasional concession to Jython in CPython source and we always appreciate it when discussion of Python the language is distinguished from CPython the implementation.

As we only have a viable 2.7 at present, we only use the 2.7.x stdlib, and I assume you have no interest in changing it there.

We hope to support Python 3 eventually, so would appreciate the possibility of a common stdlib. The detail of any support already in 2.7 has a slim chance of being relevant to a Jython 3. (This one at less than evens.)

The best thing you can do for other implementation is not to include (in tests mainly) behaviours that are CPython implementation details, or not without a skip-guard, anyway.

@sobolevn
Copy link
Author

sobolevn commented Nov 14, 2022

@jeff5 thanks a lot for your answer! Yes, my main goal is to remove these details from CPython3.12+

Older versions will not be changed.

We also care about other implementations and support @cpython_only set of tests for the implementation details. Right we have reports from PyPy mostly.

Please, take a look at the proposed changes if you have the time: python/cpython#99484

I am going to close this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
X Tutup