Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add name_only arg #5

Open
janthmueller opened this issue Nov 29, 2024 · 0 comments
Open

add name_only arg #5

janthmueller opened this issue Nov 29, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@janthmueller
Copy link
Owner

Need to enhance swizzledtuple by adding a name_only argument (or a similarly named option) to indicate that only the names get swizzled, skipping the current sequential matching algorithm that tries out all possible names. This should make the swizzle_attributes_retriever method much faster.

Alternatively, introduce a swizzle_only argument that accepts multiple values like dir. This would allow swizzledtuple to grab all the attributes via dir, bypassing the sequential matching and further speeding up the swizzle_attributes_retriever method. This change would make it more convenient for swizzled classes, not just for named tuples.

Maybe add an option to specify dir or provide a list of attributes to swizzle to make the process faster.
(Also need to research the Python C API to find ways to make the entire swizzling process faster.)

@janthmueller janthmueller added the enhancement New feature or request label Nov 29, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant