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

bpo-39435: Fix docs for pickle.loads #18160

Open
wants to merge 2 commits into
base: master
from

Conversation

@hauntsaninja
Copy link

hauntsaninja commented Jan 24, 2020

@the-knights-who-say-ni

This comment has been minimized.

Copy link

the-knights-who-say-ni commented Jan 24, 2020

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@hauntsaninja

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@hauntsaninja hauntsaninja force-pushed the hauntsaninja:bpo39435 branch from a7d8027 to ffefcf0 Jan 24, 2020
@hauntsaninja

This comment has been minimized.

Copy link
Author

hauntsaninja commented Jan 24, 2020

Hello, it's my first time contributing to CPython!

Apologies if something is incorrect. make patchcheck complained about not having updating Misc/ACKS, although this is a trivial change, so sort of confused about that. Hopefully it'll recognise my CLA signature soon :-)

@tirkarthi tirkarthi requested a review from pitrou Jan 24, 2020
@pitrou

This comment has been minimized.

Copy link
Member

pitrou commented Jan 24, 2020

Thanks for contributing this. However, I don't think there is anything to fix. The argument is positional only (hence the / after it), so its name is purely indicative. Here, bytes_object points to the kind of object that is accepted. By renaming it to data, that information is removed.

@pitrou

This comment has been minimized.

Copy link
Member

pitrou commented Jan 24, 2020

I'm rejecting this PR.

@pitrou pitrou closed this Jan 24, 2020
@hauntsaninja

This comment has been minimized.

Copy link
Author

hauntsaninja commented Jan 25, 2020

Hello @pitrou , thanks for reviewing!
I don't see a / for positional-only, all I see is a * for the remaining arguments being keyword-only. Note that the asterisk is escaped with a backslash in the .rst which could be a possible source of confusion?
As far as I can tell, the argument is not positional-only in pickle.rst on master (.. function:: loads(bytes_object, \*, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)), the rendered documentation at https://docs.python.org/3/library/pickle.html#pickle.loads or the behaviour at runtime:

>>> sys.version
'3.7.6 (default, Dec 30 2019, 19:38:26) \n[Clang 11.0.0 (clang-1100.0.33.16)]'
>>> inspect.signature(pickle.loads)
<Signature (data, *, fix_imports=True, encoding='ASCII', errors='strict')>

If you feel bytes_object is a better name than data, maybe we could actually document the argument as positional-only, and leave the fact that it is positional-or-keyword as undocumented, (or change the implementation to use the name bytes_object).

@pitrou

This comment has been minimized.

Copy link
Member

pitrou commented Jan 25, 2020

Hi @hauntsaninja, you're right, it seems I confused the \ with a /. Sorry for that, and I'm reopening the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.