Pyne Edge Profile
Look up the E codes of the Pyne Edge profile check: the Python constructs and types a script outside the profile uses, and how to stay inside it.
E0001: Syntax outside the Edge profile
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
{construct} is not allowed in the Pyne Edge profile.The Pyne Edge profile is the subset of Python that is enough for everything a
Pine Script program needs: every Pine script can be written in it. This
construct is outside it; a full @pyne script can use it.
E0002: Python built-in instead of the Pine one
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` is Python's built-in here, which is not allowed in the Pyne Edge profile. For {meaning}, import it: `from pynecore.lib import {name}`.Without the import, the name means Python’s own built-in, not the Pine function of the same name.
E0003: lambda outside a field default
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`lambda` is allowed only as a `field(default_factory=...)` default of a field.The Pyne Edge profile has no function values. The one lambda it takes
builds a field’s default value.
E0004: assert message that is not a string literal
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
An `assert` message must be a string literal in the Pyne Edge profile.The message is fixed text, as Pine’s own messages are: the profile has no use for one built while the script runs.
E0005: Assignment to a subscript
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
Assigning to a subscript is not allowed in the Pyne Edge profile; use `array.set()`.An array element is set with array.set(id, index, value).
E0006: Import outside the Edge profile
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
{import} is not allowed in the Pyne Edge profile: only the PyneCore API and `lib.*` libraries can be imported.Relative imports, star imports and modules other than the PyneCore API and
the user’s lib.* libraries are outside the profile.
E0007: Decorator outside the Edge profile
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
Only `@script.indicator/strategy/library(...)`, `@method` and `@export` can decorate a function in the Pyne Edge profile.Other decorators change a function while the script runs, which nothing in Pine needs.
E0008: Class outside the Edge profile
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
{detail} A class in the Pyne Edge profile is a `@udt` or `@dataclass` field list with methods, or an enum.A class has exactly one @udt or @dataclass decorator, no base classes or
keywords, and a body of annotated fields and undecorated methods that take
their receiver first.
An enum is the other class form: its single base is StrEnum imported from
enum, it takes no decorator, and its body holds member = 'title'
assignments only.
E0009: Call outside the Edge profile
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` cannot be called in the Pyne Edge profile: only defined functions, imported names and {builtins} can.A call goes to a function of the script, an imported name, or one of the few Python built-ins the profile keeps.
E0010: Attribute set on a function or module
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
Assigning an attribute on `{root}` is not allowed in the Pyne Edge profile: functions and modules are not objects.Only objects of user-defined types have fields to set.
E0011: Double-underscore name
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The name `{name}` is not allowed in the Pyne Edge profile: double-underscore names belong to PyneCore's transform.PyneCore’s transform names its own functions and variables with double underscores, and a Pine script has no such names. Rename the identifier.
E0012: Name without a known type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` has no known type.The Pyne Edge profile types every value the way Pine does. The value this name holds could not be typed; give it a value of a known type, or annotate it.
E0013: Function used as a value
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` is a function, not a value.Pine has no function values: a function is called where it is used, never stored or passed.
E0014: Call without a known type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The call to `{callee}` has no known type.What the called function returns could not be typed. Annotate its return, or the parameters its result depends on.
E0015: Call of an unknown callee
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
This call has no known type.The called expression is not a name, so what it returns cannot be typed. Call a defined function or a lib name.
E0016: Method call without a known type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The call to the method `{method}` has no known type.What the method returns could not be typed. Annotate its return, or its receiver’s type.
E0017: Lib call without a known type here
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` has no known type here.The lib function has no overload for the argument types it gets here. Give its arguments known types.
E0018: Unknown lib name
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` is not a lib name.The name is not part of pynecore.lib. Check its spelling.
E0019: Field without a known type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`.{field}` has no known type on `{type}`.The field could not be typed on this value. Declare the field on a @udt
class.
E0020: Index without a known type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
Indexing `{type}` has no known type.Only a series, a tuple, or an array read through array.get() can be indexed
with a known result type.
E0021: Operation without a known type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{expression}` has no known type over {operands}.The operation does not take these operand types together. Give the operands types the operation accepts.
E0022: Expression outside Pine
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{expression}` is not a Pine expression.The expression has no Pine counterpart. Write it with Pine constructs only.
E0023: Two types for one value
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
{what} gets both `{first}` and `{second}`, which are different types.A Pine variable has one type. Make every branch, or every assignment, give it the same type.
E0024: Starred unpacking target
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
A starred target takes an unknown number of elements, which Pine has no form for.Unpack exactly as many names as the tuple has elements.
E0025: Unpacking count mismatch
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{type}` has {count} elements, and this unpacks {names}.Unpack as many names as the tuple has elements.
E0026: Overload differs per call context
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The overload chosen for this call differs per call context: {pins}.The same call site would take a different overload depending on where its function is called from. Annotate the parameters so every call site agrees.
E0027: Conversion differs per call context
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The implicit conversion of a value differs per call context, and not every instance can be given its own.Annotate the parameters so every call site passes the same types.
E0028: Collection operand without a known type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{type}` takes an operand whose type is not known here, so what it holds afterwards is not known either.Give the operand a known type.
E0029: Collection operand of another element type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{type}` cannot take `{other}`: the elements are different types.Pass a collection of the same element type.
E0030: Function name assigned
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` is assigned as well as defined, so what it calls is unknown.A call is typed from the function its name defines. Call it under a name nothing assigns to.
E0031: Name imported twice
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` is imported more than once, so what it calls is unknown.Import the name once, under a name nothing else binds.
E0032: Imported name assigned
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` is assigned as well as imported, so what it calls is unknown.Call the import under a name nothing assigns to.
E0033: Re-entrant call
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{function}` is re-entrant, so its result type is unknown.A recursive call is typed from the function’s annotations. Annotate the parameters and the return of the recursive function.
E0034: Too many call contexts
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{function}` hit the per-module context limit.The function is called with too many distinct argument types. Call it with fewer, or annotate its parameters.
E0035: Import without annotations
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` is imported from `{source}`, where its parameters carry no annotations, so what it returns is unknown.An imported function is typed from its annotations. Annotate its parameters in the module it comes from.
E0036: Import of a reported module
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{module}` is reported, and no type it publishes may drive a dispatch here: {reason}.The imported module has errors of its own. Fix that module first.
E0037: Import cycle
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{module}` imports this module back, so its signatures are not available yet.Break the import cycle between the two modules.
E0038: For loop over a non-iterable
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{expression}` is a `{type}`; a for loop iterates a range or an array.Loop over range(...) or an array.
E0039: Indexing outside Pine
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
Indexing `{type}` is not Pine.Read elements with array.get, matrix.get or map.get.
E0040: History of a plain value
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{expression}` is a plain `{type}`, not a series.Only a series keeps its history. Declare the variable as a Series to read
its past values.
E0041: Assignment of another type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` is declared `{declared}` and assigned `{assigned}`.Declare the variable with the type it is assigned, or assign the declared type.
E0042: Field assigned another type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{field}` holds `{declared}` and is assigned `{assigned}`.Assign a value of the field’s type.
E0043: Unknown function
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` is not a function this module defines or imports, nor a lib name.Define the function, import it, or call a lib name.
E0044: Callee is not a name
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The callee is not a name.Call a defined function or a lib name.
E0045: Field of a value of unknown class
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The class of `{value}` is not known here, so its field `{field}` has no type.Annotate the value with the type it holds.
E0046: Method of a value of unknown class
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The class of `{value}` is not known here, so its method `{method}` has no type.Annotate the receiver with the type it holds.
E0047: Field set on a value of unknown class
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The class of `{value}` is not known here, so its field `{field}` cannot be checked.Annotate the value with the type it holds.
E0048: Unknown field
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{owner}` has no field `{field}`.Declare the field on the class, or use a field it has.
E0049: Field set on a value without fields
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
A `{type}` has no field `{field}` to assign.Only objects of a @udt class have fields to set.
E0050: Unknown loop counter field
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The loop counter has no field `{field}`.Read value or entering, or call step or enter.
E0051: Lib namespace called
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` is a lib namespace, not a function.Call a function in the namespace.
E0052: Lib value called
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{name}` is a lib value, not a function.Read the value without calling it.
E0053: Unknown method
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{method}` is not a method of `{type}` here.Declare the method on the receiver’s class, or call a method its type has.
E0054: Method not reachable by name
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{method}` is declared on `{type}`, but no export the runtime searches by name holds it.Pass the method itself: method_call(method, receiver, ...).
E0055: Loop bounds without a known type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The bounds of `{expression}` are not known here, so its counter has no type.Give the loop bounds known numeric types.
E0056: Bound is not a number
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{function}` takes a number for a bound, `{type}` passed.Pass int or float bounds.
E0057: step() arity
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`step` takes 1 argument, {count} passed.Pass the bound: step(to).
E0058: enter() arity
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`enter` takes 0 or 1 argument(s), {count} passed.Pass the step: enter(by).
E0059: method_call() arguments
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`method_call` takes a method and a receiver.Spell it method_call(method, receiver, ...).
E0060: Wrong number of arguments
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{function}` does not take {count} argument(s).Call the function the way it is declared.
E0061: Too few arguments
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{function}` does not take {count} argument(s) (at least {least} needed).Pass every argument the function needs.
E0062: Wrong number of positional arguments
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{function}` takes {positional} positional argument(s), {count} passed.Call the function the way it is declared.
E0063: Unknown parameter
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{function}` has no parameter `{parameter}`.Pass only the parameters the function declares.
E0064: Argument of another type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{function}` takes `{declared}` for `{parameter}`, `{passed}` passed.Pass a value of the declared type.
E0065: No matching overload
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
No overload of `{function}` takes these arguments.Call it with argument types one of its overloads declares.
E0066: Argument passed twice
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{parameter}` is passed to `{function}` twice.Pass each argument once.
E0067: Missing argument
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{function}` needs an argument for `{parameter}`.Pass every parameter that has no default.
E0068: Wrong number of constructor arguments
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{type}` has {fields} field(s), {count} argument(s) passed.Pass at most one argument per field.
E0069: Missing field value
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{type}` needs a value for `{field}`.Pass every field that has no default.
E0070: Field value of another type
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
`{field}` holds `{declared}`, `{passed}` passed.Pass a value of the field’s type.
E0071: Overload not decidable
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
Argument {argument} of `{function}` has no known type, so the overload this call runs is not decided.An overloaded function is called with an argument whose type the analysis does
not know: an instance of a plain class instead of a @udt one, or the value of
a helper without a return annotation. Which overload runs is then decided from
the values at run time, and an argument no overload takes stops the run there.
Give the argument a known type: annotate it, or make its class a @udt.
E0072: Overload not decidable
| Severity | PyneCore raises |
|---|---|
| error | SyntaxError |
Message:
The argument types of `{function}` do not decide one overload for this call.The static types of the arguments leave more than one overload of the function, or none the analysis can read, for this call. Which overload runs is then decided from the values at run time. Annotate the overloads’ parameters, or pass arguments whose types name one overload.