Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: - rejected
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20583
___
New submission from Serhiy Storchaka:
Underscored parameters of functions sometimes are used for different purposes.
For example see random.Random.randrange(), subprocess.Popen.__del__() or
codecs.CodecInfo.__new__(). These parameters are not a part of public API and
should be excluded from
R. David Murray added the comment:
This is not universally true. Both namedtuple (for good reason) and email (for
not-so-good reasons) have _ parameters that are part of the public API.
--
nosy: +r.david.murray
___
Python tracker
Serhiy Storchaka added the comment:
They can be explicitly mentioned in docstrings.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20583
___
___
Yury Selivanov added the comment:
I'm -1 on this.
Yes, there is a convention in Python that _names are kind of private, but it's
just a convention, and not everybody follow it. Making this change would just
break too many things.
As for the code in question: Random.randrange -- why does it
Georg Brandl added the comment:
-1 as well.
Yury: it's a micro-optimization, the slow builtin lookup becomes a fast local
lookup.
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20583
Nick Coghlan added the comment:
For context, codecs.CodecInfo now takes an undocumented _is_text_encoding
keyword-only argument to blacklist codecs from TextIOWrapper, str.encode,
bytes.decode etc. Serhiy expressed some concern that users would see that
via Pydoc, believe it was a public API,
Yury Selivanov added the comment:
Yury: it's a micro-optimization, the slow builtin lookup becomes a fast local
lookup.
That's what I thought, thank you.
I think we should discourage use of this pattern (at least in the stdlib).
There is small to no performance benefit to do that.
And if
Serhiy Storchaka added the comment:
Yes, this issue is based on Nick's intention in msg206515.
Since this issue was rejected, my objection against adding new underscored
parameters in issue19619 remain in force.
--
___
Python tracker