I hereby claim:
- I am jomido on github.
- I am jomido (https://keybase.io/jomido) on keybase.
- I have a public key whose fingerprint is 4571 E8DE 72AC EC4A 0475 98FD F53B 06CC 331F 0CD3
To claim this, I am signing this object:
class SchemaFailException(Exception): | |
def __init__(self, message, attr, valid_types): | |
Exception.__init__(self, message) | |
self.attr = attr | |
self.valid_types = valid_types | |
def n_of_k(n, k): | |
return lambda n: n % k == 0 | |
def n_for_ks(n, *ks): | |
return [n_of_k(n, k) for k in ks] |
def n_of_k(n, k): | |
return lambda n: n % k == 0 | |
def n_for_ks(n, *ks): | |
return [n_of_k(n, k) for k in ks] |
I hereby claim:
To claim this, I am signing this object:
import random | |
import time | |
from twisted.internet import task | |
from twisted.internet.defer import ( | |
inlineCallbacks as inline, | |
returnValue, | |
DeferredList as when_all | |
) |
import asyncio | |
def maybeAsync(callable, *args, **kwargs): | |
""" | |
Turn a callable into a coroutine if it isn't | |
""" |
from collections import defaultdict | |
class AutoClass(object): | |
pass | |
def inflate(data, class_from_fields): |
A class is a type. A type of thing. There are lots of cars, but there are also lots of types of cars. A Porsche 911 is such a type. If you go out onto a road, you will see lots of cars, and you will be able to identify their types. But what you will definitely not see is the type or class itself. Just instances of that type.
A class or type is defined by its properties and abilities. Another way to think of a class is as a table schema in a database. The schema defines the columns via a name and a kind of data. That is, it defines the table's type, or its class. Individual rows inside the table are instances of the type.
In addition, types (or classes) of things seem to be arranged in a hierarchy. A Porsche 911 is a type of car that has instances in the real world. But a Porsche 911, while being a type, belongs to yet another type called "motor vehicle". There are people and birds and lamp posts on the street too, none of which are types of motor vehicles. "Motor vehicle" is a pare