Skip to content

Export Color from package __init__.py#373

Merged
yezz123 merged 1 commit intopydantic:mainfrom
bBlazewavE:fix/color-import-init
Mar 3, 2026
Merged

Export Color from package __init__.py#373
yezz123 merged 1 commit intopydantic:mainfrom
bBlazewavE:fix/color-import-init

Conversation

@bBlazewavE
Copy link
Contributor

Summary

Allow from pydantic_extra_types import Color to work directly.

Currently, from pydantic_extra_types import Color raises an ImportError because Color is not exported from __init__.py. Users must use the fully qualified from pydantic_extra_types.color import Color instead.

Changes

  • Added Color import to pydantic_extra_types/__init__.py
  • Added __all__ with Color for explicit public API

Color has no optional dependencies, so it's safe to import at the package level without side effects.

Closes #353

Allow `from pydantic_extra_types import Color` to work directly
instead of requiring `from pydantic_extra_types.color import Color`.

Color has no optional dependencies so it's safe to import at the
package level.

Closes pydantic#353
@yezz123 yezz123 merged commit 496cf00 into pydantic:main Mar 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color import missing in __init__.py ?

2 participants