[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Марк, thank you for the suggestion, but we've decided to decline the request. -- nosy: +rhettinger resolution: -> rejected status: open -> closed ___ Python tracker

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Guido van Rossum
Guido van Rossum added the comment: I'm also -1. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Марк Коренберг
Марк Коренберг added the comment: Well, I provide the patch, as you can see it is very simple. -- ___ Python tracker ___

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Марк Коренберг
Changes by Марк Коренберг : -- nosy: +gvanrossum ___ Python tracker ___ ___

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Марк Коренберг
Марк Коренберг added the comment: @skrah, what about integers with length not equal to 2 or 4 bytes, and also signed ? -- ___ Python tracker ___

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Марк Коренберг
Марк Коренберг added the comment: 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.

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Stefan Krah
Stefan Krah added the comment: Марк, sorry for all this negativity. ;) But I'm also -1. What is wrong with socket.ntohs() etc.? -- nosy: +skrah ___ Python tracker

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Марк Коренберг
Changes by Марк Коренберг : -- keywords: +patch Added file: http://bugs.python.org/file43978/host_net.patch ___ Python tracker ___

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-07-28 Thread Mark Dickinson
Mark Dickinson added the comment: -1 from me; it feels like a needless expansion of the API. -- ___ Python tracker ___

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-07-28 Thread Марк Коренберг
Марк Коренберг added the comment: 1. Yes 'host' is the same as sys.buteorder 2. Yes, 'net' is the same as 'big' 3. See `struct` module: it have '!' for those who forgot which order is `network`. In most cases (i.e. some protocols or formats) 'network' order is used. 4. Support of new values

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-07-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agreed with Martin. The "host" byte order is sys.byteorder, and the "net" byteorder is just "big". There is one obvious way to specify this, and there is not need to add yet one way. Adding support of new values for byteorder would complicate and slow

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-07-27 Thread Berker Peksag
Berker Peksag added the comment: There is no need to go to python-ideas for this. Adding domain experts to nosy list is enough. -- nosy: +berker.peksag, mark.dickinson, serhiy.storchaka ___ Python tracker

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-07-27 Thread Martin Panter
Martin Panter added the comment: I wouldn’t mind the “host” byte order, assuming it just means use sys.byteorder. I think I have done this a few times, both when I really wanted the native byte order, and when I didn’t care, but assumed the native order might be slightly more efficient (e.g.

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-07-27 Thread Emanuel Barry
Emanuel Barry added the comment: Since this is a new feature addition, this should first go through Python-ideas. However, I don't think that network-related features should go into builtin types, -1 from me. -- nosy: +ebarry ___ Python tracker

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-07-27 Thread Марк Коренберг
Changes by Марк Коренберг : -- components: +Library (Lib) type: -> enhancement versions: +Python 3.6 ___ Python tracker ___

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-07-27 Thread Марк Коренберг
New submission from Марк Коренберг: int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders. I will provide a patch. -- messages: 271490 nosy: mmarkk priority: normal severity: normal status: open title: int.to_bytes() and int.from_bytes() should support 'net'