From d88c8ff7381a2874328943e91dc7774913d52643 Mon Sep 17 00:00:00 2001 From: Lafrite Date: Wed, 25 Feb 2015 15:23:01 +0100 Subject: [PATCH] Start working on parent class: Renderable_expression and Computable_expression --- pymath/computable_expression.py | 46 +++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 pymath/computable_expression.py diff --git a/pymath/computable_expression.py b/pymath/computable_expression.py new file mode 100644 index 0000000..59a513e --- /dev/null +++ b/pymath/computable_expression.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# encoding: utf-8 + +class Renderable_expression(object): + + """Docstring for Renderable_expression. """ + + def __init__(self): + """@todo: to be defined1. """ + + + + +class Computable_expression(Renderable_expression): + + """ A computable_expression is an expression represented by a list of postfix tokens. It's a parent class of a more classical Expression, Fraction and Polynom (and later square root) + Child class will herits those methods + * simplify: Compute entirely the expression + * explain: Generator which return steps which leed to himself + + """ + + def __init__(self): + """@todo: to be defined1. """ + + pass + + def simplify(self): + """ Simplify the expression + + :returns: the simplified expression with .steps attributes where steps are stocked + + """ + pass + + def explain(self): + """ Generate and render steps which leed to itself """ + pass + + + + +# ----------------------------- +# Reglages pour 'vim' +# vim:set autoindent expandtab tabstop=4 shiftwidth=4: +# cursor: 16 del