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
(.venv3) jreese@jreese-mbp ~/workspace/typeshed +multiprocessing Β» python3 tests/mypy_test.py
running mypy --python-version 3.6 --strict-optional # with 595 files
stdlib/3/multiprocessing/managers.pyi:19: error: Invalid type "Namespace"
stdlib/3/multiprocessing/managers.pyi:25: error: Invalid type "dict"
stdlib/3/multiprocessing/managers.pyi:26: error: Invalid type "list"
running mypy --python-version 3.5 --strict-optional # with 584 files
stdlib/3/multiprocessing/managers.pyi:19: error: Invalid type "Namespace"
stdlib/3/multiprocessing/managers.pyi:25: error: Invalid type "dict"
stdlib/3/multiprocessing/managers.pyi:26: error: Invalid type "list"
running mypy --python-version 3.4 --strict-optional # with 583 files
(.venv3) jreese@jreese-mbp ~/workspace/typeshed +socket-addressfamily⚑ » python tests/mypy_test.py
running mypy --python-version 3.6 --strict-optional # with 556 files
stdlib/3/builtins.pyi:691: error: Invalid type "typing.FrozenSet"
stdlib/3/builtins.pyi:692: error: Invalid type "typing.FrozenSet"
stdlib/3/builtins.pyi:693: error: Invalid type "typing.FrozenSet"
stdlib/3/builtins.pyi:697: error: Invalid type "typing.FrozenSet"
stdlib/3/builtins.pyi:698: error: Invalid type "typing.FrozenSet"
stdlib/3/builtins.pyi:703: error: Invalid type "typing.FrozenSet"
stdlib/3/builtins.pyi:704: error: Invalid type "typing.FrozenSet"
stdlib/3/builtins.pyi:705: error: Invalid type "typing.FrozenSet"
@amyreese
amyreese / foo.py
Created December 8, 2016 23:13
pyflakes gives bad F821 for undefined name __module__
class Foo(object):
path = __module__ + '.Foo'
def bar(self):
print(self.path)
if __name__ == '__main__':
Foo().bar()
jreese@jreese-mbp ~/workspace/znc-push +f2069f2 Β» make curl=yes
CXXFLAGS=" -DPUSHVERSION=\"v1.0.0-117-gf2069f2\" -DUSE_CURL -lcurl" LIBS=" -DUSE_CURL -lcurl" \
znc-buildmod push.cpp
Building "push.so" for ZNC 1.7.x... push.cpp:1774:5: error: no matching function for call to 'make_curl_request'
make_curl_request(service_host, service_url, service_auth, params, headers, use_port, use_ssl, use_post, options["proxy"], options["proxy_ssl_verify"] != "no", options["debug"] == "on"...
^~~~~~~~~~~~~~~~~
push.cpp:78:10: note: candidate function not viable: requires 11 arguments, but 12 were provided
CURLcode make_curl_request(const CString& service_host, const CString& service_url,
^
push.cpp:1914:11: error: no matching function for call to 'curl_slist_append'
NOTE: connecting to service...
NOTE: connection established
INFO: using last known command: "C:/Program Files/Synergy/synergys.exe" -f --no-tray --debug INFO --name shepard --ipc --stop-on-desk-switch --enable-drag-drop --enable-crypto --profile-dir "C:\Users\jreese\AppData\Local" -c "C:/Users/jreese/AppData/Local/Temp/qt_temp.Hp5548" --address :24800
INFO: service command updated
INFO: starting new process
activeDesktop:Winlogon
INFO: starting new process
INFO: drag and drop enabled
ERROR: failed to get desktop path, no drop target available, error=2
NOTE: started server, waiting for clients
Python 2.7.8 (default, Oct 16 2014, 11:03:30)
Type "copyright", "credits" or "license" for more information.
IPython 2.2.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import collections, numbers
13:30:33 *push | Evaluating channel message #pandora <jreese> aoeu
13:30:33 *push | last_notification: True
13:30:33 *push | highlight: False
13:30:33 *push | away_only: True
13:30:33 *push | nick_blacklist: False
13:30:33 *push | replied: True
13:30:33 *push | client_count_less_than: True
13:30:33 *push | last_active: True
13:30:33 *push | idle: True
13:30:33 *push | Evaluating custom expression: import math; math.abs(1,100)
#include <stdio.h>
#include <stdlib.h>
const int length = 5;
int test_array[length] = {21,14,35,63,28};
int main(int argc, char* argv[])
{
for (int i = 0; i < length; i++)
{
#include <stdio.h>
#include <stdlib.h>
int length = 5;
int test_array[] = {21,14,35,63,28};
int main(int argc, char* argv[])
{
for (int i = 0; i < length; i++)
{
#include <stdio.h>
#include <stdlib.h>
void numeral(int num, char buffer[])
{
int ones = num % 10;
int tens = num / 10;
int i = 0;
switch (tens)