for -- else: what was the motivation?

Peter J. Holzer hjp-python at hjp.at
Mon Oct 10 15:14:12 EDT 2022


On 2022-10-09 22:38:28 -0400, avi.e.gross at gmail.com wrote:
> [This is an answer for Peter and can easily be skipped by those who know or
> have no wish to.]
> 
> Strictly speaking Peter, the word "pipe" may not mean quite something in
> Python but other concepts like chaining may be better.
> 
> The original use of the word I am used to was at the UNIX shell level where
> an in-core data structure called a pipe was used

To paraphrase Mark Twain, the reports of Unix' death have been greatly
exaggerated.

Unix (or at least its bastard offsprings Linux and OSX) is alive and
well and still has pipes. I use them every day.


> If you have an object with some method you can call on it (or in some cases
> a normal function call) that returns  another (or the same) object, then you
> can write code like:
> 
> This.that.other

Yeah, I thought you might be referring to that. I've just never seen the
term "pipeline" for that construct (I think "method chaining" is
reasonably common).

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp at hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/python-list/attachments/20221010/e7366ded/attachment.sig>


More information about the Python-list mailing list