Add support for negative values#1355
Conversation
|
There seems to be a problem with the Python 3.6 run of the CI, that check has been failing for all pull requests in the past month. Which is why the checks fail. |
|
This is a breaking change as applications may not expect negative values there right now; you could either add a new converter or an argument (like it's done for the Also, general tip: Having issue numbers at the beginning of a commit message is more noise than useful (especially when not prefixed with # so they aren't linked on github). |
|
I've changed the name, thanks for the tip. In my opinion this is not a breaking change but rather a bug fix (or might be both). Int implies that the input should allow any integer, the fact that it hasn't until now should be considered a bug as it is not expected behaviour for an integer parser. However, I realise that a lot of people might be using the fact it doesn't allow negative numbers to skip writing their own error handling for invalid values (in the case of paging) so I will make two new converters SignedIntegerConverter and SignedFloatConverter as that will probably cause the least amount of tension. Do you prefer the new types to be called 'sint' and 'sfloat' or 'signed_int' and 'signed_float'? :) |
|
Bugfixes can be breaking changes as well if the bug existed for a long time and people likely relied on them. For example, the most common use case for If backwards compatibility was not thing I'd change int and add
If we go for |
|
Adding an I think either Should be the method we use. I have no strong preference for either one, but EDIT: Werkzeug does not allow - in their url rules so we can rule out |
|
I've updated the method of support to
|
|
Any other comments? |
make signed regex overridable add changelog
1e3b4ce to
8c7efbe
Compare
|
Rebased, added changelog, and refactored. |
Added support for negative values in IntegerConverter and FloatConverter
If this method is not preferred, lets discuss the best way to add signed values.
Closes #729