Comments (5)
Usually I'd say the default behaviour of Python might be the least surprising to a user of a library. But in that particular case it would mean that converting 'False'
to True
is the "sane" thing to do. But this does not sound very sane to me. 🙂
So I guess it might make sense to handle this in undictify. What strings should we convert to True
and False
? Maybe like so?
True <- ['1', 'yes', 'true', 'on']
False <- ['0', 'no', 'false', 'off']
- exception for everything else?
(With the string being converted to lowercase first?)
from undictify.
It just makes so much sense, so I quickly implemented it. :)
from undictify.
Thanks again a lot for this very helpful report. Stuff like this really improves the library. :)
from undictify.
Wow, I wasn't even able to answer - thanks so much for the quick response!
I don't about on
/off
or yes
/no
, but 0
/1
and false
/true
for sure make sense :)
from undictify.
If a component in the the standard library does it that way, I guess it's fine. :)
from undictify.
Related Issues (14)
- Confused HOT 2
- Custom conversions HOT 10
- Optional Unions on dataclasses cannot be omitted HOT 2
- Respect InitVars in type_checked_constructor HOT 1
- Inheritance with @type_checked_constructor() HOT 6
- Force conversion independently of type HOT 6
- Branch `master` will be renamed to `main` in November HOT 1
- dataclass variable Optional type causing issue HOT 1
- incorrect output in first example HOT 1
- How to contribute? HOT 1
- Dates HOT 2
- dataclass compatibility HOT 2
- Future-compatible annotations HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from undictify.