Re: [Python-Dev] [Python-checkins] cpython: Issue #14127: Add ns= parameter to utime, futimes, and lutimes.

2012-05-04 Thread Benjamin Peterson
2012/5/4 Larry Hastings : > +    if (times && (times != Py_None)) { > > Conditions in parenthesis like this is not style. > > > Can you point me to where this is described in PEP 7?  I can't find it. It's not explicitly stated, but there is the following nice example: if (type->tp_dictoffset != 0

Re: [Python-Dev] [Python-checkins] cpython: Issue #14127: Add ns= parameter to utime, futimes, and lutimes.

2012-05-04 Thread Greg Ewing
Larry Hastings wrote: On 05/03/2012 10:07 PM, Benjamin Peterson wrote: +if (times && ns) { +PyErr_Format(PyExc_RuntimeError, Why not a ValueError or TypeError? Well it's certainly not a TypeError. TypeError is not just for values of the wrong type, it's also used for passing

Re: [Python-Dev] [Python-checkins] cpython: Issue #14127: Add ns= parameter to utime, futimes, and lutimes.

2012-05-04 Thread Stefan Krah
Larry Hastings wrote: > On 05/03/2012 10:07 PM, Benjamin Peterson wrote: > > +if (times && ns) { > +PyErr_Format(PyExc_RuntimeError, > > Why not a ValueError or TypeError? > > > Well it's certainly not a TypeError. The 3.2 documentation defines TypeError > as:

Re: [Python-Dev] [Python-checkins] cpython: Issue #14127: Add ns= parameter to utime, futimes, and lutimes.

2012-05-04 Thread Georg Brandl
On 05/04/2012 08:04 AM, Larry Hastings wrote: > > On 05/03/2012 10:07 PM, Benjamin Peterson wrote: >>> +if (times && ns) { >>> +PyErr_Format(PyExc_RuntimeError, >> Why not a ValueError or TypeError? > > Well it's certainly not a TypeError. The 3.2 documentation defines TypeError > a

Re: [Python-Dev] [Python-checkins] cpython: Issue #14127: Add ns= parameter to utime, futimes, and lutimes.

2012-05-03 Thread Nick Coghlan
On Fri, May 4, 2012 at 4:04 PM, Larry Hastings wrote: > Finally, I appreciate the feedback, but... why post it to python-dev?  You > could have sent me private email, or posted to the issue (#14127), the > latter of which would have enabled using rich chocolaty Rietveld.  I've seen > a bunch of co

Re: [Python-Dev] [Python-checkins] cpython: Issue #14127: Add ns= parameter to utime, futimes, and lutimes.

2012-05-03 Thread Larry Hastings
On 05/03/2012 10:07 PM, Benjamin Peterson wrote: +if (times&& ns) { +PyErr_Format(PyExc_RuntimeError, Why not a ValueError or TypeError? Well it's certainly not a TypeError. The 3.2 documentation defines TypeError as: Raised when an operation or function is applied to an o

Re: [Python-Dev] [Python-checkins] cpython: Issue #14127: Add ns= parameter to utime, futimes, and lutimes.

2012-05-03 Thread Benjamin Peterson
2012/5/3 larry.hastings : > diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c > --- a/Modules/posixmodule.c > +++ b/Modules/posixmodule.c > @@ -3572,28 +3572,194 @@ >  #endif /* HAVE_UNAME */ > > > +static int > +split_py_long_to_s_and_ns(PyObject *py_long, time_t *s, long *ns) > +{ > +