[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.135,1.136

Guido van Rossum guido@digicool.com
Wed, 07 Feb 2001 03:41:47 -0500


> On Tue, Feb 06, 2001 at 02:58:07PM -0800, A.M. Kuchling wrote:
> >!      if (!PyArg_ParseTuple(args, "s|i:write", &data, &len))
> >!      if (!PyArg_ParseTuple(args, "s#|i:write", &data, &len))
> 
> Hm... actually, this patch isn't correct after all.  The |i meant you
> could specify an optional integer to write out only a partial chunk of
> the string; why not just slice it?  Since the SSL code isn't
> documented, I'm tempted to just rip out the |i.

Yes, rip it out.  The old API was poorly designed, and let you do bad
things (e.g. pass a length much larger than len(s)).

--Guido van Rossum (home page: http://www.python.org/~guido/)