MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _parse_args

Method _parse_args

tools/python-3.11.9-amd64/Lib/pathlib.py:485–502  ·  view source on GitHub ↗
(cls, args)

Source from the content-addressed store, hash-verified

483
484 @classmethod
485 def _parse_args(cls, args):
486 # This is useful when you don't want to create an instance, just
487 # canonicalize some constructor arguments.
488 parts = []
489 for a in args:
490 if isinstance(a, PurePath):
491 parts += a._parts
492 else:
493 a = os.fspath(a)
494 if isinstance(a, str):
495 # Force-cast str subclasses to str (issue #21127)
496 parts.append(str(a))
497 else:
498 raise TypeError(
499 "argument should be a str object or an os.PathLike "
500 "object returning str, not %r"
501 % type(a))
502 return cls._flavour.parse_parts(parts)
503
504 @classmethod
505 def _from_parts(cls, args):

Callers 3

_from_partsMethod · 0.95
_make_childMethod · 0.95
relative_toMethod · 0.95

Calls 4

strFunction · 0.85
parse_partsMethod · 0.80
typeClass · 0.50
appendMethod · 0.45

Tested by

no test coverage detected