[Python-ideas] "old" values in postconditions
marko.ristin at gmail.com
Tue Sep 25 13:54:30 EDT 2018
Hi James and Franklin,
getsource() definitely does not work. I tried for a long, long time to make
it work and finally gave up. I parse in icontract the whole file where the
lambda function resides and use asttokens to locate the node of the lambda
(along some tree traversing upwards and making assumptions where the
condition lambda lives).
Have a look at:
On Tue, 25 Sep 2018 at 19:48, James Lu <jamtlu at gmail.com> wrote:
> > I'm surprised you haven't found
> > inspect.getsource(func)
> I did. That’s exactly what I was describing in the paragraph. It wouldn’t
> work in interactive mode and it includes everything on the same line of the
> lambda definition.
> Python-ideas mailing list
> Python-ideas at python.org
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas