Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Your motives for doing whatever good deed you may have in mind will be misinterpreted by somebody.


comp / comp.lang.python / Python told me a Joke

SubjectAuthor
* Python told me a JokeAlan Bawden
+- Re: Python told me a JokeMild Shock
`- Re: Python told me a Joke (Posting On Python-List Prohibited)Lawrence D'Oliveiro

1
Subject: Python told me a Joke
From: Alan Bawden
Newsgroups: comp.lang.python
Organization: ITS Preservation Society
Date: Mon, 2 Sep 2024 07:55 UTC
Path: eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: alan@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.python
Subject: Python told me a Joke
Date: Mon, 02 Sep 2024 03:55:15 -0400
Organization: ITS Preservation Society
Lines: 29
Message-ID: <868qwafq1o.fsf@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Mon, 02 Sep 2024 09:55:21 +0200 (CEST)
Injection-Info: bawden.eternal-september.org; posting-host="211663326ffa3036f3c2b0d6e67aa0dd";
logging-data="2001562"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Ep+NcG+5ITKNkuzgpG0An"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:gyU/tLgjGP5isJAxQ7xEyJJ19MY=
sha1:AsP56DbsZs5ZcQu37nxi6WiDne4=
View all headers

Python 3.10.5 (v3.10.5:f37715, Jul 10 2022, 00:26:17) [GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x,_,z = [1,2,3]

Works as expected.

Now I didn't expect the following to work (but Python sometimes
surprises me!), so I tried:
>>> x,2,z = [1,2,3]
File "<stdin>", line 1
x,2,z = [1,2,3]
^^^^^^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?

Yeah, that makes sense, no surprises today... Except "maybe you meant
'=='..." caught my attention. _Could_ that be what someone would want
in this situation I wondered? So I tried:

>>> x,2,z == [1,2,3]
(1, 2, False)

Now that made me laugh.

- Alan

[ Some people reading this will be tempted to explain what's really
going on here -- it's not hard to understand. But please remember that
a joke is never funny if you have to explain it. ]

Subject: Re: Python told me a Joke
From: Mild Shock
Newsgroups: comp.lang.python
Date: Mon, 2 Sep 2024 08:05 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.python
Subject: Re: Python told me a Joke
Date: Mon, 2 Sep 2024 10:05:30 +0200
Message-ID: <vb3rka$21vqv$1@solani.org>
References: <868qwafq1o.fsf@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 2 Sep 2024 08:05:30 -0000 (UTC)
Injection-Info: solani.org;
logging-data="2162527"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.2
Cancel-Lock: sha1:vRf1Zb11Ln9UTT5dmdGsOIMPuBc=
In-Reply-To: <868qwafq1o.fsf@williamsburg.bawden.org>
X-User-ID: eJwFwYEBwCAIA7CXZgsFz0GU/09Y4tRSh8llPj7aB+Rs5q0MoOBXyAq9s+6qalbg1T14nA6aMrx604Kf4QdOfxUu
View all headers

You can try:

>>> 1,2 == 2,2
(1, True, 2)

Its the same as:

>>> 1, (2 == 2), 2
(1, True, 2)

Hope this helps!

Alan Bawden schrieb:
> Python 3.10.5 (v3.10.5:f37715, Jul 10 2022, 00:26:17) [GCC 4.9.2] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> x,_,z = [1,2,3]
>
> Works as expected.
>
> Now I didn't expect the following to work (but Python sometimes
> surprises me!), so I tried:
>
> >>> x,2,z = [1,2,3]
> File "<stdin>", line 1
> x,2,z = [1,2,3]
> ^^^^^^^^^^^
> SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
>
> Yeah, that makes sense, no surprises today... Except "maybe you meant
> '=='..." caught my attention. _Could_ that be what someone would want
> in this situation I wondered? So I tried:
>
> >>> x,2,z == [1,2,3]
> (1, 2, False)
>
> Now that made me laugh.
>
> - Alan
>
> [ Some people reading this will be tempted to explain what's really
> going on here -- it's not hard to understand. But please remember that
> a joke is never funny if you have to explain it. ]
>

Subject: Re: Python told me a Joke (Posting On Python-List Prohibited)
From: Lawrence D'Oliv
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Mon, 2 Sep 2024 22:01 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: Python told me a Joke (Posting On Python-List Prohibited)
Date: Mon, 2 Sep 2024 22:01:52 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <vb5ckg$30ieg$3@dont-email.me>
References: <868qwafq1o.fsf@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 03 Sep 2024 00:01:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6d8b6590145ff0d1f13101405f5f220c";
logging-data="3164624"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+IPuBHKLNXQJopTlB4d6dd"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:luDY5gBHB48JGidjNhxlZmAgLrI=
View all headers

On Mon, 02 Sep 2024 03:55:15 -0400, Alan Bawden wrote:

> >>> x,2,z == [1,2,3]
> (1, 2, False)

I wondered what was going on, until I realized that the three expressions
making up the restult tuple are

x
2
z == [1, 2, 3]

> [ Some people reading this will be tempted to explain what's really
> going on here -- it's not hard to understand. But please remember
> that a joke is never funny if you have to explain it. ]

Damn. I always found it funny why I could never understand jokes. Now
you’ve told me why, I can never feel that any more ...

1

rocksolid light 0.9.8
clearnet tor