Skip to content
masterclass Buddy

Pydantic · Type Alias

NewPath

NewPath is a Pydantic type for a new file or directory. The target must not exist, while its parent directory must already exist.

Last updated

Syntax

NewPath = Annotated[Path, PathType('new')]

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Path
  • FilePath
  • DirectoryPath
  • SocketPath
  • PathType

Source: Pydantic Types. Checked 2026-11-03.