24 Apr
2022
24 Apr
'22
7:20 a.m.
On 4/24/2022 5:42 AM, Stephen J. Turnbull wrote:
What's the use case for arbitrary expressions vs. a (possibly qualified) name? A class factory that produces forward declarations? Do you have a use case in mind?
It's: x.py: ------8<-------- forward class A() ------8<-------- x_impl.py ------8<-------- import X continue class X.A: # class body here ------8<-------- It needs to be an expression because it's not defining a name, it referring to an existing name. You could use "from X import A" here and avoid a dotted expression, but it still needs to be an expression referring to an existing "forward class". Even if you restrict it to not having dots, it's logically an expression, not a name binding. Eric