GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-81313: Add the math.integer module (PEP-791) by serhiy-storchaka · Pull Request #133909 · python/cpython Conversation
|
|
This is a further development of #13741. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A PEP is being written for this module: skirpichev/peps#8 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Sergey B Kirpichev <[email protected]>
|
I used other way to fix the module name. This is a temporary hack, I hope we will make it a straight way in future. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think test failures are relevant. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
IMO it's good enough for a first iteration, we will have enough time until Python 3.15 final to find a way to fix these issues. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…awSH.rst Co-authored-by: Victor Stinner <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Playing with the new module, I found also this:
>>> math.integer.__spec__
ModuleSpec(name='_math_integer', loader=<_frozen_importlib_external.ExtensionFileLoader object at 0x7fdbdae6f150>, origin='/home/sk/src/cpython/build/lib.linux-x86_64-3.15/_math_integer.cpython-315-x86_64-linux-gnu.so')
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| For backward compatibility, the :mod:`math` module provides also aliases of | ||
| the following functions from the :mod:`math.integer` module: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please mention there, that these aliases are soft-deprecated.
BTW, why this section was moved?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Because it is less important than other sections.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is, if we want to communicate users this renaming. Though, it's important only for those who read docs in order... Up to you.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| /* Fix the __name__ attribute of the module and the __module__ attribute | ||
| * of its functions. | ||
| */ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Could you, please, create an issue to track this?
IIUIC, currently it's also not clear how to name the module file (math_integermodule.c, math/integermodule.c or even intmathmodule.c). I.e. we should extend current naming scheme to submodules.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
See #140824.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Sergey B Kirpichev <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with few nitpicks (up to Serhiy) and note about ModuleSpec(). (I suspect this might affect something.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| .. versionchanged:: 3.10 | ||
| Floats with integral values (like ``5.0``) are no longer accepted in the | ||
| :func:`factorial` function. | ||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a versionchanged to mention that these functions became aliases to math.integer functions?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This did not change their behavior.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Floats with integral values (like ``5.0``) are no longer accepted in the | ||
| :func:`factorial` function. | ||
|
|
||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You should add .. deprecated:: 3.15 to repeat that these functions are soft deprecated and math.integer functions should be used instead.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.