Skip to content

Provide a better way to allow static type-narrowing for the UPath constructor #446

Open

Description

@ap--

Currently it seems all python type-checkers seem to have some limitation regarding either __new__ overloads or type.__call__ overloads.

see: #435

This issue tracks if we can come up with a better way to overload the constructor thats supported by all typecheckers.

xref / blocked-by:

Activity

  1. ap-- commented on Oct 16, 2025

    @ap--
    CollaboratorAuthor

    There are two ways right now to get IDE autocompletion and suggestions for storage_options:

    1. use the correct upath subclass directly
      Image

    2. use upath.registry.get_upath_class to narrow to the right class on protocol
      Image

  2. ap-- commented on Apr 9, 2026

    @ap--
    CollaboratorAuthor

    I should revisit this. ty now has support for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions