<div dir="ltr">This is an appropriate topic for pyton-ideas:<div><br></div><div><a href="https://mail.python.org/mailman/listinfo/python-ideas">https://mail.python.org/mailman/listinfo/python-ideas</a><br></div><div><br></div><div>not python-dev.</div><div><br></div><div>I'm sure you'll find interest in your idea there.</div><div><br></div><div>-CHB</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 15, 2018 at 1:25 AM, Marko Ristin-Kaufmann <span dir="ltr"><<a href="mailto:marko.ristin@gmail.com" target="_blank">marko.ristin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Hi python devs,<br><br></div>I would be very interested to bring design-by-contract into python 3. I looked at some of the packages I found on pypi and also we rolled our own solution (<a href="https://github.com/Parquery/icontract/" target="_blank">https://github.com/Parquery/<wbr>icontract/</a>). I also looked into <a href="https://www.python.org/dev/peps/pep-0316/" target="_blank">https://www.python.org/dev/<wbr>peps/pep-0316/</a>.<br><br></div>However, all these solutions seem quite clunky to me. The decorators involve an unnecessary computational overhead and the implementation of icontract became quite tricky once we wanted to get the default values of the decorated function.<br><br></div>What do you think about the following solution as an extension to python compiler / interpreter?<br></div><br>* We specify pre- and post-conditions in the docstring.<br></div>* Python interpreter parses these conditions and adapts the corresponding byte codes at the begining and the end of the function body.<br><br></div>I'm very grateful for any feedback on this!<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Marko<br></font></span></div>
<br>______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/chris.barker%40noaa.gov" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/options/python-dev/<wbr>chris.barker%40noaa.gov</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div>