-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request config #2949
Merged
Merged
Request config #2949
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a40a5c3
Work on
asvetlov e8fa21c
Work on
asvetlov 901b040
Impmenent RO namespace
asvetlov a73c0af
Add request.config
asvetlov 801419d
Fix py35 tests
asvetlov a31be0f
Fix flake8
asvetlov bea0846
Fix tests
asvetlov f24176c
ChainedProps -> ChainMapProxy
asvetlov f961e25
Fix tests
asvetlov 3b0a79d
Drop config namespace
asvetlov bdebac8
Add changes
asvetlov ad41c79
Drop unused import
asvetlov 7c7193f
Fix tests
asvetlov 0fcff06
Update docs
asvetlov 143bee9
Polish docs
asvetlov 87f1fe4
Fix spelling
asvetlov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add ``request.config_dict`` for exposing nested applications data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
.. _aiohttp-structures: | ||
|
||
|
||
Common data structures | ||
====================== | ||
|
||
.. module:: aiohttp | ||
|
||
.. currentmodule:: aiohttp | ||
|
||
|
||
Common data structures used by *aiohttp* internally. | ||
|
||
|
||
FrozenList | ||
---------- | ||
|
||
A list-like structure which implements | ||
:class:`collections.abc.MutableSequence`. | ||
|
||
The list is *mutable* unless :meth:`FrozenList.freeze` is called, | ||
after that the list modification raises :exc:`RuntimeError`. | ||
|
||
|
||
.. class:: FrozenList(items) | ||
|
||
Construct a new *non-frozen* list from *items* iterable. | ||
|
||
The list implements all :class:`collections.abc.MutableSequence` | ||
methods plus two additional APIs. | ||
|
||
.. attribute:: frozen | ||
|
||
A read-only property, ``True`` is the list is *frozen* | ||
(modifications are forbidden). | ||
|
||
.. method:: freeze() | ||
|
||
Freeze the list. There is no way to *thaw* it back. | ||
|
||
|
||
ChainMapProxy | ||
------------- | ||
|
||
An *immutable* version of :class:`collections.ChainMap`. Internally | ||
the proxy is a list of mappings (dictionaries), if the requested key | ||
is not present in the first mapping the second is looked up and so on. | ||
|
||
The class supports :class:`collections.abc.Mapping` interface. | ||
|
||
.. class:: ChainMapProxy(maps) | ||
|
||
Create a new chained mapping proxy from a list of mappings (*maps*). | ||
|
||
.. versionadded:: 3.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like you can have there the same
iter(set().union(*self._maps))
instead of another dict construction.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did copy
collections.ChainMap
without careful thinking :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep it for sake of shared implementation with
ChainMap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iteration is not the most common call,
get
/__getitem__
doesn't create a dict.Moreover your proposal constructs a set, not sure what is better.