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 socketpair
Recipients abarry, berker.peksag, mark.dickinson, martin.panter, serhiy.storchaka, skrah, socketpair
Date 2016-08-02.18:29:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1470162567.5.0.082663493642.issue27638@psf.upfronthosting.co.za>
In-reply-to
Content
1. I forgot to say: since I add new items to `if.. elif...elif.....` chain after testing for 'big' and 'little', this change will not slowdown current external code.
2. Well, slowdown of to_bytes() between 'big' and 'net' on my PC give about 3 percents.
3. to_bytes(2, sys.byteorder) is timed exactly as 'host'.


./python -m timeit -s 'import sys' -n 10000000 '(1234).to_bytes(2, sys.byteorder)' # iteration counter is required to stabilize results.

4. As I think, Python should also be simple and intuitive. If everyone thinks as those, who set (-1) on this issue, we will neve add .to_bytes()/.from_bytes(), since there are already TWO (!) modules to do conversion to/from bytes: `ctypes` (https://docs.python.org/3/library/ctypes.html#ctypes.BigEndianStructure) and `struct`. Answer is: it is unsuitable and not comfort for the programmer. Why not to make really good practical API ?

And also, I want to call @gvanrossum.. I'm disappointed. This change is so obvious thing, that I don't understand how to explain...
History
Date User Action Args
2016-08-02 18:29:27socketpairsetrecipients: + socketpair, mark.dickinson, skrah, berker.peksag, martin.panter, serhiy.storchaka, abarry
2016-08-02 18:29:27socketpairsetmessageid: <1470162567.5.0.082663493642.issue27638@psf.upfronthosting.co.za>
2016-08-02 18:29:27socketpairlinkissue27638 messages
2016-08-02 18:29:27socketpaircreate