Python Forum
using dir_fd=None in some functions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using dir_fd=None in some functions
#1
in The Python Library Reference i see this:
Output:
You can check whether or not dir_fd is supported on your platform using os.supports_dir_fd. If it is unavailable, using it will raise a NotImplementedError.
my question is, does specifying dir_fd=None count as not using it? or must that option name really need to be absent to count as not using it?

i am creating a function the will be passed a path and could use a keyword option dir_fd. i am wondering if is is OK to default it to None and just pass its value along to os.lstat(...,dir_fd=dir_fd,...) or do i need to be more elaborate to handle these cases in a portable way, such as calling os.lstat() in two different ways.
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
using dir_fd=None in some functions - by Skaperen - Jun-13-2024, 11:33 PM

Forum Jump:

User Panel Messages

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