How AnyPath instantiation works
masterThe AnyPath constructor follows a specific fallback logic to resolve the input type:
- Cloud Check: It first attempts to pass the input to the
CloudPathbase class constructor. This validates the input against registered concreteCloudPathimplementations (e.g.,S3Pathfors3://prefixes). - Local Fallback: If no cloud implementation matches, it attempts to pass the input to the standard
pathlib.Pathconstructor. - Error Handling: If the
Pathconstructor fails and raises aTypeError,AnyPathwill raise anAnyPathTypeErrorexception.