Skip to content

Conversation

@facutuesca
Copy link
Contributor

@facutuesca facutuesca commented Dec 8, 2025

From #13985 (comment):

Another follow up: can you have us use to_str() on py310+ and to_cow() only on older Pythons? We do 3.11 wheels, so they'll get the perf win.

Since pyo3 already internally uses to_str when calling to_cow in Python 3.10+, we just add a comment to migrate once the minimum Python version is sufficient

Part of #12283

@facutuesca facutuesca marked this pull request as draft December 8, 2025 22:19
@facutuesca facutuesca force-pushed the ft/asn1-to_str branch 2 times, most recently from a64cef6 to f88aee5 Compare December 8, 2025 22:49
@facutuesca facutuesca marked this pull request as ready for review December 8, 2025 22:56
Copy link
Member

@alex alex left a comment

Choose a reason for hiding this comment

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

I think we're going to have this pattern in several places, let's put it in a function.

@facutuesca facutuesca changed the title asn1: Use PyStringMethods::to_str when possible asn1: Add TODO comment for uses of PyStringMethods::to_cow Dec 9, 2025
@facutuesca
Copy link
Contributor Author

I think we're going to have this pattern in several places, let's put it in a function.

Changed the PR to only add a TODO comment because pyo3 already internally uses to_str when calling to_cow in Python 3.10+.

@alex alex enabled auto-merge (squash) December 9, 2025 13:09
@alex alex merged commit 50c9a7c into pyca:main Dec 9, 2025
68 checks passed
@facutuesca facutuesca deleted the ft/asn1-to_str branch December 9, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants