Skip to content

Instantly share code, notes, and snippets.


Ethan Smith ethanhs

Block or report user

Report or block ethanhs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ethanhs / output.log
Created Feb 28, 2019
Trying to build typed_ast with pypy
View output.log
ethanhs▶~\Documents\typed_ast◇master❯ ..\..\Downloads\pypy3.6-v7.0.0-win32\pypy3 -m pip install .
Processing c:\users\ethanhs\documents\typed_ast
Installing collected packages: typed-ast
Running install for typed-ast ... error
Complete output from command C:\Users\ethanhs\Downloads\pypy3.6-v7.0.0-win32\pypy3.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ethanhs\\AppData\\Local\\Temp\\pip-req-build-13ik00j7\\';f=getattr(tokenize, 'open', open)(__file__);'\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\ethanhs\AppData\Local\Temp\pip-record-qn2gezr2\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build\lib.win32-3.6
creating build\lib.win32-3.6\typed_ast
ethanhs /
Last active Oct 24, 2018
An experiment writing nice wrappers around namedpipes using the _winapi module.
import time
import sys
from namedpipe import *
if __name__ == '__main__':
if len(sys.argv) < 2:
print("need s or c as argument")
elif sys.argv[1] == "s":
with NamedPipeServer('testFoo') as server:
count = 10
while count > 0:
ethanhs / py-spy-mypy
Created Oct 18, 2018
Running py-spy on mypy
View py-spy-mypy
Collecting samples from 'python -m mypy mypy' (python v3.7.0)
Total Samples 4700
GIL: 0.00%, Active: 32.00%, Threads: 1
%Own %Total OwnTime TotalTime Function (filename:line)
8.50% 8.50% 1.77s 1.82s atomic_write (C:\Users\ethanhs\Documents\mypy\mypy\
1.00% 9.50% 0.190s 2.78s __eq__ (C:\Users\ethanhs\Documents\mypy\mypy\
1.00% 1.00% 0.025s 0.085s check_arg (C:\Users\ethanhs\Documents\mypy\mypy\
1.00% 3.50% 0.190s 1.19s __hash__ (C:\Users\ethanhs\Documents\mypy\mypy\
0.50% 9.50% 0.045s 3.76s literal_hash (C:\Users\ethanhs\Documents\mypy\mypy\
ethanhs /
Created Apr 25, 2018
`functools.singledispatchmethod` for use before 3.8
from functools import singledispatch, update_wrapper
class singledispatchmethod:
"""Single-dispatch generic method descriptor.
Supports wrapping existing descriptors and handles non-descriptor
callables as instance methods.
def __init__(self, func):
if not callable(func) and not hasattr(func, "__get__"):
ethanhs / output.log
Created Mar 6, 2018
Changing default python version in mypy
View output.log
Worker information
version: v3.5.0
instance: 24be829 travisci/ci-garnet:packer-1512502276-986baf0 (via amqp)
startup: 417.936957ms
mode of ‘/usr/local/clang-5.0.0/bin’ changed from 0777 (rwxrwxrwx) to 0775 (rwxrwxr-x)
Build system information
Build language: python
Build group: stable

Keybase proof

I hereby claim:

  • I am ethanhs on github.
  • I am ethanhs ( on keybase.
  • I have a public key ASB62E5i52bI_UgYyZyjrivJLeaf9qTzpAD4vITJ7-7dtAo

To claim this, I am signing this object:

View build log with flake.log
Worker information
version: v3.5.0
instance: 355a358 travisci/ci-garnet:packer-1512502276-986baf0 (via amqp)
startup: 463.749498ms
mode of ‘/usr/local/clang-5.0.0/bin’ changed from 0777 (rwxrwxrwx) to 0775 (rwxrwxr-x)
Build system information
ethanhs /
Created Oct 20, 2017
Because we need a C version
MAX = 250
nums = range(MAX + 1)
signs = '+-*/'
if_template = '''
if (a == {0} && b == '{1}' && c == {2})
puts("{0} {1} {2} = {3}");
main_template = '''
ethanhs / output.log
Created Jun 25, 2017
Failed build of Pyjion
View output.log
1>------ Build started: Project: Pyjion, Configuration: Debug x64 ------
1> intrins.cpp
1>intrins.cpp(534): error C2059: syntax error: '.'
1>intrins.cpp(534): error C2143: syntax error: missing ';' before '}'
1>intrins.cpp(535): error C2065: 'PyId_displayhook': undeclared identifier
1>intrins.cpp(537): error C2059: syntax error: 'if'
1>intrins.cpp(537): error C2143: syntax error: missing ';' before '{'
1>intrins.cpp(537): error C2447: '{': missing function header (old-style formal list?)
1>intrins.cpp(543): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>intrins.cpp(543): error C2373: 'res': redefinition; different type modifiers
ethanhs / Depend on
Last active May 31, 2017
A list of modules that depend on typing as of 5-30-2017
View Depend on

netsgiro typing

pykechain typing

typed-astunparse typing (>=3.5)

ninjag typing

PyOTA typing

You can’t perform that action at this time.