10. Compile errors Setu raises#
What the message says: the cause.
anytypeparameters are not supported: apub fnwith ananytypeparameter is exported- only plain required parameters can come before
py.Rest: a default /?T/ struct /KwOnlybefore*args py.Kwargsmust be the last parameter- more than one
py.KwOnly - the required parameter
bcomes aftera, which has a default: section 1, rule 4 py.KwOnlyafterpy.Restis redundant: after*argseverything is keyword-only alreadypy.Rest/py.Kwargsare not supported here; take onesetu.CallArgsparameter:__new__/__init__/__call__- no default for
xin the source: the argument struct's default is not in the file (structBody) - the argument struct
Optsmust be declared in the same file - can't show the default
...in Python; use a literal,nullor a constant: a default the stub can not render - no
pub fn name(in source / noconst Name = struct {in source: the@embedFileis not the declaration's file pub fn xneeds the entry's.source = @embedFile(...): a function in afromentry withoutsource.onlyand.excludetogether /.onlynamesx, which it does not declarexis in the module twice:a.xandb.x: one Python name from two declarationsA.TandB.Tare the same type: onesetu.Class/setu.Exceptiontype under two names- its base
pkg.Baseis in noModule.fromentry Module.methodsmust end withpy.method_end(or setfrom,versionorinit): a table without its terminator- unsupported parameter type / result type
T: an int over 64 bits, a non-slice pointer, a plain struct result, ... checkErrnotakes a signed intSequence(OwnedBuffer): the items are released with the sequence: useSequence(Buffer)andtaketakeof an owned buffer: it is the function's already- a
py.Bufferhook parameter is never released; take*Objectand convert it in the hook: a buffer /Path/Sequencehook parameter __poll__generates__send__; give one /__send__/__poll__generate__iter__and__next__pickleneeds an instantiable type /T.f: aUcan not be pickled:pickle = truewithinstantiable = falseor a bad fieldclsmust be*c.TypeObject: a class method's first parameter__hash__must return an int /__len__an unsigned int /__next__?R/__int__an int /__float__a float: result types__get__takesinstance: ?*Object, owner: ?*Object- needs
pub const module: setu.Modulein the root file, for the module name: asetu.Classwith nomodulein the root - method
m: parameterpstubs asAny; if it is a Zig-only helper rename it camelCase, else add aTypeentry: 7 - not in the 3.15 stable ABI (abi3t), which Setu builds for: a
c.*tombstone; use the replacement it names