AveyTense Glossary

This page describes various definitions used in the AveyTense documentation. See also Python glossary.
abroad convection

In AveyTense terminology, abroad convection is an addition operation of integers and floating-point numbers with iterable objects' lengths with the static method aveytense.abroad.convect() being one of the alternative constructors of class aveytense.abroad. This way, a new aveytense.abroad object is created.

Take one example:

$k[from] $m[aveytense] $k[import] abroad $f[print]($c[list](abroad.$f[convect]($n[35], "joyride", ("abroad",))))

This would be passed to the constructor of aveytense.abroad as:

abroad($n[35] + $f[len]("joyride") + $f[len](("abroad",)))

And once the object is printed in the output, that's:

abroad(0, 43, 1)
abroad sequences

Abroad sequences are immutable integer sequences created by a constructor of class aveytense.abroad. These can be considered as integer tuple objects.
backport

This term is often used in AveyTense documentation. It refers to an action of adding features that were added lately for older versions (there versions of Python). These features may include from single parameter changes to adding entire definitions. It is sometimes necessary to conduct backporting, since not all applications support latest (Python) versions. Backporting is usually bound with re-definining entire definitions to support features that we want to support for older versions. This allows to have confidence that these features will work and there is no need to worry much about the used version (of Python). Many users may get confused why specific code doesn't work, because it is dependent to the used version, and some definitions were just added later.

Many libraries use this term pointing at the action of re-adding features for older versions.

For example: itertools.batched exists since Python 3.12, and its keyword-only parameter strict - since Python 3.13. For users that are stuck with older versions of Python and want to use this definition, there is a solution: aveytense.extensions.batched, supported for Python 3.8 and later.
flexible sequence objects

These functions return sequence objects without caring if the passed argument is iterable or not.

Flexible sequence functions start with the prefix flexible and are part of the aveytense.util module. Current content: aveytense.util.flexiblelist(), aveytense.util.flexibletuple(), aveytense.util.flexibleset(), aveytense.util.flexiblefrozenset().

pure functions
This kind of functions return internally modified version of one or more parameter values usually by copying the values to internal variables, however, without modifying parameter values passed. Examples of pure functions: ~.Tense.append(), ~.Tense.extend(), ~.Tense.reverse(), ~.Tense.shuffle(). Consider the following invocation: $k[from] $m[random] $k[import] $f[shuffle] $v[a] $o[=] [$n[72], $n[83], $n[36], $n[48]] $f[shuffle]($v[a]) $t[Tense].$tm[print]($v[a]) # [48, 72, 83, 36] If random.shuffle() modified the list instance (there a), that means this function isn't pure. Meanwhile with ~.Tense.shuffle() returned is reversed copy of the sequence: $k[from] $m[aveytense] $k[import] $t[Tense] $v[a] $o[=] [$n[72], $n[83], $n[36], $n[48]] $v[b] $o[=] $t[Tense].$tm[shuffle]($v[a]) $t[Tense].$tm[print]($v[a], $v[b]) # [72, 83, 36, 48], [48, 72, 83, 36] Thereupon aveytense.Tense.shuffle() class method is pure, because it returns modified version of the target sequence.
sequence-like objects

A sequence-like object is an object of either collections.abc.Sequence, collections.abc.Set or collections.abc.ValuesView, given in the type alias aveytense.extensions.SequenceLike.

The main purpose of this definition is a definition that would describe iterable objects that are not mapping objects, and extend support for objects that aren't instances of classes being subclasses of collections.abc.Sequence and collections.abc.Set. When any iterable object including mapping objects are supported in some functions, the effects may be sometimes misunderstanding judging how mapping objects work. Mapping objects themselves are not sequence objects, because collections.abc.Mapping does not inherit from collections.abc.Sequence.

Mapping objects suffer from consecutive integer indexing anomaly due to their structure. Since key in any pair can be anything, it doesn't need to be an integer or follow the item indexing as in case of sequence objects. The solution was to add support for mapping view objects instead.

Examples of sequence-like objects: instances of list, tuple, set, str, bytes, bytearray, memoryview, range, array.array, mapping_object.items(), mapping_object.keys(), mapping_object.values().

tilde (~)
Documentation-exclusive; refers to aveytense module mostly; also used to keep accordance with tense before 0.3.40. If ~ is used in a class or module documentation, then it can point to that class/module. This is done lazily to decrease effort on writing entire names.

This term is deprecated since full names are being provided.
unique sequence objects

These functions return sequence objects without duplicate items, however, unlike set objects, these do not lose the order of items (in case of dictionary objects without duplicate values since keys are overriden).

Unique sequence functions start with the prefix unique and are part of the aveytense.util module. Current content: aveytense.util.uniquelist(), aveytense.util.uniquetuple(), aveytense.util.uniquestr(), aveytense.util.uniquedict().

universal iterable objects

This definition refers to both synchronous iterable (or just iterable) and asynchronous iterable objects.

Example functions where universal iterable objects can be passed are aveytense.Tense.generator() and aveytense.Tense.extend()

universal parameters
This kind of parameters can be passed either via position or keyword. Placement isn't hard to recognize. def f( [...POSITIONAL_PARAMS, /], [...UNIVERSAL_PARAMS], [*[VARIABLE_ARG]], [...KEYWORD_PARAMS], [**VARIABLE_KWARG] ): Word universal is used in properties in class aveytense.util.ParamVar as their prefix.
Site created by Aveyzan on 31st July 2022