[Patches] [ python-Patches-652930 ] math.log(x [,base])

noreply@sourceforge.net noreply@sourceforge.net
Fri, 13 Dec 2002 07:24:53 -0800


Patches item #652930, was opened at 2002-12-12 16:26
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=652930&group_id=5470

Category: Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Raymond Hettinger (rhettinger)
Assigned to: Nobody/Anonymous (nobody)
Summary: math.log(x [,base])

Initial Comment:
Added an optional base argument to math.log().

Inspired by a request to help@python.org.


----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2002-12-13 10:24

Message:
Logged In: YES 
user_id=80475

Revised patch attached.

* Now, only one call to ParseTuple
* Used PyTuple_New instead of Py_BuildValue
* Added \versionchanged{} mark-up

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-12-13 05:55

Message:
Logged In: YES 
user_id=21627

I think you should avoid the triple calls to ParseTuple, and 
the intermediate BuildValue call. AFAICT, the ParseTuple in 
loghelper can *only* fail if there is not exactly one argument 
(since it won't care about its type); atleast for log, you made 
it impossible that the argument count is incorrect. For log10, 
making the function a METH_O can do that test.

Building a tuple from an object with BuildValue also seems 
overkill, using PyTuple_New is just as simple.

Please use the \versionchanged (or \versionadded) markup to 
document that the parameter is new to 2.3.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=652930&group_id=5470