On Monday, July 25, 2016 at 9:14:53 AM UTC+2, Sergi Almacellas Abellana 
wrote:
>
> El 23/07/16 a les 19:02, Marko Randjelovic ha escrit: 
> > 
> > 
> > On Friday, July 22, 2016 at 9:25:09 AM UTC+2, Cédric Krier wrote: 
> > 
> >     On 2016-07-21 12:40, Marko Randjelovic wrote: 
> >     > Of course, but in examples I have neither ~ nor Not is imported 
> from 
> >     > trytond.pyson. How Python knows about new character of '~'? Also, 
> >     how is 
> >     > achieved possible to use ~ as an operator (there are no 
> parenthesis)? 
> > 
> >     '~' is a standard python operator so it does not need to be 
> imported. 
> >     See 
> >     https://docs.python.org/2/library/operator.html#operator.__invert__ 
> >     <https://docs.python.org/2/library/operator.html#operator.__invert__> 
>
> > 
> > 
> > ~ is a standard operator but it's purpose is bitwise inversion. How did 
> > we make it become logical negation? 
> Because we define the __invert__ operator of every PYSON object: 
>
> http://hg.tryton.org/trytond/file/9a65b63b90f4/trytond/pyson.py#l40


But there is no mention of the '~' symbol in whole this file. How do we 
connect this code to the '~' symbol?

Regards,
Marko
 

>
>
> -- 
> Sergi Almacellas Abellana 
> www.koolpi.com 
> Twitter: @pokoli_srk 
>

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/6b116e56-629c-4fa7-a1fd-2611e4b5908c%40googlegroups.com.

Reply via email to