[issue30619] typing.Union doc incoherence in case a class and its subclass are present

2017-06-22 Thread khyox

Changes by khyox :


--
pull_requests: +2375

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



[issue30619] typing.Union doc incoherence in case a class and its subclass are present

2017-06-09 Thread khyox

New submission from khyox:

In https://docs.python.org/3.6/library/typing.html#typing.Union, when giving 
details for Union and in the case when a class and its subclass are present, 
the doc states:

When a class and its subclass are present, the former is skipped, e.g.:

Union[int, object] == object

But it is the example (and not the text) which is consistent with PEP 483:

Corollary: Union[..., object, ...] returns object

So, the proposed correction would be substitute 'former' for 'latter':

When a class and its subclass are present, the latter is skipped, e.g.:

Union[int, object] == object

--
assignee: docs@python
components: Documentation
messages: 295593
nosy: docs@python, khyox
priority: normal
severity: normal
status: open
title: typing.Union doc incoherence in case a class and its subclass are present
versions: Python 3.5, Python 3.6

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



[issue26094] ConfigParser.get() doc to be updated according to the configparser.py header doc

2016-01-12 Thread khyox

New submission from khyox:

For the sake of clarity, in 
https://docs.python.org/3.5/library/configparser.html#configparser.ConfigParser 
the ConfigParser.get() method doc could be properly updated with merging the 
information written in the header doc of the source file, as found in 
https://hg.python.org/cpython/file/3.5/Lib/configparser.py

Concretely, this sentence there, "Return a string value for the named option." 
could be considered quite relevant to be added to the doc of the method, as 
some packages are (incorrectly) expecting boolean values returned by the 
ConfigParser.get() method. The reality is that a "True" in the configuration 
file is returning the string "True" and not the boolean constant True.

To sum up, the suggested update would be:

def get(self, section, option, *, raw=False, vars=None, fallback=_UNSET):
"""Returns a string value for the named option for a given section.

If `vars' is provided, it must be a dictionary. The option is looked up
in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
If the key is not found and `fallback' is provided, it is used as
a fallback value. `None' can be provided as a `fallback' value.

If interpolation is enabled and the optional argument `raw' is False,
all interpolations are expanded in the return values.

Arguments `raw', `vars', and `fallback' are keyword only.

The section DEFAULT is special.
"""
(...)

--
assignee: docs@python
components: Documentation
messages: 258124
nosy: docs@python, khyox
priority: normal
severity: normal
status: open
title: ConfigParser.get() doc to be updated according to the configparser.py 
header doc
type: enhancement
versions: Python 3.5, Python 3.6

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