Closed BradenM closed 3 years ago
Thanks a lot for bringing this up, this seemed to have been a regression in 1.8.0. It wasn't an intentional change.
I've added a test for this as well as a fix. If the build passes, I'll tag a 1.8.1 release with a fix.
A breaking change was made to the Choice object api at some point between questionary versions 1.6.0 and 1.8.0 when specifying the
value
parameter.Previously, in v1.6.0, the expected behavior was for the selected choice to return the provided
value=
"as is" with no modifications.However, in v1.8.0, anything passed to
value
is now type cast as a string, leading to breaking changes for applications expecting the returned value to be of the same type originally passed in to thevalue
parameter. (See https://github.com/BradenM/micropy-cli/issues/184, the issue that led to finding this.)Quick search through the commit history points to this commit: https://github.com/tmbo/questionary/commit/604c112224a9bd45a09eec40353d8618a494c98f from #14 as a likely culprit.
I'm not sure if Questionary follows semantic versioning or not, but if so that PR (if it is actually the culprit) probably should have bumped the project version up by a major version given that the change is not backwards compatible w/ existing projects using v1.6.0.
Questionary v1.6.0
Questionary v1.8.0