private NUrl dequeUrl() {
return liburl("deque-objects");
}
@Override
public void initBindings() {
NClassType Callable = newClass("Callable", table, Object);
Callable.getTable().update("__call__", abcUrl(), newFunc(), METHOD);
addClass("Callable", abcUrl(), Callable);
NClassType Iterable = newClass("Iterable", table, Object);
Iterable.getTable().update("__next__", abcUrl(), newFunc(), METHOD);
Iterable.getTable().update("__iter__", abcUrl(), newFunc(), METHOD);
addClass("Iterable", abcUrl(), Iterable);
NClassType Hashable = newClass("Hashable", table, Object);
Hashable.getTable().update("__hash__", abcUrl(), newFunc(BaseNum), METHOD);
addClass("Hashable", abcUrl(), Hashable);
NClassType Sized = newClass("Sized", table, Object);
Sized.getTable().update("__len__", abcUrl(), newFunc(BaseNum), METHOD);
addClass("Sized", abcUrl(), Sized);
NClassType Container = newClass("Container", table, Object);
Container.getTable().update("__contains__", abcUrl(), newFunc(BaseNum), METHOD);
addClass("Container", abcUrl(), Container);
NClassType Iterator = newClass("Iterator", table, Iterable);
addClass("Iterator", abcUrl(), Iterator);
NClassType Sequence = newClass("Sequence", table, Sized, Iterable, Container);
Sequence.getTable().update("__getitem__", abcUrl(), newFunc(), METHOD);
Sequence.getTable().update("reversed", abcUrl(), newFunc(Sequence), METHOD);
Sequence.getTable().update("index", abcUrl(), newFunc(BaseNum), METHOD);
Sequence.getTable().update("count", abcUrl(), newFunc(BaseNum), METHOD);
addClass("Sequence", abcUrl(), Sequence);
NClassType MutableSequence = newClass("MutableSequence", table, Sequence);
MutableSequence.getTable().update("__setitem__", abcUrl(), newFunc(), METHOD);
MutableSequence.getTable().update("__delitem__", abcUrl(), newFunc(), METHOD);
addClass("MutableSequence", abcUrl(), MutableSequence);
NClassType Set = newClass("Set", table, Sized, Iterable, Container);
Set.getTable().update("__getitem__", abcUrl(), newFunc(), METHOD);
addClass("Set", abcUrl(), Set);
NClassType MutableSet = newClass("MutableSet", table, Set);
MutableSet.getTable().update("add", abcUrl(), newFunc(), METHOD);
MutableSet.getTable().update("discard", abcUrl(), newFunc(), METHOD);
addClass("MutableSet", abcUrl(), MutableSet);
NClassType Mapping = newClass("Mapping", table, Sized, Iterable, Container);
Mapping.getTable().update("__getitem__", abcUrl(), newFunc(), METHOD);
addClass("Mapping", abcUrl(), Mapping);
NClassType MutableMapping = newClass("MutableMapping", table, Mapping);
MutableMapping.getTable().update("__setitem__", abcUrl(), newFunc(), METHOD);
MutableMapping.getTable().update("__delitem__", abcUrl(), newFunc(), METHOD);
addClass("MutableMapping", abcUrl(), MutableMapping);
NClassType MappingView = newClass("MappingView", table, Sized);
addClass("MappingView", abcUrl(), MappingView);
NClassType KeysView = newClass("KeysView", table, Sized);
addClass("KeysView", abcUrl(), KeysView);
NClassType ItemsView = newClass("ItemsView", table, Sized);
addClass("ItemsView", abcUrl(), ItemsView);
NClassType ValuesView = newClass("ValuesView", table, Sized);
addClass("ValuesView", abcUrl(), ValuesView);
NClassType deque = newClass("deque", table, Object);
for (String n : list("append", "appendLeft", "clear",
"extend", "extendLeft", "rotate")) {
deque.getTable().update(n, dequeUrl(), newFunc(None), METHOD);
}
for (String u : list("__getitem__", "__iter__",
"pop", "popleft", "remove")) {
deque.getTable().update(u, dequeUrl(), newFunc(), METHOD);
}
addClass("deque", dequeUrl(), deque);
NClassType defaultdict = newClass("defaultdict", table, Object);
defaultdict.getTable().update("__missing__", liburl("defaultdict-objects"),
newFunc(), METHOD);
defaultdict.getTable().update("default_factory", liburl("defaultdict-objects"),
newFunc(), METHOD);
addClass("defaultdict", liburl("defaultdict-objects"), defaultdict);
String argh = "namedtuple-factory-function-for-tuples-with-named-fields";
NClassType namedtuple = newClass("(namedtuple)", table, BaseTuple);
namedtuple.getTable().update("_fields", liburl(argh),
new NListType(BaseStr), ATTRIBUTE);
addFunction("namedtuple", liburl(argh), namedtuple);
}