Ish is a stupid library that allows you to test if a variable is true-ish
or
false-ish
.
It exports a single variable called ish
, which can be subtracted from True
or False
to create a TrueIsh or FalseIsh object. This can be compared with
the value to see if it either:
- Evaluates to
True
- Is a string containing the English, French, German, Danish, Dutch,
Afrikaans, Swedish, Norwegian, Portuguese, Irish, Esperanto or Arabic for
either
Yes
orNo
(or a handful of slang words with the same meaning).
If it is a string containing none of these known words, it raises
a ValueError
if 'Yup' == True-ish:
print 'True-ish!'
It also does some things I haven't documented yet.
Ish is compatible with Python 2.7, 3.3+ and PyPy.
Install tox. Run tox
in the top-level directory. This should run the
tests against all supported Python versions.
Contributions are received with love and enthusiasm! That said, if you would like to contribute to ish, please follow some basic guidelines:
- We like
PEP-8
. Not in an aggressive way, but you should follow PEP-8 98% of the time. - Run the tests before you commit, and make sure they pass.
- Please write some unit tests for any added functionality.
❤️