Skip to content

Conversation

sydney-runkle
Copy link
Contributor

@sydney-runkle sydney-runkle commented Sep 18, 2024

Alternative to #1324, thanks @mikeleppane for some of the tests here! Basically, fall back to trying to SomeEnum(input_value), and if that's valid, then return that value. This enables the use of custom __new__ functions as well :).

Fix pydantic/pydantic#9559
Fix pydantic/pydantic#9572
Fix pydantic/pydantic#9248

These to be addressed separately, in another PR soon that deals with the Literal validator:

Copy link

codspeed-hq bot commented Sep 18, 2024

CodSpeed Performance Report

Merging #1456 will not alter performance

Comparing enum-fixes (c4fc1a5) with main (e0b4c94)

Summary

✅ 155 untouched benchmarks

@sydney-runkle
Copy link
Contributor Author

@sydney-runkle sydney-runkle merged commit 8c1a0da into main Sep 20, 2024
28 of 29 checks passed
@sydney-runkle sydney-runkle deleted the enum-fixes branch September 20, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants