pep604 from __future__ import annotations

I read about pep604 on this blog post:

I am trying to get it working in pycharm, but it doesn't seem to work:

from __future__ import annotations

a: str | None = None

This results in an "problem" appearing at the pipe symbol:

Class 'type' does not define '__or__', so the '|' operator cannot be used on its instances

Is this simply not supported in Pycharm or should I tweak some setting somewhere ?

Thanks !



1 comment
Comment actions Permalink



It is not supported yet, please see and vote in order to be updated on resolution. 


I apologize for the inconvenience.


Please sign in to leave a comment.