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.

classification
Title: why not use the same style func name. eg: int.to_bytes (with underline) and array.tobytes(without underline).
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, zaazbb
Priority: normal Keywords:

Created on 2017-05-22 07:58 by zaazbb, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg294127 - (view) Author: zaazbb (zaazbb) Date: 2017-05-22 07:58
I note that, some functions have different style names, some have underline, and some not. why do so??

eg:
int.to_bytes()  and array.tobytes()
int.from_byte() and array.frombytes()
ZipInfo.from_file() and array.fromfile()
...
msg294144 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2017-05-22 12:38
There's no particular reason, we just weren't careful about enforcing a consistent style, especially on older code.

But whatever the reason, it's now too late to change this.
msg294213 - (view) Author: zaazbb (zaazbb) Date: 2017-05-23 03:02
how about add a unitive style function name, for a compatibility reason, keep the old function exists also.

for example, add int.tobytes(), and keep int.to_bytes() exists.
msg294214 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2017-05-23 03:07
We won't do that, because then we'd have two functions that do the same thing. There's no sense having to learn two functions, just to achieve consistency. Sorry.
History
Date User Action Args
2022-04-11 14:58:46adminsetgithub: 74611
2017-05-23 03:07:47eric.smithsetmessages: + msg294214
2017-05-23 03:02:23zaazbbsetmessages: + msg294213
2017-05-22 12:38:19eric.smithsetstatus: open -> closed

nosy: + eric.smith
messages: + msg294144

resolution: wont fix
stage: resolved
2017-05-22 08:05:38zaazbbsettitle: why not use the same style func name. eg: int.to_bytes (with underline or not) and array.tobytes(). -> why not use the same style func name. eg: int.to_bytes (with underline) and array.tobytes(without underline).
2017-05-22 07:58:58zaazbbcreate