[issue37779] configparser: add documentation about several read() behaviour

2020-12-24 Thread Stéphane Blondon

Stéphane Blondon  added the comment:

Merged by Łukasz Langa in september 2020.
(Thanks Łukasz)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue37779] configparser: add documentation about several read() behaviour

2020-09-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 48b0b1b121f26f811265f9eb06f195a3df38ef4b by sblondon in branch 
'master':
bpo-37779 : Add information about the overriding behavior of ConfigParser.read 
(GH-15177)
https://github.com/python/cpython/commit/48b0b1b121f26f811265f9eb06f195a3df38ef4b


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue37779] configparser: add documentation about several read() behaviour

2019-08-08 Thread Stéphane Blondon

Stéphane Blondon  added the comment:

Thank you for the idea. :)

I committed something else, based on the previous example of the 'Quick Start' 
section.

What do you think about it?

--

___
Python tracker 

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



[issue37779] configparser: add documentation about several read() behaviour

2019-08-08 Thread Stéphane Blondon

Change by Stéphane Blondon :


--
keywords: +patch
pull_requests: +14908
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/15177

___
Python tracker 

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



[issue37779] configparser: add documentation about several read() behaviour

2019-08-07 Thread Joannah Nanjekye

Joannah Nanjekye  added the comment:

I think you can build on the story in the quick start section.

You can build on from the last section that starts with the paragraph:

Now that we have created and saved a configuration file, let’s read it back and 
explore the data it holds.

As it has some examples on read().

--

___
Python tracker 

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



[issue37779] configparser: add documentation about several read() behaviour

2019-08-07 Thread Joannah Nanjekye

Joannah Nanjekye  added the comment:

@Stéphane, thanks for suggesting the above documentation.

Feel free to open a pull request here: https://github.com/python/cpython with 
this draft for review.

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue37779] configparser: add documentation about several read() behaviour

2019-08-07 Thread SilentGhost


Change by SilentGhost :


--
components: +Cross-Build -Library (Lib)
nosy: +Alex.Willmer
stage:  -> needs patch
type: enhancement -> behavior
versions: +Python 3.8

___
Python tracker 

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



[issue37779] configparser: add documentation about several read() behaviour

2019-08-07 Thread SilentGhost


Change by SilentGhost :


--
assignee:  -> docs@python
components: +Documentation -Cross-Build
nosy: +docs@python -Alex.Willmer

___
Python tracker 

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



[issue37779] configparser: add documentation about several read() behaviour

2019-08-06 Thread Stéphane Blondon

New submission from Stéphane Blondon :

The documentation is not explicit about the behaviour if several files are read 
by the same ConfigParser: the data are not reset between two read().

I suggest to add such information in the documentation. There is a draft:

=== start ===
When a `ConfigParser` instance make several calls of `read_file()`, 
`read_string()` or `read_dict()` functions, the previous data will be overriden 
by the new ones. Otherwise, the previous data is kept. This behaviour is 
equivalent to a `read()` call with several files passed to `filenames` 
parameter`.

Example:
config = configparser.ConfigParser()
s = """
[spam]
alpha=1
"""
config.read_string(s)
# dict(config["spam"]) == {'alpha': '1'}
config.read_string("")
# dict(config["spam"]) == {'alpha': '1'}
=== end ===

What do you think about it?
I can do a PR but I wonder where is the best location in the documentation to 
insert it.

At the end of the 'Quick start paragraph' 
(https://docs.python.org/3/library/configparser.html#quick-start)? Or perhaps a 
new paragraph after 'Fallback Values'? Other location?

--
components: Library (Lib)
messages: 349133
nosy: sblondon
priority: normal
severity: normal
status: open
title: configparser: add documentation about several read() behaviour
type: enhancement
versions: Python 3.9

___
Python tracker 

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