>
>
>
> This is inconsistent (and documented ;-).
But is it documented someplace easy for Sage users to find? Thanks!
> For the operations "or" and
> "and" Python actually uses "__nonzero__". *Not* "__or__" and "__and__"
> which are the bitwise operation "|" and "&".
>
> They work as
On 01/12/15 15:01, kcrisman wrote:
This is inconsistent (and documented ;-).
But is it documented someplace easy for Sage users to find? Thanks!
I would say "no". It is in the `__init__` method of the `UnknownClass`.
It should be moved to the main documentation class.
For the
Le mercredi 25 novembre 2015 12:28:45 UTC+1, vdelecroix a écrit :
>
> Hello,
>
[ Snip... ]
The only way to fix Unknown would be to patch (non trivially) Python.
> Boolean inherits from int... and it would be hard to have a third party
> "Unknown" coherent with this inheritance. There was a
On 01/12/15 15:18, Emmanuel Charpentier wrote:
Le mercredi 25 novembre 2015 12:28:45 UTC+1, vdelecroix a écrit :
Hello,
[ Snip... ]
The only way to fix Unknown would be to patch (non trivially) Python.
Boolean inherits from int... and it would be hard to have a third party
"Unknown"
Hello,
This is inconsistent (and documented ;-). For the operations "or" and
"and" Python actually uses "__nonzero__". *Not* "__or__" and "__and__"
which are the bitwise operation "|" and "&".
They work as follows:
In "x and y" if "x.__nonzero__()" is False then the result is "x"
otherwise
On social media:
sage: False or Unknown
Unknown
sage: Unknown or False
False
sage: False and Unknown
False
sage: Unknown and False
Unknown
It does seems somewhat inconsistent...
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe