Skip to content

Reorganize CPython module imports in alphabetical order and import by sub-module instead#40

Merged
Vizonex merged 1 commit intomainfrom
0.1.9-improvements-and-optimizations
May 8, 2025
Merged

Reorganize CPython module imports in alphabetical order and import by sub-module instead#40
Vizonex merged 1 commit intomainfrom
0.1.9-improvements-and-optimizations

Conversation

@Vizonex
Copy link
Owner

@Vizonex Vizonex commented Apr 27, 2025

Please know that it has to do with Cython's plans Deprecate importing from anything but a submodule in the CPython module directly. Allow me to quote what they said in init.pyx of cpython's module.

#################################################################
# BIG FAT DEPRECATION WARNING
#################################################################
# Do NOT cimport any names directly from the cpython package,
# despite of the star-imports below.  They will be removed at
# some point.
# Instead, use the correct sub-module to draw your cimports from.
#
# A direct cimport from the package will make your code depend on
# all of the existing declarations. This may have side-effects
# and reduces the portability of your code.
#################################################################
# START OF DEPRECATED SECTION
#################################################################

This one is a little bit more questionable (hence the pull request) and I plan to try and make a pull request for uvloop to do the same.

If anybody plans to change this please know that it has to do with Cython's plans Deprecate cimporting names from a CPyton module directly.
@Vizonex Vizonex requested a review from lschoe April 27, 2025 22:30
@Vizonex
Copy link
Owner Author

Vizonex commented May 8, 2025

Since you haven't responded I tried at least and I will just pass this please know as to why I made this change and I thought it would be important as I request to make the library readable to help maintain it better.

@Vizonex Vizonex merged commit 48f9730 into main May 8, 2025
@Vizonex Vizonex deleted the 0.1.9-improvements-and-optimizations branch May 8, 2025 22:35
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

Successfully merging this pull request may close these issues.

1 participant