question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

trafaret.Int converts values while checking

See original GitHub issue

((t.Int() | t.String()) & t.String())('0') produces DataError: value is not a string which is obviously not true. This also introduces bugs in aiohttp_admin. t.Int().check(..., convert=False) also converts string to int

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Deepwalkercommented, Jul 25, 2017

Merged. Use t.RawInt instead of t.Int to just check and not convert

0reactions
Deepwalkercommented, Jul 24, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing trafaret — Trafaret 1.0.0 documentation
Introducing trafaret¶ ; Int will not convert numbers to integers, this mean that some checkers, like ; String with regular expression, have special...
Read more >
Trafaret Documentation - Read the Docs
This does not mean that Int will not convert numbers to integers, ... Check if value is a float or can be converted...
Read more >
How do I check if a string represents a number (float or int)?
The issue is that any numeric conversion function has two kinds of results ... Discard "NaN" (not a number) strings while checking for...
Read more >
Python Examples of trafaret.Null - ProgramCreek.com
DataError) as res: await trafaret.async_check('blablabla') assert res.value.as_dict() == { 0: 'value can\'t be converted to int', 1: 'value should be None', }.
Read more >
Handlebars Helpers Reference | BigCommerce Dev Center
When used in conjunction with the built-in {{each}} helper, returns retrieved values in an array. Parameters. limit , limit-value : Optional parameters to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found