You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The doc for StringConstraintsstrip_whitespace says "Whether to strip whitespace from the string." - to me that's unclear if it's stripping all whitespace or only leading/trailing (it's the latter I think).
Initial Checks
Description
The doc for
StringConstraints
strip_whitespace
says "Whether to strip whitespace from the string." - to me that's unclear if it's stripping all whitespace or only leading/trailing (it's the latter I think).I think it'd be clearer if it said "Whether to remove leading and trailing whitespace." which I think is the actual behaviour, and aligns with the doc for constr - https://docs.pydantic.dev/latest/api/types/#pydantic.types.constr
https://docs.pydantic.dev/latest/api/types/#pydantic.types.StringConstraints
Maybe this unit test should be updated to include a space inside of ABC to assert on that behaviour? 8bc104f#diff-bd467a363c9f155a2e6a7716aeca0c351089135a53d09a66138cea4f16506ebdR5574
Example Code
No response
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: