absolutely, there's no reason str | None shouldn't work also
On Wed, Aug 31, 2022, at 8:26 PM, Peter Schutt wrote:
> Thanks Mike, I will submit at next opportunity.
>
> I believe Union[str, None] is fine, just that pep 604 brought in UnionType in
> 3.10+ which represents the "str | None" union
Thanks Mike, I will submit at next opportunity.
I believe Union[str, None] is fine, just that pep 604 brought in UnionType
in 3.10+ which represents the "str | None" union type, but I'll stick more
detail in the issue.
Not having to import Optional or Union everywhere is one of the nice
On Wed, Aug 31, 2022, at 5:00 AM, Peter Schutt wrote:
> Hi,
>
> I've been using 2.0 from main and notice that annotating an attribute with
> `mapped[str | None]` raises with:
>
> sqlalchemy.exc.ArgumentError: Could not locate SQLAlchemy Core type for
> Python type: str | None
>
>
> I've
Hi,
I've been using 2.0 from main and notice that annotating an attribute with
`mapped[str | None]` raises with:
sqlalchemy.exc.ArgumentError: Could not locate SQLAlchemy Core type for
Python type: str | None
I've been able to get it to work with a couple of mods in util.typing and