Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AttrgetterType = objects.NewType("attrgetter", []*objects.Type{objects.ObjectType()})
AttrgetterType is operator.attrgetter. Each instance carries a list of dotted attribute paths; calling it returns the single value or a tuple of values, exactly the way attrgetter_call_impl does.
CPython: Modules/_operator.c:1601 attrgetter_type_spec
var ItemgetterType = objects.NewType("itemgetter", []*objects.Type{objects.ObjectType()})
ItemgetterType is operator.itemgetter. Calling itemgetter(i) builds a callable that returns obj[i]; itemgetter(i, j) builds one that returns (obj[i], obj[j]).
CPython: Modules/_operator.c:1234 itemgetter_type_spec
var MethodcallerType = objects.NewType("methodcaller", []*objects.Type{objects.ObjectType()})
MethodcallerType is operator.methodcaller. Calling methodcaller(name, *args, **kw)(obj) invokes obj.name(*args, **kw).
CPython: Modules/_operator.c:1942 methodcaller_type_spec
Functions ¶
This section is empty.
Types ¶
type Attrgetter ¶
Attrgetter is the runtime shape backing an attrgetter instance. chains[i] is the split list of dotted names for the ith attribute. raw[i] is the original string the user passed in (kept for repr and reduce).
CPython: Modules/_operator.c:1245 attrgetterobject
type Itemgetter ¶
Itemgetter is the concrete shape backing an itemgetter instance. Mirrors itemgetterobject.
CPython: Modules/_operator.c:1016 itemgetterobject
type Methodcaller ¶
Methodcaller is the runtime shape.
CPython: Modules/_operator.c:1613 methodcallerobject