pathlib.Path.is_file vs os.path.isfile difference

Albert-Jan Roskam sjeik_appie at hotmail.com
Fri Mar 8 13:03:40 EST 2024


   Hi,
   I was replacing some os.path stuff with Pathlib and I discovered this:
   Path(256 * "x").is_file()  # OSError
   os.path.isfile(256 * "x")  # bool
   Is this intended? Does pathlib try to resemble os.path as closely as
   possible?
   Best wishes,
   Albert-Jan


More information about the Python-list mailing list