Skip to content

Instantly share code, notes, and snippets.

View amyreese's full-sized avatar
🐍
herding snakes

Amethyst Reese amyreese

🐍
herding snakes
View GitHub Profile
(.venv) jreese@legion ~/workspace/aiosqlite master Β» make perf
python3 -m unittest -v tests.perf
Running perf tests for at least 2.0s each...
test_atomics (tests.perf.PerfTest) ... ok
test_insert_ids (tests.perf.PerfTest) ... ok
test_insert_macro_ids (tests.perf.PerfTest) ... ok
test_inserts (tests.perf.PerfTest) ... ok
test_select (tests.perf.PerfTest) ... ok
test_select_macro (tests.perf.PerfTest) ... ok
(.venv) jreese@kirby ~/workspace/aioitertools master Β» pylint --version && pylint --rcfile .pylint aioitertools setup.py
pylint 2.0.0.dev1
astroid 1.6.5
Python 3.7.0 (default, Jul 4 2018, 01:03:13)
[GCC 8.1.1 20180531]
Traceback (most recent call last):
File "/home/jreese/workspace/aioitertools/.venv/bin/pylint", line 11, in <module>
sys.exit(run_pylint())
File "/home/jreese/workspace/aioitertools/.venv/lib/python3.7/site-packages/pylint/__init__.py", line 18, in run_pylint
Run(sys.argv[1:])
(.venv) jreese@kirby ~/workspace/aioitertools master Β» pylint --version && pylint --rcfile .pylint aioitertools setup.py
No config file found, using default configuration
pylint 1.9.2,
astroid 1.6.5
Python 3.6.5 (default, May 14 2018, 21:33:03)
[GCC 7.3.1 20180406]
Using config file /home/jreese/workspace/aioitertools/.pylint
(.venv) jreese@kirby ~/workspace/aioitertools master Β»
(.venv) jreese@kirby ~/workspace/aioitertools master Β» pylint --version && pylint --rcfile .pylint aioitertools setup.py
No config file found, using default configuration
pylint 1.9.2,
astroid 1.6.5
Python 3.7.0 (default, Jul 4 2018, 01:03:13)
[GCC 8.1.1 20180531]
Using config file /home/jreese/workspace/aioitertools/.pylint
Traceback (most recent call last):
File "/home/jreese/workspace/aioitertools/.venv/lib/python3.7/site-packages/astroid/decorators.py", line 89, in wrapped
res = next(generator)
@amyreese
amyreese / foo.py
Last active November 25, 2019 10:33
#!/usr/bin/env python3
from attr import dataclass, Factory
from typing import Dict, List
@dataclass
class Foo:
_instances: Dict[str, "Foo"] = Factory(dict)
(.py3) jreese@jreese-mbp ~/workspace/mypy-recursion Β» mypy --python-version 3.6 --show-traceback foo.py
foo.py:30: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.600
Traceback (most recent call last):
File "/Users/jreese/.pyenv/versions/3.6.5/bin/mypy", line 11, in <module>
sys.exit(console_entry())
File "/Users/jreese/.pyenv/versions/3.6.5/lib/python3.6/site-packages/mypy/__main__.py", line 7, in console_entry
main(None)
File "/Users/jreese/.pyenv/versions/3.6.5/lib/python3.6/site-packages/mypy/main.py", line 91, in main
res = type_check_only(sources, bin_dir, options, flush_errors, fscache) # noqa
File "/Users/jreese/.pyenv/versions/3.6.5/lib/python3.6/site-packages/mypy/main.py", line 148, in type_check_only
./edi/bot.py:112: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.600
Traceback (most recent call last):
File "/Users/jreese/.pyenv/versions/3.6.5/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Users/jreese/.pyenv/versions/3.6.5/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/jreese/.pyenv/versions/3.6.5/lib/python3.6/site-packages/mypy/__main__.py", line 11, in <module>
main(None)
File "/Users/jreese/.pyenv/versions/3.6.5/lib/python3.6/site-packages/mypy/main.py", line 91, in main
res = type_check_only(sources, bin_dir, options, flush_errors, fscache) # noqa
@amyreese
amyreese / gist:c20759267e08aa45b7ce4a29747f5337
Created April 17, 2018 21:36
mypy 0.590 breaks --python-version
jreese@jreese-mbp ~/workspace/aiosqlite +master Β» python3 --version
Python 3.6.4
jreese@jreese-mbp ~/workspace/aiosqlite +master Β» mypy --version
mypy 0.580
jreese@jreese-mbp ~/workspace/aiosqlite +master Β» mypy --ignore-missing-imports --python-version 3.5 aiosqlite
jreese@jreese-mbp ~/workspace/aiosqlite +master Β» pip3 install mypy==0.590
Collecting mypy==0.590
Downloading https://files.pythonhosted.org/packages/d6/e2/37a8a5dce634a094b90e13eda246a4b736a660124e78808f47fbad99f510/mypy-0.590-py3-none-any.whl (1.3MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.3MB 913kB/s
Requirement already satisfied: typed-ast<1.2.0,>=1.1.0 in /Users/jreese/.pyenv/versions/3.6.4/lib/python3.6/site-packages (from mypy==0.590)
async def executemany(
- self,
- sql: str,
- parameters: Iterable[Iterable[Any]],
+ self, sql: str, parameters: Iterable[Iterable[Any]]
) -> None:
"""Execute the given multiquery."""
await self._execute(self._cursor.executemany, sql, parameters)
def first():
print('in first')
yield 25
print('back in first')
def second():
print('in second')
for value in first():
print('back in second, got: ', value)