Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Path or PurePath
#1
i am writing a function that may be given a pathlib Path or PurePath object, or a string, or bytes, or bytearray. the first two are what concerns me. how can i test what it is that the function is getting when called? will a test for Path be True if what i got was really a PurePath? or the reverse? or are they distinctive enough for isinstance() to tell them apart? i don't know,yet, if i do need to tell them apart. this function will be a file tree recursion generator yield Path objects of all types found in the tree. i have already done such a function that yields strings. i want to make this more useable.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
Path or PurePath - by Skaperen - Jul-05-2018, 05:29 AM
RE: Path or PurePath - by buran - Jul-05-2018, 06:33 AM
RE: Path or PurePath - by Skaperen - Jul-06-2018, 02:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,257 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  PurePath.relative_to() fails in 3.6 Skaperen 5 3,605 Oct-18-2019, 06:28 AM
Last Post: DeaD_EyE
  .pth file does not show up in sys.path when configuring path. arjunsingh2908 2 5,836 Jul-03-2018, 11:16 AM
Last Post: arjunsingh2908
  getting a full path string from a pathlib.PurePath object Skaperen 14 142,405 Mar-24-2018, 03:55 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020