I don’t know about aliases specifically, but there are definitely people out there who like to define and use classes in function scope. It is commonly used in test suites, which often define similar structures, where it would be tedious to have to define everything at the global level and pick unique names for things in slightly different test scenarios. I would imagine this could include aliases.
Is there a technical reason to exclude them? Python in general has a philosophy that allows you to combine structures arbitrarily. We allow imports in functions. Why not type aliases?
—Guido
--
--Guido (mobile)