Changes between Version 2 and Version 3 of Ticket #12480


Ignore:
Timestamp:
02/09/12 16:14:30 (9 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12480 – Description

    v2 v3  
    3838        Note that this function will raise an Index error if n > self.cache_limit.
    3939        Also, it will return None on input 0
     40        [...]
     41        """
     42        if n < 0:
     43            n = -n
     44        try:
     45            return self.c[n]
     46        except IndexError:
     47            return PowComputer_ZZ_pX.get_context(self, n)
     48
    4049}}}
    41 '''On input 0, we have a `Py_None` typecast to a `ntl_ZZ_pContext_class`'''.  How does this make sense?  The fact that it crashes on OS X 10.7 is expected, the surprising thing is that this doesn't crash on other systems.
     50'''On input 0, we have a `Py_None` typecast to a `ntl_ZZ_pContext_class`''' and we pretend like that's okay.  How does this make sense?  The fact that it crashes on OS X 10.7 is expected, the surprising thing is that this doesn't crash on other systems.
     51
     52The `None` in the `self.c[]` array comes from line 1671:
     53{{{
     54            self.c.append(None)
     55            for i from 1 <= i <= cache_limit:
     56                self.c.append(PowComputer_ZZ_pX.get_context(self,i))
     57}}}