[New-bugs-announce] [issue40578] Deprecate numeric item access for platform.uname()

Jason R. Coombs report at bugs.python.org
Sat May 9 10:06:56 EDT 2020


New submission from Jason R. Coombs <jaraco at jaraco.com>:

In issue40570, I learned that some users are still relying on legacy tuple-like behaviors of `platform.uname()`, namely the access by item position and length:

```
platform.uname()[0]
len(platform.uname())
```

I propose to deprecate these behaviors and constrain the supported interface to the following:

```
platform.uname().attribute
items = tuple(platform.uname())
```

In other words, the `uname_result` would only support access of the items by attribute or iteration of all attributes.

Any users wishing to access items by position or to calculate the length of the result would need to explicitly construct a tuple from the result.

----------
messages: 368517
nosy: jaraco, lemburg
priority: normal
severity: normal
status: open
title: Deprecate numeric item access for platform.uname()
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40578>
_______________________________________


More information about the New-bugs-announce mailing list