Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-99631: Add custom loads and dumps support for the shelve module#99632

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
furkanonder wants to merge17 commits intopython:mainfromfurkanonder:issue-99631
Closed

gh-99631: Add custom loads and dumps support for the shelve module#99632

furkanonder wants to merge17 commits intopython:mainfromfurkanonder:issue-99631

Conversation

furkanonder
Copy link
Contributor

@furkanonderfurkanonder commentedNov 20, 2022
edited by bedevere-bot
Loading

@merwokmerwok added type-featureA feature request or enhancement stdlibPython modules in the Lib dir 3.12only security fixes labelsDec 1, 2022
@merwok
Copy link
Member

Could you add docs and tests?

erlend-aasland, smontanaro, and furkanonder reacted with thumbs up emoji

@serhiy-storchaka
Copy link
Member

Do we need to specify the pickler and unpickler classes or justdumps() andloads() functions?

isidentical and furkanonder reacted with thumbs up emoji

@isidentical
Copy link
Member

I'd also go fordumps andloads instead of pickler/unpickler classes. With a proper definition (e.g. takes a Python object and returns bytes) I think that should make it much more simpler (it is also similar how other pickle-related APIs work outside of the stdlib)

furkanonder reacted with thumbs up emoji

@furkanonderfurkanonder changed the titlegh-99631: Add custom unpickler and pickler support for the shelve modulegh-99631: Add custom loads and dumps support for the shelve moduleDec 3, 2022
@furkanonder
Copy link
ContributorAuthor

Doc and test have been added.@merwok

The pickler and unpickler classes have been replaced withdumps() andload() functions.@isidentical@serhiy-storchaka

Copy link
Member

@isidenticalisidentical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks a lot for your efforts@furkanonder, I have a few minor suggestions but this already looks great!

@netlify
Copy link

netlifybot commentedDec 7, 2022
edited
Loading

Deploy Preview forpython-cpython-preview canceled.

NameLink
🔨 Latest commit11cbfbf
🔍 Latest deploy loghttps://app.netlify.com/sites/python-cpython-preview/deploys/63934b91a06334000855fb77

@serhiy-storchaka
Copy link
Member

Should we require the serializer to accept the pickle protocol? It does not make sense for other than pickle formats.

What happens if only serializer or only deserializer are passed?

@furkanonder
Copy link
ContributorAuthor

What happens if only serializer or only deserializer are passed?

elif (serializerisNoneanddeserializerisnotNone)or (deserializerisNoneandserializerisnotNone):raiseShelveError("Serializer and deserializer must be defined together.")

In this case, shelve raises an error.

@furkanonderfurkanonder requested review fromrhettinger andisidentical and removed request forrhettinger andisidenticalDecember 20, 2022 20:05
@furkanonderfurkanonder closed this by deleting the head repositoryDec 23, 2022
@furkanonderfurkanonder requested review fromrhettinger andisidentical and removed request forisidentical andrhettingerDecember 23, 2022 18:52
@encukou
Copy link
Member

This seems to have been forgotten over end-of-year break in 2022. Do you want to revive it?

TheBsdDbShelf class needs to be updated as well; its extra functions should usedeserializer rather thanUnpickler

@furkanonder
Copy link
ContributorAuthor

I accidentally deleted my forked repository, so I can't update my old PRs. So I opened a newPR.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@isidenticalisidenticalisidentical approved these changes

@rhettingerrhettingerAwaiting requested review from rhettinger

Assignees
No one assigned
Labels
3.12only security fixesawaiting mergestdlibPython modules in the Lib dirtype-featureA feature request or enhancement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

7 participants
@furkanonder@merwok@serhiy-storchaka@isidentical@encukou@rhettinger@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp