hgomersall / python-boolean Goto Github PK
View Code? Open in Web Editor NEWA few handy tools for parsing boolean strings, as well as getting the minimal sum-of-products from a boolean string.
A few handy tools for parsing boolean strings, as well as getting the minimal sum-of-products from a boolean string.
I ran into an issue where I was supplying boolean variables in a list of unicode strings but they weren't being processed up properly by parse_boolean_function_string()
.
In [13]: func = parse_boolean_function_string('blah', [u'blah'])
In [14]: func
Out[14]: u'blah'
In [15]: func = parse_boolean_function_string('blah', ['blah'])
In [16]: func
Out[16]: <function psirt_utils.python_boolean.logic.<lambda>>
In [17]:
It's easy enough for me to turn the unicode strings into regular strings but is this working as designed? I wasted a bit of debugging trying to figure out what's wrong. I'm used to Python and packages not caring much about the difference between a string and a unicode string. Python thinks strings and unicode strings with the same data are equal:
In [17]: u'blah' == 'blah'
Out[17]: True
I suspect python-boolean is looking at the types and doesn't treat string and unicode the same.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.