Builtins¶
- Lowercase constants:
false,none,true - Basic types, listed in the order each is first defined:
bool,int,float,complex,str(see also itsbin/oct/hexfactories), andBytes,ByteArray, andMemoryView— the last three capitalized like any other class, and constructed the same way any other class is, through their own default factory (Bytes(x)), with no separate lowercase conversion function.bool/int/float/complex/strstay lowercase instead — the deeper consistency an all-capsInt/Strwould buy costs a human reader decades ofint/strhabit to unlearn, for a distinction an LLM reader has no such habit to notice in the first place - Capability traits, the main ABC-equivalent nominal traits (see
No structural traits), listed in
the order each is first defined:
Callable,Eq,Ord,Hashable,Sized,Iterable,Iterator,Reversible,Set,Container,Collection,Sequence, andBuffer - Special types, built outside the ordinary class system, listed in
the order each is first defined:
object,Arguments,Parameters,SourceLocation,VarName,Sentinel,Self,DottedPath, andModule
Builtin functions¶
abs,round,len— kept, each dispatched through the capability trait that already covers it (SupportsAbs[K],SupportsRound[K],Sized) rather than a single hardcoded signature —absreturnsintfor anintandfloatfor acomplex, the type-level consequence of dispatching on the argument's own type instead of calling one fixed method.fields— walks a class's, trait's, or module's own members, dispatched on which it's given (an instance or the class itself included), replacing both Python'svars()(no__dict__to return) anddir()(an ordered, documented walk instead of an unordered list of bare names).asdict— flattens a record you already have, anonymous or a named class instance, into a plaindict[str, object]by walkingfields(); not a way to originate one — the linter prefers{"x": 0}overasdict((x=0))whenever nothing else uses the record itself.zip— always strict. Mismatched-length iterables are a runtime error, never silent truncation to the shortest — the same class of mistakeassert's required parentheses closes elsewhere, just for iteration instead of assertion. Python's ownzipneeds an explicitstrict=Trueto opt into this; Lucid has no other mode.any,all— kept as ordinary functions.anythe function andanythe keyword (Existential types) are distinguished the same waytype/match/notalready are elsewhere: by position.any(xs)is a call;any Traitis bare, no parentheses, and never appears where a call would.iter,locals,format,hash,help,sum,reversed,repr,print,enumerate,map,max,min,sorted,slice,getattr,setattr,hasattr— kept, unchanged.list,set,dict— construction takes exactly the one positional argument Python's own signature already allows — an iterable, or fordict, a mapping — never a second positional argument, and never a keyword argument. Python'sdict()folds five different call shapes into one name — no arguments, a mapping, an iterable of pairs, keyword arguments, and combinations of a mapping or pairs with keyword arguments, each with its own rule for which value wins on a key collision. Lucid already has one way to build a collection from an unpacked source — a literal with*/**spread,[*a]or{**kw}— so the constructor call never needs to be a second.pow— kept, but multiple-dispatch, one case per base type, so the zero-base, negative-exponent case returns each type's owninfinstead of raising, the same trade floor division and modulo already make.super— kept, but takes no parentheses:super.save(), notsuper().save(). A class has at most one class parent, so calling through to the overridden implementation is never ambiguous the way it can be in Python's own cooperative multiple inheritance — there's nothing to call, only the one parent to name.
Removed builtins covers the rest of Python's
builtins module: the names a specific design decision elsewhere in
this spec actually removes or replaces.