Hello, Some time ago we discussed with Steven D'Aprano how "const" annotation would be combined with other annotations: https://mail.python.org/archives/list/[email protected]/message/SQTOWJ6U5SGNXOOXZB53KBTK7O5MKMMZ/
I mentioned that while current way is to use `typing.Annotated`: spam: Annotated[Widget, const] = build_widget(*args) , it looks ugly, and we can shoot for better. I proposed to use "&" to combine annotations: spam: Widget & const = build_widget(*args) Today I came by another new proglingo, https://flix.dev/ , which uses Python-ish syntax and just very this idea, e.g.: /// We can also declare an impure function. def printAndInc(x: Int): Int & Impure = Console.printLine("Hello"); x + 1 It's always helpful to look at some idea "from outside". And well, I'm sold on it! (As if I wasn't before.) -- Best regards, Paul mailto:[email protected] _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/DGJPAVZPZGDATY7KYY5HFJ7P4AKTUSVU/ Code of Conduct: http://python.org/psf/codeofconduct/
