<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Objects/complexobject.c, branch v2.2.1</title>
<subtitle>Python interpreter</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Objects/complexobject.c?h=v2.2.1</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Objects/complexobject.c?h=v2.2.1'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2002-03-25T13:21:41Z</updated>
<entry>
<title>backport tim_one's checkin of</title>
<updated>2002-03-25T13:21:41Z</updated>
<author>
<name>Michael W. Hudson</name>
<email>mwh@python.net</email>
</author>
<published>2002-03-25T13:21:41Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=e99c99389c582b08a648d7f17823b2cce74e8842'/>
<id>urn:sha1:e99c99389c582b08a648d7f17823b2cce74e8842</id>
<content type='text'>
    revision 2.55 of complexobject.c

SF bug 533198:  Complex power underflow raises exception.
Konrad was too kind.  Not only did it raise an exception, the specific
exception it raised made no sense.  These are old bugs in complex_pow()
and friends:

1. Raising 0 to a negative power isn't a range error, it's a domain
   error, so changed c_pow() to set errno to EDOM in that case instead
   of ERANGE.

2. Changed complex_pow() to:

A. Used the Py_ADJUST_ERANGE2 macro to try to clear errno of a spurious
   ERANGE error due to underflow in the libm pow() called by c_pow().

B. Produced different exceptions depending on the errno value:
   i) For errno==EDOM, raise ZeroDivisionError instead of ValueError.
      This is for consistency with the non-complex cases 0.0**-2 and
      0**-2 and 0L**-2.
   ii) For errno==ERANGE, raise OverflowError.

Bugfix candidate.
</content>
</entry>
<entry>
<title>backport gvanrossum's checkin of</title>
<updated>2002-02-22T13:23:33Z</updated>
<author>
<name>Michael W. Hudson</name>
<email>mwh@python.net</email>
</author>
<published>2002-02-22T13:23:33Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=03474c5c5da180a91391b2284f77089eb976f580'/>
<id>urn:sha1:03474c5c5da180a91391b2284f77089eb976f580</id>
<content type='text'>
    revision 2.54 of complexobject.c

Declare real and imag as read-only attributes.

This fixes SF bug #514858 (Gregory Smith): complex not entirely
immutable

2.2.1 Bugfix candidate!
</content>
</entry>
<entry>
<title>Ensure that complex() only accepts a string argument as the first arg,</title>
<updated>2001-12-13T19:52:22Z</updated>
<author>
<name>Fred Drake</name>
<email>fdrake@acm.org</email>
</author>
<published>2001-12-13T19:52:22Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=526c7a0101d826fdab8b1ef5a757e1eae351687c'/>
<id>urn:sha1:526c7a0101d826fdab8b1ef5a757e1eae351687c</id>
<content type='text'>
and only if there is no second arg.
This closes SF patch #479551.
</content>
</entry>
<entry>
<title>complex_to_buf(), complex_subtype_from_c_complex(): Conversion of</title>
<updated>2001-11-28T20:50:56Z</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2001-11-28T20:50:56Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=01d697a06711d9070c459bc9f1028dd0abc79fab'/>
<id>urn:sha1:01d697a06711d9070c459bc9f1028dd0abc79fab</id>
<content type='text'>
sprintf() to PyOS_snprintf() for buffer overrun avoidance.

complex_print(), complex_repr(), complex_str(): Call complex_to_buf()
passing in sizeof(buf).
</content>
</entry>
<entry>
<title>complex_subtype_from_string(): move the declaration of s_buffer[] out</title>
<updated>2001-10-25T18:07:22Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-10-25T18:07:22Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=70e368836421a2e8c08dbd043a1540ad56d7ae5c'/>
<id>urn:sha1:70e368836421a2e8c08dbd043a1540ad56d7ae5c</id>
<content type='text'>
of the if block where it was before.  The name is only used inside
that if block, but the storage is referenced outside it via the 's'
variable.

(This patch was part of SF patch #474590 -- RISC OS support.)
</content>
</entry>
<entry>
<title>Enable GC for new-style instances.  This touches lots of files, since</title>
<updated>2001-10-05T20:51:39Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-10-05T20:51:39Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=9475a2310d9cdec4b4c36dee8bf30c72605ae928'/>
<id>urn:sha1:9475a2310d9cdec4b4c36dee8bf30c72605ae928</id>
<content type='text'>
many types were subclassable but had a xxx_dealloc function that
called PyObject_DEL(self) directly instead of deferring to
self-&gt;ob_type-&gt;tp_free(self).  It is permissible to set tp_free in the
type object directly to _PyObject_Del, for non-GC types, or to
_PyObject_GC_Del, for GC types.  Still, PyObject_DEL was a tad faster,
so I'm fearing that our pystone rating is going down again.  I'm not
sure if doing something like

void xxx_dealloc(PyObject *self)
{
	if (PyXxxCheckExact(self))
		PyObject_DEL(self);
	else
		self-&gt;ob_type-&gt;tp_free(self);
}

is any faster than always calling the else branch, so I haven't
attempted that -- however those types whose own dealloc is fancier
(int, float, unicode) do use this pattern.
</content>
</entry>
<entry>
<title>Merge branch changes (coercion, rich comparisons) into trunk.</title>
<updated>2001-09-27T20:30:07Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-09-27T20:30:07Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=2ed6bf87c9ce5d2e8a0eb33f7aa6503196205a0c'/>
<id>urn:sha1:2ed6bf87c9ce5d2e8a0eb33f7aa6503196205a0c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Do the same thing to complex that I did to str: the rich comparison</title>
<updated>2001-09-24T17:52:04Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-09-24T17:52:04Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=2205642fe0af9c00bbfa713dae1c8ba4562d2236'/>
<id>urn:sha1:2205642fe0af9c00bbfa713dae1c8ba4562d2236</id>
<content type='text'>
function returns NotImplemented when comparing objects whose
tp_richcompare slot is not itself.
</content>
</entry>
<entry>
<title>Add optional docstrings to member descriptors.  For backwards</title>
<updated>2001-09-20T20:46:19Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-09-20T20:46:19Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=6f7993765ac0989b5d13084240797913627a31d8'/>
<id>urn:sha1:6f7993765ac0989b5d13084240797913627a31d8</id>
<content type='text'>
compatibility, this required all places where an array of "struct
memberlist" structures was declared that is referenced from a type's
tp_members slot to change the type of the structure to PyMemberDef;
"struct memberlist" is now only used by old code that still calls
PyMember_Get/Set.  The code in PyObject_GenericGetAttr/SetAttr now
calls the new APIs PyMember_GetOne/SetOne, which take a PyMemberDef
argument.

As examples, I added actual docstrings to the attributes of a few
types: file, complex, instance method, super, and xxsubtype.spamlist.

Also converted the symtable to new style getattr.
</content>
</entry>
<entry>
<title>complex_coerce(): add explicit PyComplex_Check() test.  Previously,</title>
<updated>2001-09-19T01:13:10Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-09-19T01:13:10Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=638059603ca96a1e9b6d05f4d5c51a06a17b63ec'/>
<id>urn:sha1:638059603ca96a1e9b6d05f4d5c51a06a17b63ec</id>
<content type='text'>
complex_coerce() would never be called with a complex argument,
because PyNumber_Coerce[Ex] doesn't bother calling the type's coercion
method if the values already have the same type.  But now, of course,
it's possible to pass an instance of a complex *subtype*, and those
must be accepted.
</content>
</entry>
</feed>
