Skip to content

[Stubs] Fix os.uname return value #740

@microbit-matt-hillsdon

Description

@microbit-matt-hillsdon

We've typed os.uname's return value as a string but it is a richer value with extra detail.

Error in program that runs correctly:

Screenshot 2022-05-11 at 05 47 01 (1)

raised via https://support.microbit.org/a/tickets/53361

REPL:

>>> import os
>>> os.uname()
(sysname='microbit', nodename='microbit', release='2.0.0', version='micro:bit v2.0.0+16d4380 on 2021-10-25; MicroPython 16d4380 on 2021-10-25', machine='micro:bit with nRF52833')
>>> type(os.uname())
<class 'tuple'>
>>> os.uname().version
'micro:bit v2.0.0+16d4380 on 2021-10-25; MicroPython 16d4380 on 2021-10-25'
>>> len(os.uname())
5

Potentially we can use the typeshed version: https://github.com/python/typeshed/blob/master/stdlib/os/__init__.pyi#L450

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions