@@ -25,9 +25,10 @@ Other compositions like XOR and NAND are not implemented.
25
25
26
26
Installation
27
27
------------
28
- ::
29
- pip install boolean.py
30
28
29
+ .. code-block :: sh
30
+
31
+ pip install boolean.py
31
32
32
33
Creating boolean expressions
33
34
----------------------------
@@ -39,7 +40,7 @@ an algebra, then use algebra attributes and methods to build expressions.
39
40
You can build an expression from a string:
40
41
41
42
.. doctest :: boolean
42
-
43
+
43
44
>>> import boolean
44
45
>>> algebra = boolean.BooleanAlgebra()
45
46
>>> algebra.parse(' x & y' )
@@ -59,7 +60,7 @@ You can build an expression from a Python expression:
59
60
>>> x & y
60
61
AND(Symbol('x'), Symbol('y'))
61
62
62
- You can build an expression by using the algebra functions::
63
+ You can build an expression by using the algebra functions:
63
64
64
65
.. doctest :: boolean
65
66
@@ -254,9 +255,9 @@ Using boolean.py to define your own boolean algebra
254
255
---------------------------------------------------
255
256
256
257
You can customize about everything in boolean.py to create your own custom algebra:
257
- 1. You can subclass :class: `BooleanAlgebra ` and override or extend the
258
- :meth: `tokenize `:: and :meth: `parse `:: method to parse custom expression creating
259
- your own mini expression language. Seen the tests for examples.
258
+ 1. You can subclass :class: `BooleanAlgebra ` and override or extend the
259
+ :meth: `tokenize ` and :meth: `parse ` methods to parse custom expressions creating
260
+ your own mini expression language. See the tests for examples.
260
261
261
262
2. You can subclass the Symbol, NOT, AND and OR functions to add additional
262
263
methods or for custom representations.
0 commit comments