[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Rotzbua


Rotzbua  added the comment:

Thanks for pointing out the logical change from "true" to "True".
I do not want to start a discussion about principles.

Nevertheless I think a change from `platform(aliased=0, terse=0)` to 
`platform(aliased=False, terse=False)` makes the how-to-use more intuitive.

The change does not change any function behavior or breaks any backwards 
compatibilities.

I created a new PR without the change of "true".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Rotzbua


Change by Rotzbua :


--
pull_requests: +29745
pull_request: https://github.com/python/cpython/pull/31621

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

See #46883

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> Both arguments `aliased` and `terse` should be boolean instead of integer.

Why should they be strictly True/False booleans? I disagree strongly that they 
should be. Any object that duck-types as a true or false value is sufficient.

Treated as a documentation change, your PR is wrong because it implies that 
*only* the singletons `True` and `False` are acceptable, when in fact any true 
and false (note the lowercase) values are acceptable.

Personally, I prefer the terms "truthy" and "falsey", or "a true value" and "a 
false value" over a bare true/false, but some people do not, and it is a 
long-standing tradition in Python circles to understand lowercase true/false as 
the duck-typed values as opposed to the `True` and `False` bool singletons.

--
nosy: +steven.daprano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Rotzbua


Change by Rotzbua :


--
keywords: +patch
pull_requests: +29742
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31617

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Rotzbua


New submission from Rotzbua :

Problem:
Both arguments `aliased` and `terse` should be boolean instead of integer.

Description:
The function is as `platform.platform(aliased=0, terse=0)` so both arguments 
`aliased` and `terse` seems to be numbers.
The documentation says: "If aliased is true,[..]" which gives a hint that the 
type should be boolean instead of an integer.
Looking into the implementation both arguments used as boolean.

Solution:
Update documentation and set default argument values to `False` instead of `0`.

Reference:
Current documentation: 
https://docs.python.org/3.11/library/platform.html#platform.platform

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 414198
nosy: Rotzbua, docs@python
priority: normal
severity: normal
status: open
title: Clarify argument type of platform.platform(aliased, terse) to boolean
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com