methods
本頁內容尚未翻譯。
python.Methods.fails
Section titled “python.Methods.fails”def Methods.fails (h : Heap) (e : Raised) : ChangedThe exception e raised, the heap h unchanged.
python.Methods.gives
Section titled “python.Methods.gives”def Methods.gives (h : Heap) (v : Value) : ChangedThe value v produced, the heap h unchanged.
python.Methods.checked
Section titled “python.Methods.checked”def Methods.checked (h : Heap) (problem : Option Raised) (work : Unit -> Changed) : ChangedThe check’s problem raised, else the method’s work when it passed, on the heap h.
python.Methods.notInteger
Section titled “python.Methods.notInteger”def Methods.notInteger (h : Heap) (v : Value) : RaisedTypeError: the value v on the heap h is not an index.
python.Methods.sizeLimit
Section titled “python.Methods.sizeLimit”def Methods.sizeLimit : NatThe largest Py_ssize_t, 2^63 - 1.
python.Methods.fitsSize
Section titled “python.Methods.fitsSize”def Methods.fitsSize (n : Int) : BoolWhether the int n fits a Py_ssize_t.
python.Methods.size
Section titled “python.Methods.size”def Methods.size (h : Heap) (v : Value) : Either Raised IntThe index argument v on the heap h as a Py_ssize_t: TypeError for a value that is not an index,
OverflowError past the range.
python.Methods.sliceBound
Section titled “python.Methods.sliceBound”def Methods.sliceBound (h : Heap) (noneAllowed : Bool) (v : Value) : Either Raised (Option Int)The slice bound v on the heap h (_PyEval_SliceIndex): an index clamped to Py_ssize_t, or None when
noneAllowed (none).
python.Methods.adjust
Section titled “python.Methods.adjust”def Methods.adjust (size : Nat) (isEnd : Bool) (bound : Int) : IntThe bound adjusted to the length size (ADJUST_INDICES): from the end when negative, then clamped to 0 and
the length (the length only when isEnd).
python.Methods.range
Section titled “python.Methods.range”def Methods.range (h : Heap) (size : Nat) (start : Option Value) (finish : Option Value) : Either Raised (Int * Int)The start and end (finish) arguments of find and the others on the heap h (each optional, None allowed),
adjusted to the length size.
python.Methods.slot
Section titled “python.Methods.slot”def Methods.slot (values : List (Option Value)) (k : Nat) : Option ValueThe value of the parsed parameter at the position k of the values, if it was given.
python.Methods.codes
Section titled “python.Methods.codes”def Methods.codes (self : Value) : CodesThe code points of the str receiver self.
python.Methods.text
Section titled “python.Methods.text”def Methods.text (h : Heap) (cs : Codes) : ChangedThe text cs produced, the heap h unchanged.
python.Methods.bool
Section titled “python.Methods.bool”def Methods.bool (h : Heap) (b : Bool) : ChangedThe bool b produced, the heap h unchanged.
python.Methods.unclassified
Section titled “python.Methods.unclassified”def Methods.unclassified (method : String) : RaisedWhat the model cannot tell: a code point it does not classify, for a method that needs its class.
python.Methods.classifiedOnly
Section titled “python.Methods.classifiedOnly”def Methods.classifiedOnly (h : Heap) (method : String) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) (work : Codes -> Changed) : ChangedThe str method named method of no arguments that needs every code point classified: its work on the code
points of self, on the heap h, once the call’s positional and keywords arguments are checked to be none.
python.Methods.isAlpha
Section titled “python.Methods.isAlpha”def Methods.isAlpha (c : Nat) : BoolWhether the code point c is a letter (str.isalpha).
python.Methods.isDigit
Section titled “python.Methods.isDigit”def Methods.isDigit (c : Nat) : BoolWhether the code point c is a decimal digit (str.isdigit on the classified code points).
python.Methods.allOf
Section titled “python.Methods.allOf”def Methods.allOf (p : Nat -> Bool) (cs : Codes) : BoolWhether the text cs is not empty and every code point is of the class p.
python.Methods.caseChange
Section titled “python.Methods.caseChange”def Methods.caseChange (method : String) (cs : Codes) : Codess.upper(), s.lower(), s.title(), s.capitalize() (the method) on the code points cs of s.
python.Methods.classTest
Section titled “python.Methods.classTest”def Methods.classTest (method : String) (cs : Codes) : Bools.isdigit(), s.isalpha(), s.isupper(), s.islower() (the method) on the code points cs of s.
python.Methods.strip
Section titled “python.Methods.strip”def Methods.strip (h : Heap) (method : String) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.strip(chars), lstrip, rstrip (the method) on the str self with the call’s positional and keywords
arguments, on the heap h: whitespace, or the code points of chars (None: whitespace).
python.Methods.wordsWithin
Section titled “python.Methods.wordsWithin”def Methods.wordsWithin (fuel : Nat) (k : Nat) (cs : Codes) : List CodesThe pieces of cs between whitespace, at most k splits, within fuel steps (CPython’s split_whitespace): the
rest after the last split, without its leading whitespace, is the last piece.
python.Methods.splitWithin
Section titled “python.Methods.splitWithin”def Methods.splitWithin (fuel : Nat) (separator : Codes) (k : Nat) (piece : Codes) (cs : Codes) : List CodesThe pieces of cs between occurrences of the separator, at most k splits, within fuel steps (piece: the
current one).
python.Methods.splitCount
Section titled “python.Methods.splitCount”def Methods.splitCount (cs : Codes) (count : Int) : NatThe most splits of the text cs the count asks for: every one for a negative count.
python.Methods.split
Section titled “python.Methods.split”def Methods.split (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.split(sep=None, maxsplit=-1) on the str self with the call’s positional and keywords arguments, on the
heap h.
python.Methods.firstNotText
Section titled “python.Methods.firstNotText”def Methods.firstNotText (k : Nat) (xs : List Value) : Option (Nat * Value)The first item of the list xs that is not a str, and where it is (counting from k).
python.Methods.joinWith
Section titled “python.Methods.joinWith”def Methods.joinWith (separator : Codes) (xs : List Value) : CodesThe texts xs joined with the separator between them.
python.Methods.join
Section titled “python.Methods.join”def Methods.join (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.join(iterable) on the str self with the call’s positional and keywords arguments, on the heap h: every
item a str.
python.Methods.mustBeText
Section titled “python.Methods.mustBeText”def Methods.mustBeText (h : Heap) (method : String) (k : Nat) (v : Value) : RaisedTypeError: the argument v (on the heap h) at the position k of the str method must be a str.
python.Methods.replace
Section titled “python.Methods.replace”def Methods.replace (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.replace(old, new, /, count=-1) on the str self with the call’s positional and keywords arguments, on
the heap h.
python.Methods.findFrom
Section titled “python.Methods.findFrom”def Methods.findFrom (fuel : Nat) (k : Nat) (finish : Nat) (part : Codes) (cs : Codes) : Option NatWhere the text part first occurs in cs (at the position k) before finish, within fuel steps.
python.Methods.search
Section titled “python.Methods.search”def Methods.search (method : String) (cs : Codes) (part : Codes) (low : Nat) (high : Nat) : Ints.find, s.index, s.count (the method) of a part of cs within [low, high), which is at least as long
as the part: where it first is (-1: not there), or how many times it is there without overlapping (an empty part:
between every two code points and at both ends).
python.Methods.find
Section titled “python.Methods.find”def Methods.find (h : Heap) (method : String) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.find(sub[, start[, end]]), s.index, s.count (the method) on the str self with the call’s positional
and keywords arguments, on the heap h: ValueError from index when it is not there.
python.Methods.tailMatch
Section titled “python.Methods.tailMatch”def Methods.tailMatch (cs : Codes) (atEnd : Bool) (part : Codes) (start : Int) (finish : Int) : BoolWhether the text cs has the part at the start (or the end, atEnd) of [start, finish) (CPython’s
tailmatch).
python.Methods.prefixes
Section titled “python.Methods.prefixes”def Methods.prefixes (h : Heap) (method : String) (v : Value) : Either Raised (List Codes)The texts the argument v (on the heap h) of startswith or endswith (the method) gives: a str, or a
tuple of them.
python.Methods.startsWith
Section titled “python.Methods.startsWith”def Methods.startsWith (h : Heap) (method : String) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.startswith(prefix[, start[, end]]), s.endswith (the method) on the str self with the call’s
positional and keywords arguments, on the heap h.
python.Methods.fill
Section titled “python.Methods.fill”def Methods.fill (h : Heap) (v : Option Value) : Either Raised NatThe fill character v (on the heap h) of ljust and the others (a space when absent).
python.Methods.padded
Section titled “python.Methods.padded”def Methods.padded (method : String) (width : Nat) (fill : Nat) (cs : Codes) : CodesThe text cs padded with fill to the width, as the method does: on the right (ljust), the left (rjust),
or both (center: the extra one on the left when the margin and the width are both odd, as CPython’s pad does).
python.Methods.memoryLimit
Section titled “python.Methods.memoryLimit”def Methods.memoryLimit : NatThe width past which a padded text would not fit the model’s memory (2^32 code points): MemoryError.
python.Methods.justify
Section titled “python.Methods.justify”def Methods.justify (h : Heap) (method : String) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.ljust(width[, fillchar]), rjust, center (the method) on the str self with the call’s positional and
keywords arguments, on the heap h.
python.Methods.zfill
Section titled “python.Methods.zfill”def Methods.zfill (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.zfill(width) on the str self with the call’s positional and keywords arguments, on the heap h: zeros
on the left, after a leading sign.
python.Method
Section titled “python.Method”def Method : TypeA method of a receiver: its name, and what calling it with arguments does.
python.Methods.named
Section titled “python.Methods.named”def Methods.named (method : String) (f : Heap -> String -> Value -> List Value -> List (Codes * Value) -> Changed) : MethodThe method named method whose handler f takes its own name first.
python.Methods.caseMethod
Section titled “python.Methods.caseMethod”def Methods.caseMethod (method : String) : Methods.upper() and the other case changes, by the name method.
python.Methods.testMethod
Section titled “python.Methods.testMethod”def Methods.testMethod (method : String) : Methods.isdigit() and the other class tests, by the name method.
python.Methods.isSpace
Section titled “python.Methods.isSpace”def Methods.isSpace (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.isspace() on the str self with the call’s positional and keywords arguments, on the heap h (whitespace
is known for every code point).
python.Methods.ofText
Section titled “python.Methods.ofText”def Methods.ofText : List MethodThe str methods the model provides.
python.Piece
Section titled “python.Piece”data PieceWhat reading the next piece of a format string gives (CPython’s MarkupIterator_next): the end, literal text,
literal text followed by a replacement field (its name, conversion, spec, and whether the spec holds fields of its
own), or an exception.
python.Format.fails
Section titled “python.Format.fails”def Format.fails (message : String) : RaisedA format string’s ValueError with the message.
python.Format.spec
Section titled “python.Format.spec”def Format.spec (k : Nat) (expands : Bool) (spec : Codes) (cs : Codes) : Either Raised ((Codes * Bool) * Codes)A field’s spec so far continued in cs up to its closing brace, nested braces counted (k: braces still open;
expands: whether a nested field was seen).
python.Format.name
Section titled “python.Format.name”def Format.name (fuel : Nat) (name : Codes) (cs : Codes) : Either Raised ((Codes * Nat) * Codes)A field’s name so far continued in cs up to :, ! or } (a [ skips to its ]), within fuel steps:
the name, the code point that ended it, the rest.
python.Format.afterConversion
Section titled “python.Format.afterConversion”def Format.afterConversion (text : Codes) (name : Codes) (conversion : Nat) (cs : Codes) : PieceThe rest cs after the conversion specifier of the field name (after the literal text): } ends the field,
: starts its spec.
python.Format.field
Section titled “python.Format.field”def Format.field (text : Codes) (cs : Codes) : PieceA replacement field in cs after its {, after the literal text (CPython’s parse_field).
python.Format.next
Section titled “python.Format.next”def Format.next (cs : Codes) : PieceThe next piece of the format string cs.
python.Numbering
Section titled “python.Numbering”data NumberingHow replacement fields are numbered so far: not yet, automatically (the next number), or by hand.
python.Format.integer
Section titled “python.Format.integer”def Format.integer (cs : Codes) : Either Raised (Option Nat)The field name’s part cs as an index (CPython’s get_integer): none unless every code point is a decimal digit;
ValueError past Py_ssize_t.
python.Formatting
Section titled “python.Formatting”record FormattingThe arguments a format string reads.
python.Found
Section titled “python.Found”data FoundWhat a field’s name gives: its value and the numbering after it, or an exception.
python.Format.argument
Section titled “python.Format.argument”def Format.argument (c : Formatting) (numbering : Numbering) (first : Codes) (index : Option Nat) : FoundThe argument among c that a field’s first part names (its index, if it is one), with the fields’
numbering so far: the next one for an empty part, by position for an index, else by keyword (CPython’s
field_name_split and get_field_object).
python.Format.attribute
Section titled “python.Format.attribute”def Format.attribute (h : Heap) (v : Value) (name : Codes) : OutcomeThe attribute name of the value v on the heap h, in a field name (a property would run a user’s code:
unsupported here).
python.Format.walk
Section titled “python.Format.walk”def Format.walk (fuel : Nat) (h : Heap) (v : Value) (cs : Codes) : OutcomeThe rest cs of a field name after its first part, from the value v on the heap h: .name and [key] in
turn, within fuel steps (CPython’s FieldNameIterator).
python.Format.object
Section titled “python.Format.object”def Format.object (c : Formatting) (numbering : Numbering) (name : Codes) : FoundThe value the field’s name gives among the arguments c, with the fields’ numbering so far.
python.Format.hex
Section titled “python.Format.hex”def Format.hex (width : Nat) (n : Nat) : CodesHexadecimal digits of n, in small letters, at least width of them.
python.Format.ascii
Section titled “python.Format.ascii”def Format.ascii (cs : Codes) : Codesascii() of the repr cs: code points past ASCII as \xNN, \uNNNN or \UNNNNNNNN.
python.Format.convert
Section titled “python.Format.convert”def Format.convert (h : Heap) (conversion : Option Nat) (v : Value) : OutcomeA field’s value v on the heap h converted by its conversion: !r repr, !s str, !a ascii.
python.Built
Section titled “python.Built”data BuiltWhat building a format string gives: the text and the numbering after it, or an exception.
python.Format.build
Section titled “python.Format.build”def Format.build (fuel : Nat) (c : Formatting) (depth : Nat) (numbering : Numbering) (cs : Codes) (out : Codes) : BuiltThe format string cs built after out (CPython’s build_string) from the arguments c, at a recursion depth
with the fields’ numbering so far, within fuel steps: each field’s value converted, its spec built first when it
holds fields, then formatted.
python.Format.render
Section titled “python.Format.render”def Format.render (fuel : Nat) (c : Formatting) (depth : Nat) (numbering : Numbering) (name : Codes) (conversion : Option Nat) (spec : Codes) (expands : Bool) : BuiltOne replacement field rendered (CPython’s output_markup): the field name among the arguments c, with the
fields’ numbering so far, its conversion, and its spec (built at the recursion depth within fuel steps when
it expands).
python.Methods.format
Section titled “python.Methods.format”def Methods.format (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.format(*args, **kwargs) on the str self with the call’s positional and keywords arguments, on the heap
h.
python.Methods.without
Section titled “python.Methods.without”def Methods.without (j : Nat) (xs : List Value) : List ValueThe items xs without the one at the position j.
python.Methods.argument
Section titled “python.Methods.argument”def Methods.argument (positional : List Value) (k : Nat) : ValueThe positional argument at k (None when absent: the check before has made sure it is there).
python.Methods.setAll
Section titled “python.Methods.setAll”def Methods.setAll (pairs : List (Value * Value)) (more : List (Value * Value)) : List (Value * Value)The pairs more set in a dict’s pairs in turn.
python.Format.inName
Section titled “python.Format.inName”def Format.inName (c : Nat) : BoolWhether the code point c continues a field name’s first part or attribute (not . or [).
python.Methods.address
Section titled “python.Methods.address”def Methods.address (self : Value) : NatThe address of the receiver self on the heap.
python.Methods.items
Section titled “python.Methods.items”def Methods.items (h : Heap) (self : Value) : List ValueThe items of the list receiver self on the heap h.
python.Methods.storeList
Section titled “python.Methods.storeList”def Methods.storeList (h : Heap) (self : Value) (xs : List Value) (v : Value) : ChangedThe list receiver self on the heap h with the new items xs, and the value v produced.
python.Methods.outcome
Section titled “python.Methods.outcome”def Methods.outcome (h : Heap) (o : Outcome) : ChangedThe outcome o with the heap h unchanged.
python.Methods.append
Section titled “python.Methods.append”def Methods.append (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedxs.append(x) on the list self with the call’s positional and keywords arguments, on the heap h.
python.Methods.extend
Section titled “python.Methods.extend”def Methods.extend (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedxs.extend(iterable) on the list self with the call’s positional and keywords arguments, on the heap h:
the items the iterable has now.
python.Methods.insertAt
Section titled “python.Methods.insertAt”def Methods.insertAt (size : Nat) (k : Int) : NatThe position k for insert in a list of the length size: from the end when negative, clamped to the list.
python.Methods.insert
Section titled “python.Methods.insert”def Methods.insert (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedxs.insert(i, x) on the list self with the call’s positional and keywords arguments, on the heap h.
python.Methods.pop
Section titled “python.Methods.pop”def Methods.pop (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedxs.pop(i=-1) on the list self with the call’s positional and keywords arguments, on the heap h:
IndexError for an empty list or an index past it.
python.Methods.remove
Section titled “python.Methods.remove”def Methods.remove (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedxs.remove(x) on the list self with the call’s positional and keywords arguments, on the heap h: the
first item equal to x.
python.Methods.sequence
Section titled “python.Methods.sequence”def Methods.sequence (h : Heap) (self : Value) : List ValueThe items of the list or tuple receiver self on the heap h.
python.Methods.sequenceIndex
Section titled “python.Methods.sequenceIndex”def Methods.sequenceIndex (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedxs.index(x[, start[, stop]]) of the list or tuple self with the call’s positional and keywords arguments,
on the heap h: within [start, stop) adjusted to it (None not allowed).
python.Methods.sequenceCount
Section titled “python.Methods.sequenceCount”def Methods.sequenceCount (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedxs.count(x) of the list or tuple self with the call’s positional and keywords arguments, on the heap h.
python.Methods.storeSorted
Section titled “python.Methods.storeSorted”def Methods.storeSorted (h : Heap) (self : Value) (r : Option Raised * List Value) : ChangedThe list self on the heap h stored with its items as a sort left them, then the sort’s exception, if it raised
one (r: the exception and the items; CPython’s list.sort leaves the items as far as it got).
python.Methods.sort
Section titled “python.Methods.sort”def Methods.sort (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedxs.sort(*, key=None, reverse=False) on the list self with the call’s positional and keywords arguments, on
the heap h: reverse by its truth; a key is a user’s code (the caller’s).
python.Methods.listPlain
Section titled “python.Methods.listPlain”def Methods.listPlain (h : Heap) (method : String) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : ChangedA list method of no arguments, by the name method: reverse, clear, copy; on the list self with the
call’s positional and keywords arguments, on the heap h.
python.Methods.ofList
Section titled “python.Methods.ofList”def Methods.ofList : List MethodThe list methods the model provides.
python.Methods.pairs
Section titled “python.Methods.pairs”def Methods.pairs (h : Heap) (self : Value) : List (Value * Value)The pairs of the dict receiver self on the heap h.
python.Methods.storeDict
Section titled “python.Methods.storeDict”def Methods.storeDict (h : Heap) (self : Value) (pairs : List (Value * Value)) (v : Value) : ChangedThe dict receiver self on the heap h with the new pairs, and the value v produced.
python.Methods.key
Section titled “python.Methods.key”def Methods.key (h : Heap) (k : Value) (work : Unit -> Changed) : ChangedThe key k’s check on the heap h, then the method’s work: TypeError for one that is not hashable.
python.Methods.get
Section titled “python.Methods.get”def Methods.get (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedd.get(key, default=None) on the dict self with the call’s positional and keywords arguments, on the heap
h.
python.Methods.dictPop
Section titled “python.Methods.dictPop”def Methods.dictPop (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedd.pop(key[, default]) on the dict self with the call’s positional and keywords arguments, on the heap h:
KeyError when it is not there and there is no default.
python.Methods.setDefault
Section titled “python.Methods.setDefault”def Methods.setDefault (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedd.setdefault(key, default=None) on the dict self with the call’s positional and keywords arguments, on the
heap h.
python.Methods.addPairs
Section titled “python.Methods.addPairs”def Methods.addPairs (h : Heap) (k : Nat) (pairs : List (Value * Value)) (items : List Value) : List (Value * Value) * Option RaisedWhat adding the pairs from the items of an iterable (on the heap h) to the pairs gives, k the number of
the next element for messages: the pairs so far, and the exception that stopped it if one did (the pairs before it
stay, as in CPython).
python.Methods.raised
Section titled “python.Methods.raised”def Methods.raised (o : Outcome) : RaisedThe exception the outcome o raised (a TypeError if it did not raise).
python.Methods.update
Section titled “python.Methods.update”def Methods.update (h : Heap) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedd.update([other, ]**kwargs) on the dict self with the call’s positional and keywords arguments, on the
heap h: a dict’s pairs, or pairs from an iterable (a user’s mapping would run its code: unsupported here), then the
keyword arguments.
python.Methods.dictPlain
Section titled “python.Methods.dictPlain”def Methods.dictPlain (h : Heap) (method : String) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : ChangedA dict method of no arguments, by the name method: keys, values, items (a view), clear, copy; on the
dict self with the call’s positional and keywords arguments, on the heap h.
python.Methods.ofDict
Section titled “python.Methods.ofDict”def Methods.ofDict : List MethodThe dict methods the model provides.
python.Methods.setTable
Section titled “python.Methods.setTable”def Methods.setTable (h : Heap) (self : Value) : SetTableThe table of the set receiver self on the heap h.
python.Methods.storeSet
Section titled “python.Methods.storeSet”def Methods.storeSet (h : Heap) (self : Value) (t : SetTable) (v : Value) : ChangedThe set receiver self on the heap h with the new table t, and the value v produced.
python.Methods.element
Section titled “python.Methods.element”def Methods.element (h : Heap) (x : Value) (work : Unit -> Changed) : ChangedThe item x’s check on the heap h, then the method’s work: TypeError for one that is not hashable,
unsupported for one the user’s __hash__ hashes.
python.Methods.setChange
Section titled “python.Methods.setChange”def Methods.setChange (h : Heap) (method : String) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.add(x), s.remove(x) (KeyError when it is not there), s.discard(x) (the method) on the set self with
the call’s positional and keywords arguments, on the heap h.
python.Methods.operand
Section titled “python.Methods.operand”def Methods.operand (h : Heap) (v : Value) : Heap * Either Raised OperandWhat a set method reads from the argument v on the heap h: a set’s table, a dict’s keys, or an iterable’s
items (every one hashable).
python.Methods.operands
Section titled “python.Methods.operands”def Methods.operands (h : Heap) (others : List Value) (so : List Operand) : Heap * Either Raised (List Operand)The operands of the arguments others in turn on the heap h, after the ones so far; the exception that
stopped it if one did.
python.Methods.combined
Section titled “python.Methods.combined”def Methods.combined (method : String) (t : SetTable) (operands : List Operand) : SetTableThe table the set method named method gives from the receiver’s table t and the operands (CPython’s
set_union, set_intersection_multi, set_difference_multi, set_symmetric_difference).
python.Methods.combine
Section titled “python.Methods.combine”def Methods.combine (h : Heap) (method : String) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changeds.union(*others), intersection, difference, symmetric_difference (exactly one other), by the name
method, on the set self with the call’s positional and keywords arguments, on the heap h.
python.Methods.setPlain
Section titled “python.Methods.setPlain”def Methods.setPlain (h : Heap) (method : String) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : ChangedA set method of no arguments, by the name method: clear, copy; on the set self with the call’s
positional and keywords arguments, on the heap h.
python.Methods.ofSet
Section titled “python.Methods.ofSet”def Methods.ofSet : List MethodThe set methods the model provides.
python.Methods.ofTuple
Section titled “python.Methods.ofTuple”def Methods.ofTuple : List MethodThe tuple methods.
python.Methods.propertyWith
Section titled “python.Methods.propertyWith”def Methods.propertyWith (h : Heap) (method : String) (self : Value) (positional : List Value) (keywords : List (Codes * Value)) : Changedproperty.getter(f), property.setter(f) (the method) on the property self with the call’s positional and
keywords arguments, on the heap h: a new property with that function.
python.Methods.ofProperty
Section titled “python.Methods.ofProperty”def Methods.ofProperty : List MethodThe property methods.
python.Methods.typeAttributes
Section titled “python.Methods.typeAttributes”def Methods.typeAttributes : List (String * List String)The attribute names other than __dunder__ ones each built-in type has in CPython 3.14 (dir()).
python.Methods.isDunder
Section titled “python.Methods.isDunder”def Methods.isDunder (name : String) : BoolWhether a name is __dunder__.
python.Methods.typeHas
Section titled “python.Methods.typeHas”def Methods.typeHas (typeName : String) (name : String) : BoolWhether the built-in type named typeName may have the attribute name in CPython: one of its names, or any
__dunder__ name.
python.Methods.of
Section titled “python.Methods.of”def Methods.of (h : Heap) (self : Value) : List MethodThe methods the model provides for the type of the receiver self on the heap h.
python.Methods.missing
Section titled “python.Methods.missing”def Methods.missing (h : Heap) (self : Value) (name : String) : RaisedReading the attribute name of the value self on the heap h that the model does not provide: unsupported
when CPython’s type has it, AttributeError otherwise (a user’s instance or class: AttributeError as Objects.get
gives it).
python.Methods.call
Section titled “python.Methods.call”def Methods.call (h : Heap) (self : Value) (name : String) (positional : List Value) (keywords : List (Codes * Value)) : Changedself.name(*positional, **keywords) for the built-in method name of the receiver self with the call’s
positional and keywords arguments, on the heap h.
python.Methods.has
Section titled “python.Methods.has”def Methods.has (h : Heap) (self : Value) (name : String) : BoolWhether the model provides a built-in method named name for the receiver self on the heap h.
python.Methods.attribute
Section titled “python.Methods.attribute”def Methods.attribute (h : Heap) (v : Value) (name : String) : AccessReading the attribute name of the value v on the heap h: Objects.get, with a built-in type’s attribute the
model does not provide reported as unsupported rather than AttributeError.