I hereby claim:
- I am radix on github.
- I am radix (https://keybase.io/radix) on keybase.
- I have a public key whose fingerprint is FCBD FCAC C60C 0542 8B25 2B52 50E2 9207 87F0 E626
To claim this, I am signing this object:
def example(): | |
import sys | |
from twisted.python import log | |
log.startLogging(sys.stdout) | |
logger = EventHierarchyLogger("myapp", log) | |
logger.msg("startup") | |
# in another module... | |
logger = logger.specialize("rpc") | |
logger.msg("got-frag", fragger="dreid", fragee="radix") |
import sys | |
class Logger(object): | |
def __init__(self, system): | |
self.system = system | |
def log(self, format=None, **keywords): |
>>> from twisted.internet.defer import inlineCallbacks | |
>>> @inlineCallbacks | |
... def a(): | |
... yield b() | |
... | |
>>> @inlineCallbacks | |
... def b(): | |
... yield c() | |
... | |
>>> def c(): 1 / 0 |
>>> def g1(): | |
... for x in g2(): | |
... yield x | |
... | |
>>> def g2(): | |
... yield 1 | |
... yield 2 | |
... 1 / 0 | |
... | |
>>> for x in g1(): pass |
from __future__ import print_function | |
import sys | |
import time | |
from twisted.internet.task import cooperate, react, Cooperator | |
from twisted.internet.defer import gatherResults | |
import treq | |
from collections import namedtuple | |
def immutable(fields): | |
""" | |
Returns a metaclass that makes fields on your instances immutable, while | |
still allowing __init__ to initialize attributes. | |
You should be able to enable immutability on most normal classes by just | |
adding |
def imdict(dct): | |
"""Construct an immutable dict, based on a normal one. | |
""" | |
# Warning: It's possible for others to get at these closed-over variables | |
# by inspecting frames, and then modifying them. Suggestions welcome (other | |
# than implementing a new hash table with tuples from scratch) | |
items = dct.items() | |
lookup = dict([(item[0], index) for index, item in enumerate(items)]) |
radix@伝説.local:~$ mkvirtualenv cryptotest | |
New python executable in cryptotest/bin/python | |
Installing setuptools, pip...done. | |
(cryptotest) | |
radix@伝説.local:~$ cd ~ | |
(cryptotest) | |
radix@伝説.local:~$ python t.py | |
Traceback (most recent call last): | |
File "t.py", line 1, in <module> | |
from cryptography.hazmat.backends import openssl, commoncrypto, default_backend |
I hereby claim:
To claim this, I am signing this object:
hello : { [STDIO] } Eff IO () | |
hello = do | |
putStr "Name? " | |
putStrLn ("Hello " ++ trim !getStr ++ "!") |