Skip to content

Commit 244edbc

Browse files
committed
os: Add namedtuple os.stat return matching cpython.
1 parent 619c593 commit 244edbc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

python-stdlib/os/os/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1+
import uos
12
from uos import *
3+
from collections import namedtuple
4+
5+
# https://docs.python.org/3/library/os.html#os.stat_result
6+
stat_result = namedtuple("stat_result", ("st_mode", "st_ino", "st_dev", "st_nlink", "st_uid", "st_gid", "st_size", "st_atime", "st_mtime", "st_ctime"))
7+
8+
9+
def stat(path):
10+
return stat_result(*uos.stat(path))

0 commit comments

Comments
 (0)