Changes between Initial Version and Version 1 of Ticket #25845


Ignore:
Timestamp:
07/12/18 14:08:04 (4 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25845 – Description

    initial v1  
    11This is done mainly to avoid cyclic imports when enabling `binding=True` (#22747).
     2
     3I'm also removing this pointless implementation of `cardinality()`:
     4{{{
     5    def cardinality(self):
     6        from sage.rings.integer import Integer
     7        two = Integer(2)
     8        if self._type is bool:
     9            return two
     10        elif self._type is int:
     11            import sys
     12            return two * sys.maxsize + 2
     13        elif self._type is float:
     14            return 2 * two**52 * (two**11 - 1) + 3 # all NaN's are the same from Python's point of view
     15        else:
     16            # probably
     17            import sage.rings.infinity
     18            return sage.rings.infinity.infinity
     19}}}
     20Somebody probably found this clever, but it's just silly... who cares how many different `int` instances there exist? Besides, it's wrong in Python 3.