This file contains hidden or 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
""" A proposal for yet another pipe decorator | |
I'm still missing a nice way to do method chaining in python. | |
I'd like to have something like `func_a() | func_b()` as a syntax and I'm quite | |
aware that there are some "pipe" libraries on pypi like `pipe` or `pipe21` that | |
offer such functionality. | |
But what I don't like is, that the result of `func_a` (in the example above) is | |
piped directly as the first argument to `func_b`. |
This file contains hidden or 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
{ | |
"python.pythonPath": "C:\\ProgramData\\Anaconda3\\python.exe", | |
"python.formatting.provider": "black", | |
"python.linting.flake8Enabled": true, | |
"python.testing.pytestEnabled": true, | |
"python.dataScience.jupyterCommandLineArguments": [ | |
"--NotebookApp.port=9999" | |
] | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
import pytest | |
import aiohttp | |
import asyncio | |
from asynctest import CoroutineMock, MagicMock, patch | |
# Example Code | |
async def fetch(session, url): |