mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #15164: Change return value of platform.uname() from a
plain tuple to a collections.namedtuple.
This commit is contained in:
parent
56ed2844fa
commit
68386bc0b8
6 changed files with 33 additions and 18 deletions
|
@ -158,14 +158,20 @@ Cross Platform
|
|||
|
||||
.. function:: uname()
|
||||
|
||||
Fairly portable uname interface. Returns a tuple of strings ``(system, node,
|
||||
release, version, machine, processor)`` identifying the underlying platform.
|
||||
Fairly portable uname interface. Returns a :func:`~collections.namedtuple`
|
||||
containing six attributes: :attr:`system`, :attr:`node`, :attr:`release`,
|
||||
:attr:`version`, :attr:`machine`, and :attr:`processor`.
|
||||
|
||||
Note that unlike the :func:`os.uname` function this also returns possible
|
||||
processor information as additional tuple entry.
|
||||
Note that this adds a sixth attribute (:attr:`processor`) not present
|
||||
in the :func:`os.uname` result. Also, the attribute names are different
|
||||
for the first two attributes; :func:`os.uname` names them
|
||||
:attr:`sysname` and :attr:`nodename`.
|
||||
|
||||
Entries which cannot be determined are set to ``''``.
|
||||
|
||||
.. versionchanged:: 3.3
|
||||
Result changed from a tuple to a namedtuple.
|
||||
|
||||
|
||||
Java Platform
|
||||
-------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue