[issue35007] Minor change to weakref docs

Julien Palard report at bugs.python.org
Fri Oct 26 03:52:27 EDT 2018


Julien Palard <julien+python at palard.fr> added the comment:

In the other end that's true that's an iterable, and that's what's count.

So if we want to change the implementation in the future, we still can, as long as we still return an iterable, it won't break asumptions.

So I'll keep the "iterable" word in the documentation, and it looks OK to me that the docstring tells more about the implementation than the interface, so I'll leave it as is too.

Relying on what you read in the current implementation is relying on an implementation detail that may change in the future, this weakens your code, please just consider it's an iterable?

Anyway the key set of the WeakKeyDictionary can change at any time, according to the actions you're doing while iterating over the keys, so better write solid code here, and be prepred for the worse, don't rely on implementation details.

----------
nosy: +mdk

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35007>
_______________________________________


More information about the Python-bugs-list mailing list