-
-
Notifications
You must be signed in to change notification settings - Fork 376
default buffer logic #3644
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
base: main
Are you sure you want to change the base?
default buffer logic #3644
Conversation
…into feat/get_json
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3644 +/- ##
==========================================
+ Coverage 60.89% 60.99% +0.10%
==========================================
Files 86 86
Lines 10182 10293 +111
==========================================
+ Hits 6200 6278 +78
- Misses 3982 4015 +33
🚀 New features to boost your workflow:
|
|
@d-v-b Could you elaborate on the motivation for widening the Store API like this? |
|
Stores don't do anything with And multiple stores have already implemented logic for selecting a default buffer class. The changes here propagate that sensible design to all store classes. |
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
This PR builds on #3638 to add routines to the store ABC, and thereby all other stores, for handling additional types for the
prototypeparameter passed tostore.getand the methods that callget. This change makes it easier to use store methods without unnecessary imports.The type of
prototypeis widened totype[Buffer] | BufferPrototype | None.type[Buffer] | BufferPrototypeis compacted to the type aliasBufferLike.When
prototypeistype[Buffer], the store will use that class directly. Since the stores never use theBufferPrototype.nd_buffer, passing aBufferclass should be preferred over usingBufferPrototype.When
prototypeisNone, the store class retrieves aBufferclass by calling its_get_default_buffer_classmethod. The default implementation returns thedefault_buffer_prototypewhich makes our ABC less abstract but keeps these changes non-breaking.