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

Liste des GroupesRevenir à cl python 
Sujet : Re: pathlib.Path.is_file vs os.path.isfile difference
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.python
Date : 08. Mar 2024, 19:19:04
Autres entêtes
Organisation : Stefan Ram
Message-ID : <pathlibg-20240308191110@ram.dialup.fu-berlin.de>
References : 1
Albert-Jan Roskam <sjeik_appie@hotmail.com> wrote or quoted:
Path(256 * "x").is_file()  # OSError
os.path.isfile(256 * "x")  # bool
Is this intended?

  When something is documented and behaves accordingly,
  we assume it was intended.

Does pathlib try to resemble os.path as closely as possible?

  No.

  The definition of "isfile" contains:

|except (OSError, ValueError):
|    return False

Date Sujet#  Auteur
8 Mar 24 o Re: pathlib.Path.is_file vs os.path.isfile difference1Stefan Ram

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal