Skip to content

is_type_mutable returns true for Literal types #343

@gsakkis

Description

@gsakkis

Bug

odmantic.model.is_type_mutable gives wrong result for Literal types.

Current Behavior

In [1]: from odmantic.model import is_type_mutable
In [2]: from typing import Literal

In [3]: is_type_mutable(Literal["x", "y"])
Out[3]: True

Expected behavior

Strings are immutable so the above should return False.

Environment

  • ODMantic version: 0.9.2
  • Pydantic version: 1.10.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions