_operator

package
v0.12.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

View Source
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

View Source
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

type Attrgetter struct {
	objects.Header
	// contains filtered or unexported fields
}

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

type Itemgetter struct {
	objects.Header
	// contains filtered or unexported fields
}

Itemgetter is the concrete shape backing an itemgetter instance. Mirrors itemgetterobject.

CPython: Modules/_operator.c:1016 itemgetterobject

type Methodcaller

type Methodcaller struct {
	objects.Header
	// contains filtered or unexported fields
}

Methodcaller is the runtime shape.

CPython: Modules/_operator.c:1613 methodcallerobject

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL