On 2025-12-29 14:32:52 +0200, Schimon Jehudah via Python-list wrote:
> This is also so with "import".
> 
> VARIABLE.import

And "from" and many others.

Not all keywords, though. Newer keywords are "soft". They are only
recognized as keywords if they appear in a position where they actually
make sense.

So you can write something like:

#!/usr/bin/python3

match = 1
print(match)

match match:
    case 0:
        print("zero")
    case 1:
        print("one")
    case _:
        print("many")

(not that you should).


        hjp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | [email protected]         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment: signature.asc
Description: PGP signature

-- 
https://mail.python.org/mailman3//lists/python-list.python.org

Reply via email to