Bug report
Bug description:
With PEP 696 + PEP 749, the following works just fine:
class Scalar[CompatT, TruthT = BoolScalar]: ...
class BoolScalar(Scalar): ...
class IntScalar(Scalar[int]): ... # OK ✅️
However, if we switch around the order of definition, the code breaks:
class Scalar[CompatT, TruthT = BoolScalar]: ...
class IntScalar(Scalar[int]): ... # ❌️ NameError: name 'BoolScalar' is not defined
class BoolScalar(Scalar): ...
I guess since the default gets evaluated here. Not sure whether this is a bug or feature request, but it would be nice if the evaluation of the default could be deferred in is case as well.
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Bug report
Bug description:
With PEP 696 + PEP 749, the following works just fine:
However, if we switch around the order of definition, the code breaks:
I guess since the default gets evaluated here. Not sure whether this is a bug or feature request, but it would be nice if the evaluation of the default could be deferred in is case as well.
CPython versions tested on:
3.14
Operating systems tested on:
Linux