This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author larry
Recipients giampaolo.rodola, larry, neologix, serhiy.storchaka, vstinner
Date 2012-06-16.00:28:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1339806486.59.0.930356132675.issue15078@psf.upfronthosting.co.za>
In-reply-to
Content
> There are some other functions with strange/variable prototype:
> http://docs.python.org/dev/library/fcntl.html?highlight=ioctl#fcntl.ioctl
> http://docs.python.org/dev/library/mmap.html?highlight=mmap.mmap#mmap.mmap

It does not follow that this behavior is desirable, or that it should be emulated in new code.  There's a lot of legacy code with unexpected API design that would not pass muster were it proposed today.

Consider this: what should the Signature (PEP 362) for fcntl.ioctl look like?


> These Python functions are thin wrapper of the C function,
> that's why their prototype can be surprising.

The "thin wrapper" os.sendfile is 130 lines of C.   Furthermore I disagree with the idea that os does or should contain "thin wrappers".  It strikes me as unbearably provincial thinking among UNIX developers.  Anyone who thinks os contains "thin wrappers" should examine the Windows implementation of stat().

But at the heart of the matter, I see no benefit to exposing Python developers to the idiosyncrasies of poor C API design.  I feel strongly that one way Python becomes "pythonic" is that it aims for the convenience of the programmer--not the language designer and not the implementer.  The Python calling convention is far more flexible than the C calling convention.  We should put it to good use here.
History
Date User Action Args
2012-06-16 00:28:06larrysetrecipients: + larry, vstinner, giampaolo.rodola, neologix, serhiy.storchaka
2012-06-16 00:28:06larrysetmessageid: <1339806486.59.0.930356132675.issue15078@psf.upfronthosting.co.za>
2012-06-16 00:28:06larrylinkissue15078 messages
2012-06-16 00:28:04larrycreate