diff options
| author | dherrada <dylan.herrada@adafruit.com> | 2020-07-03 15:18:44 -0400 |
|---|---|---|
| committer | dherrada <dylan.herrada@adafruit.com> | 2020-07-03 15:18:44 -0400 |
| commit | e237dfe3c5dc455c2236e530e4d64438c7c52a18 (patch) | |
| tree | 703e1c537d51dbd98bc38deb3d7fd2f26b4f520d /shared-bindings | |
| parent | aaa550b33e7f9e7068deb60d1864f5bab00fb06f (diff) | |
Added type hints to os
Diffstat (limited to 'shared-bindings')
| -rw-r--r-- | shared-bindings/os/__init__.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index 4e991d089..268bf345e 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -44,7 +44,7 @@ //| other way around.""" //| -//| def uname() -> Any: +//| def uname() -> tuple: //| """Returns a named tuple of operating specific and CircuitPython port //| specific information.""" //| ... @@ -54,7 +54,7 @@ STATIC mp_obj_t os_uname(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_uname_obj, os_uname); -//| def chdir(path: Any) -> Any: +//| def chdir(path: string) -> None: //| """Change current directory.""" //| ... //| @@ -65,7 +65,7 @@ mp_obj_t os_chdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_chdir_obj, os_chdir); -//| def getcwd() -> Any: +//| def getcwd() -> string: //| """Get the current directory.""" //| ... //| @@ -74,7 +74,7 @@ mp_obj_t os_getcwd(void) { } MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd); -//| def listdir(dir: Any) -> Any: +//| def listdir(dir: string) -> string: //| """With no argument, list the current directory. Otherwise list the given directory.""" //| ... //| @@ -89,7 +89,7 @@ mp_obj_t os_listdir(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(os_listdir_obj, 0, 1, os_listdir); -//| def mkdir(path: Any) -> Any: +//| def mkdir(path: string) -> None: //| """Create a new directory.""" //| ... //| @@ -100,7 +100,7 @@ mp_obj_t os_mkdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_mkdir_obj, os_mkdir); -//| def remove(path: Any) -> Any: +//| def remove(path: string) -> None: //| """Remove a file.""" //| ... //| @@ -111,7 +111,7 @@ mp_obj_t os_remove(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_remove_obj, os_remove); -//| def rmdir(path: Any) -> Any: +//| def rmdir(path: string) -> None: //| """Remove a directory.""" //| ... //| @@ -123,7 +123,7 @@ mp_obj_t os_rename(mp_obj_t old_path_in, mp_obj_t new_path_in) { } MP_DEFINE_CONST_FUN_OBJ_2(os_rename_obj, os_rename); -//| def rename(old_path: Any, new_path: Any) -> Any: +//| def rename(old_path: string, new_path: string) -> string: //| """Rename a file.""" //| ... //| @@ -134,7 +134,7 @@ mp_obj_t os_rmdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_rmdir_obj, os_rmdir); -//| def stat(path: Any) -> Any: +//| def stat(path: string) -> string: //| """Get the status of a file or directory. //| //| .. note:: On builds without long integers, the number of seconds @@ -149,7 +149,7 @@ mp_obj_t os_stat(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_stat_obj, os_stat); -//| def statvfs(path: Any) -> Any: +//| def statvfs(path: string) -> Tuple[string, string, string, string, string, string, string, string, string, string]: //| """Get the status of a fileystem. //| //| Returns a tuple with the filesystem information in the following order: @@ -176,7 +176,7 @@ mp_obj_t os_statvfs(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_statvfs_obj, os_statvfs); -//| def sync() -> Any: +//| def sync() -> None: //| """Sync all filesystems.""" //| ... //| @@ -189,7 +189,7 @@ STATIC mp_obj_t os_sync(void) { } MP_DEFINE_CONST_FUN_OBJ_0(os_sync_obj, os_sync); -//| def urandom(size: Any) -> Any: +//| def urandom(size: int) -> string: //| """Returns a string of *size* random bytes based on a hardware True Random //| Number Generator. When not available, it will raise a NotImplementedError.""" //| ... |
