This seems like a fairly terrible idea. -100 from me. Python simply does not tends to chain methods for mutation of objects. A few libraries—e.g. Pandas—do this, but in those cases actual chaining is more idiomatic.
This is very different from '+=' or '*=' or even '|=' where you pretty much expect to wind up with the same type of thing on the binding or mutation. Of course, you can define operators as you like, so it's not hard and fast, but it's usual. I.e. '+=' is unlikely to leave the current number domain, other than according to the regular numeric hierarchy. text = "foo" > text .= replace("foo","bar") > This one example is okay. But most are awful: text .= count('foo') text .= split(';') text .= find('bar') In all of those you jump around among various data types bound to 'text'
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/