Best way to check if there is internet?

Chris Angelico rosuav at gmail.com
Fri Feb 25 16:23:44 EST 2022


On Sat, 26 Feb 2022 at 07:32, <2QdxY4RzWzUUiLuE at potatochowder.com> wrote:
>
> On 2022-02-25 at 13:48:32 -0600,
> "Michael F. Stemper" <michael.stemper at gmail.com> wrote:
>
> > On 25/02/2022 12.07, Abdur-Rahmaan Janhangeer wrote:
>
> > > I have been following language feature proposals from various
> > > languages. Some decide to avoid Python's route, but others have been
> > > trying hard to catch up with Python.  One gleaming example is the
> > > switch case. JS recently proposed pattern matching, referencing
> > > Python and explaining why the proposal is a cool treatment of the
> > > usecase.
>
> > I'm not clear on what you mean here. JavaScript has had a switch/case
> > construct since 1.2, in the late 1990s. As far as I can determine,
> > python has no such thing, since PEP-3103 was rejected in 2007.
>
> Python has a relatively new (as of version 3.10) "match" statement:
>
>     https://docs.python.org/3/reference/compound_stmts.html#the-match-statement

Every language learns from every other. Python has learned from
JavaScript too. Both languages have learned from Haskell. Pike has
learned from Python; and Python has learned from Pike. Nearly every
language learns from C and Smalltalk (sometimes indirectly). Of
course, not everything that is learned is copied - sometimes what you
learn is "let's not do it that way".

Python's match statement is not a switch/case block, and if JS is
borrowing the idea, then that's strong evidence that, even with
switch/case, match/case is a valuable addition. They behave very
differently in usage.

ChrisA


More information about the Python-list mailing list