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-117056: fix discrepancy in _decimal/_pydecimal public signatures by skirpichev · Pull Request #137697 · python/cpython Conversation
|
| return r | ||
|
|
||
| def _apply(self, a): | ||
| def _apply(self, a, /): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is not a public method.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Does it? >>> class A: ... def foo(self, /): ... pass ... def bar(self): ... pass ... >>> help(A) Help on class A in module __main__: class A(builtins.object) | Methods defined here: | | bar(self) | | foo(self, /) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object >>> help(A.foo) Help on function foo in module __main__: foo(self, /) >>> help(A.bar) Help on function bar in module __main__: bar(self) It's removed in the Python sphinx docs, yes, together with self parameter. (By hand. Or using autodoc, e.g. as this toy extension: https://python-gmp.readthedocs.io/en/latest/) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
You are right. But this does not affect common use. BTW, please update also the documentation if all these parameters are not already marked as positional-only. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I agree with Serhiy, I think the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Huh, distracting "/" will anyway appear in the help() output or in the inspect.signature()'s. Per default (C implementation). I think people who read sources will be less surprised by usual python syntax. And it's just a matter of time when they will come with new bug about incompatible API.
There is a ready for review pr: #131990. I hope it does all on sphinx side. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Then lets close this pr (and, perhaps, issue as well). If API of _pydecimal and _decimal will be incompatible - it's not better than current state of art. Perhaps, issue will be solved later, when core devs will end war with Python syntax. |
Sorry, something went wrong.
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.