[issue35700] Place, Pack and Grid should return the widget

Josh Rosenberg report at bugs.python.org
Wed Jan 9 12:47:24 EST 2019


Josh Rosenberg <shadowranger+python at gmail.com> added the comment:

Closing as rejected; to my knowledge, *no* built-in Python method both mutate an object and returns the object just mutated, precisely because:

1. It allows for chaining that leads fairly quickly to unreadable code (Python is not Perl/Ruby)

2. It creates doubt as to whether the original object was mutated or not (if list.sort returns a sorted list, it becomes unclear as to whether the original list was sorted as well, or whether a new list was returned; sortedlist = unsortedlist.sort() might give an inaccurate impression of what was going on). Zachary's example of using top-level functions to do the work instead is basically the same practicality compromise that sorted makes in relation to list.sort.

----------
nosy: +josh.r
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list