In reading Python document files, I keep encountering help text like
os.umask(mask, /)
or
nt.is_dir(self, /, *, follow_symlinks=True)
I can't find the meaning of this syntax in any of the Python references. What does this symbolism mean?
In reading Python document files, I keep encountering help text like
os.umask(mask, /)
or
nt.is_dir(self, /, *, follow_symlinks=True)
I can't find the meaning of this syntax in any of the Python references. What does this symbolism mean?
This is the new positional-only parameter syntax introduced in Python 3.8.
No argument before the /
character may be used as a keyword argument.
Using one of your examples:
os.umask(mask, /)
You cannot call os.umask(mask=SOME_MASK)
but you can call os.umask(SOME_MASK)
.
OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality.
os.umask()
method in Python is used to set the current numeric umask value and get the previous umask value.
umask stands for user file-creation mode mask. This is used use to determine the file permission for newly created files or directories.