AveyTense

AveyTense is a project written in Python. Mostly provides extensions to inbuilt Python solutions that can shorten the code and solve various problems.

© 2024-Present Aveyzan // License: MIT For example it is possible to inspect many attributes in an object with many uses of hasattr() inbuilt function: $f[hasattr](o, $s[attr1]) $k[or] $f[hasattr](o, $s[attr2]) $k[or] $f[hasattr](o, $s[attr3]) $k[or] $k[...] $f[hasattr](o, $s[attrN]) It is possible to do it simplier: $k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[hasattr](o, ($s[attr1], $s[attr2], $o[...], $s[attrN])) To do the same with the and keyword, there is version with mode parameter set to "and" or aveytense.Tense.AND: $k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[hasattr](o, ($s[attr1], $s[attr2], $o[...], $s[attrN]), $s[and]) $t[Tense].$tm[hasattr](o, ($s[attr1], $s[attr2], $o[...], $s[attrN]), $p[mode] $o[=] $s[and]) These definitions are there to faciliate things! Not intended to be a malware in any way.

Declaration Naming

Naming in AveyTense differs from PEP 8. In global scope: In local scope notations vary. Usually functions follow Python's function naming syntax, and variables can be singly underscored around.

Versioning

See PEP 440. Packaging system doesn't feature local version syntax. That means syntax is following: [N!]N(.N)*[{a|b|rc}N][.postN][.devN] syntax as in pep 440 (\d+\!)?\d+(\.(\d)+)*((a|b|rc)(\d)+)?(\.post(\d)+)?(\.dev(\d)+)? syntax with regular expression

Versions & Download

Current AveyTense version is 0.3.52 (18th Aug 2025).

Below ways how to download AveyTense:

Since 0.3.26rc1
Before you install AveyTense, ensure you have Python 3.8 or higher installed. Then run following command: $c[pip] $c[install] $m[aveytense] pip command for AveyTense has been provided on 6th August 2024. In the result, AveyTense project will be installed, along with typing_extensions project. AveyTense requires typing_extensions 4.10.0 or higher. And you're set! If you happen to be out-of-date, use the command below: $c[pip] $c[install] --upgrade $m[aveytense] Now you can import module aveytense! Before 0.3.40, main module was called tense. For backward compatibility, consider using the import statement in the following way: # ≥ 0.3.40 $k[import] $m[aveytense] $k[as] $m[tense] # < 0.3.40 $k[import] $m[tense]

Yanking PyPi project versions will happen presumably since 2026, and this has to force people to migrate to newer versions, since previous versions do not offer everything newer versions do.

All AveyTense versions available on PyPi

* - projected versions; their upload dates may vary

Issues send either to my email or sending an issue to the repository.
Before 0.3.26rc1
Versions preceding 0.3.26rc1 were able to be downloaded only as ZIP or 7Z files. Due to loose of support sooner or later, you are encouraged to download newer versions of AveyTense. To install older versions, scroll down and track versions before 0.3.26rc1 (7th August 2024). Last versions downloadable as ZIP and 7Z files will lose support on 2026.

Extracted files are preferred to be placed in the same directory as the folder you are working on; it isn't recommended to extract them to the site-packages Python folder, which hoards installed PyPi projects. Before AveyTense 0.3.30, there were 2 ways to install the library: with PyPi and with traditional zip/7-zip installation. Second method is no longer maintained, consider frequently updating the library via the command pip install --upgrade aveytense.

After orientation of publishing next versions of AveyTense to PyPi in version 0.3.30, subsequent updates are no longer available via file ./tense/information/changes.txt. Everything new is now provided in this Google document.
* planned upload date or AveyTense inclusions may be invalid and may differ in the officla publications

Releases Upload date End-of-Life Languages Status Zip 7-Zip
0.3.29 3rd Dec 2024 * (as 0.3.28a2)
archive: 27th Nov 2024
PyPI: 27th Nov 2024
- Python Lend! Lend!
0.3.28 23rd Nov 2024 * (as 0.3.28a1)
archive: 23rd Nov 2024
PyPI: 23rd Nov 2024
- Python Lend! Lend!
0.3.27 13th Nov 2024 *
archive: 11th Nov 2024
PyPI: 22nd Nov 2024
- Python Lend! Lend!
0.3.27rc2 3rd Nov 2024 *
archive: 27th Oct 2024
PyPI: 27th Oct 2024
- Python Lend! Lend!
0.3.27rc1 23rd Oct 2024 *
archive: 19th Oct 2024
PyPI: 20th Oct 2024
- Python Lend! Lend!
0.3.27b3 13th Oct 2024 *
archive: 13th Oct 2024
PyPI: 13th Oct 2024
- Python Lend! Lend!
0.3.27b2 3rd Oct 2024 *
archive: 26th Sep 2024
PyPI: 26th Sep 2024
- Python Lend! Lend!
0.3.27b1 23rd Sep 2024 *
archive: 23rd Sep 2024
PyPI: 23rd Sep 2024
- Python Lend! Lend!
0.3.27a5 archive: 13th Sep 2024
PyPI: 13th Sep 2024
- Python Lend! Lend!
0.3.27a4 archive: 9th Sep 2024
PyPI: 9th Sep 2024
- Python Lend! Lend!
0.3.27a3 archive: 2nd Sep 2024
PyPI: 3rd Sep 2024
- Python Lend! Lend!
0.3.27a2 archive: 28th Aug 2024
PyPI: 29th Aug 2024
- Python Lend! Lend!
0.3.27a1 archive: 27th Aug 2024
PyPI: 27th Aug 2024
- Python Lend! Lend!
0.3.26 archive: 24th Aug 2024
PyPI: 26th Aug 2024
- Python Lend! Lend!
0.3.26rc3 archive: 21st Aug 2024
PyPI: 21st Aug 2024
- Python Lend! Lend!
0.3.26rc2 archive: 15th Aug 2024
PyPI: 16th Aug 2024
- Python, Java Lend! Lend!
0.3.26rc1 archive: 7th Aug 2024
PyPI: 7th Aug 2024
- Python, Java Lend! Lend!
0.3.26b3 29th Jul 2024 31st Aug 2025 Python, Java Lend! Lend!
0.3.26b2 25th Jul 2024 31st Aug 2025 Python, Java Lend! Lend!
0.3.26a4 24th Jul 2024 31st Aug 2025 Python, Java Lend! Lend!
0.3.26b1 23rd Jul 2024 31st Aug 2025 Python, Java Lend! Lend!
0.3.26a3 22nd Jul 2024 31st Aug 2025 Python, Java Lend! Lend!
0.3.26a2 21st Jul 2024 31st Aug 2025 Python, Java Lend! Lend!
0.3.26a1 20th Jul 2024 31st Aug 2025 Python, Java Lend!
0.3.25 19th Jul 2024 29th Jun 2025 Sass (CSS), TS, JS, C++, C#, Java, Python, PHP, Lua no support
0.3.24 29th Jun 2024 29th Jun 2025 Sass (CSS), TS, JS, C++, C#, Java, Python, PHP, Lua no support
0.3.23 18th Mar 2024 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.22 28th Jan 2024 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.21 10th Dec 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.20 16th Nov 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.19 21st Oct 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.18 27th Sep 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.17 13th Sep 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.16 2nd Sep 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.15 13th Aug 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.14 31st Jul 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.13 12th Jun 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.12 29th May 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.11 14th May 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.10 10th May 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.9 1st May 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.8 14th Apr 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.7 2nd Apr 2023 27th Nov 2024 Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua no support
0.3.6 26th Mar 2023 27th Nov 2024 Sass, TypeScript, C++, C#, Java, Python, PHP, Lua no support
0.3.5 5th Mar 2023 27th Nov 2024 Sass, TypeScript, C++, C#, Java, Python, PHP, Lua no support
0.3.4 23th Feb 2023 20th Jul 2024 Sass, TypeScript, C++, C#, Java, Python, PHP, Lua no support
0.3.3 14th Feb 2023 20th Jul 2024 Sass, TypeScript, C++, C#, Java, Python, PHP, Lua no support
0.3.2 5th Feb 2023 20th Jul 2024 Sass, TypeScript, C++, C#, Java, Python, PHP, Lua no support
0.3.1 30th Jan 2023 20th Jul 2024 Sass, TypeScript, C++, C#, Java, Python, PHP, Lua no support
0.3.0 18th Jan 2023 20th Jul 2024 Sass, TypeScript, C++, C#, Java, Python, PHP, Lua no support
0.2.16 15th Jan 2023 19th Jul 2024 Sass, TypeScript, C++, C#, Java, PHP, Lua no support
0.2.15 13th Jan 2023 19th Jul 2024 Sass, TypeScript, C++, C#, Java, PHP, Lua no support
0.2.14 9th Jan 2023 19th Jul 2024 Sass, TypeScript, C++, C#, Java, PHP, Lua no support
0.2.13 8th Jan 2023 19th Jul 2024 Sass, TypeScript, C++, C#, Java, PHP, Lua no support
0.2.12 6th Jan 2023 19th Jul 2024 Sass, TypeScript, C++, C#, Java, PHP, Lua no support
0.2.11 31st Dec 2022 19th Jul 2024 Sass, TypeScript, C++, C#, Java, PHP, Lua no support
0.2.10 28th Dec 2022 19th Jul 2024 Sass, TypeScript, C++, C#, Java, PHP, Lua no support
0.2.9 25th Dec 2022 19th Jul 2024 Sass, TypeScript, C++, C#, Java, PHP, Lua no support
0.2.8 23rd Dec 2022 19th Jul 2024 Sass, TypeScript, C++, C#, Java, PHP, Lua no support
0.2.7 18th Dec 2022 19th Jul 2024 TypeScript, C#, Java, PHP, Lua no support
0.2.6 13th Dec 2022 19th Jul 2024 TypeScript, C++, Java, PHP, Lua no support
0.2.5 9th Dec 2022 19th Jul 2024 TypeScript, C++, Java, PHP, Lua no support
0.2.4 3rd Dec 2022 2nd Sep 2023 TypeScript, C++, Java, PHP, Lua no support
0.2.3 29th Nov 2022 2nd Sep 2023 TypeScript, C++, Java, PHP, Lua no support
0.2.2 23th Nov 2022 2nd Sep 2023 TypeScript, C++, PHP, Lua no support
0.2.1 19th Nov 2022 5th Feb 2023 TypeScript, C++, PHP no support

AveyTense Declarations

Changes in the project are included in this Google document. As an explanation, there are symbols used to mark availability of all declarations:

Root of AveyTense project is aveytense.

Table of Contents (unfinished)

Qualified name Lifetime
aveytense | tense <
aveytense.ChangeVar
aveytense.CMYK
aveytense.Color
aveytense.Colors
aveytense.Colour
aveytense.Colours
aveytense.Math
aveytense.RGB
aveytense.Tense
aveytense.TenseOptions
aveytense.abroad()
aveytense.constants
aveytense.constants.JS_MAX_SAFE_INTEGER
aveytense.constants.JS_MAX_VALUE
aveytense.constants.JS_MIN_SAFE_INTEGER
aveytense.constants.JS_MIN_VALUE
aveytense.exceptions
aveytense.operators
aveytense.types
aveytense.util
aveytense.util.Abstract
aveytense.util.AbstractFinal
aveytense.util.AbstractFrozen
aveytense.util.AbstractMeta
aveytense.util.Final
aveytense.util.FinalVar
aveytense.util.FinalVarType
aveytense.util.MutableString
aveytense.util.ParamVar
aveytense.util.SortedList
@aveytense.util.abstractclassmethod
@aveytense.util.abstractmethod
@aveytense.util.abstractstaticmethod
@aveytense.util.finalproperty
@aveytense.util.finalpropertycontainer
aveytense.util.uniquelist
aveytense.util.uniquetuple
Removed definitions
aveytense.Tense.abroadImmutable(); <
aveytense.Tense.error(); <
aveytense.Tense.upgrade(); <
aveytense.Tense.versionId?; <
aveytense.constants.MC_DURABILITY; <
aveytense.constants.MC_ENCHANTS; <
aveytense.constants.SMASH_HIT_CHECKPOINTS; <
aveytense.constants.VERSION; <
aveytense.constants.VERSION_ID?; <
aveytense.constants.VERSION_INFO; <
aveytense.constants.VERSION_INFO_TYPE; <
aveytense.constants.VERSION_LIST; <
aveytense.extensions.ANSIColor; <
aveytense.games.Minesweeper; <
aveytense.util.StrictEnum; <

Submodules

Note: local submodules preceded with underscore aren't counted in the list, since their components may be imported via public submodules anyway. Keep that on mind!
aveytense.constants (≥ 0.3.26rc3)
Math constants (since 0.3.35 also contains enum members to shorten code when providing these to specific functions)
aveytense.exceptions (≥ 0.3.44)
Provides custom exception classes
aveytense.extensions (≥ 0.3.24; < 0.3.26rc1)
Extensions of AveyTense, removed as it was useless and possibly unrelated. It was the submodule where tests on ANSIColor occurred, before class aveytense.Color replaced that class utterly.
aveytense.games (≥ 0.3.31; < 0.3.47)
Submodule for entertainment. Most declarations were affiliated with class Games, which is featured in this submodule. Removed to be in separate, projected PyPi project aveytense_games.
aveytense.operators (≥ 0.3.27a3)
Extension of operator Python standard library.
aveytense.primary (≥ 0.3.24; < 0.3.26rc3)
The submodule where abroad() and reckon() functions were defined; name changed so the submodule will be never imported. This allows to shorten the import statement (since only aveytense module import is required).
aveytense.tcs (≥ 0.3.25?; < 0.3.26rc3)
This submodule featured constants and types collection (also the meaning of this alias). It has been replaced by 2 different submodules: aveytense.constants and aveytense.types_collection.
aveytense.types (≥ 0.3.27a4)
Features types and abstract classes from various Python modules. These come mostly from following modules:

Backward-compatibility is included, up to Python 3.8. Type subscription since 0.3.52 is restricted to type aliases starting with prefix AVT_.

0.3.52: Renamed from aveytense.types_collection to current name.
aveytense.util (≥ 0.3.34)
Contains utility classes to create abstract, final and frozen classes, abstract and final methods, as well as final variables.

Constants

Most constants since 0.3.35 are located in submodule aveytense.constants.
aveytense.constants.JS_MAX_SAFE_INTEGER (≥ 0.3.26b3)
Returns the greatest safe integer in JavaScript, thats 9007199254740991 (253 - 1). See also Number.MAX_SAFE_INTEGER. 0.3.50: this constant may occur as ~.Math.JS_MAX_SAFE_INTEGER rather than in current form.
aveytense.constants.JS_MAX_VALUE (≥ 0.3.26b3)
Returns the greatest number value that can be represented in JavaScript before evaluation hits Infinity, thats 21024 - 2971 (1.797693... * 10308; exact value). See also Number.MAX_VALUE. 0.3.50: this constant may occur as ~.Math.JS_MAX_VALUE rather than in current form.
aveytense.constants.JS_MIN_SAFE_INTEGER (≥ 0.3.26b3)
Returns the least safe integer in JavaScript, thats -9007199254740991 (-253 - 1). See also Number.MIN_SAFE_INTEGER. 0.3.50: this constant may occur as ~.Math.JS_MIN_SAFE_INTEGER rather than in current form.
aveytense.constants.JS_MIN_VALUE (≥ 0.3.26b3)
Returns the least number value that can be represented in JavaScript before evaluation hits 0, thats 2-1074 (4.940656... * 10-324; exact value). See also Number.MIN_VALUE. 0.3.50: this constant may occur as ~.Math.JS_MIN_VALUE rather than in current form.
aveytense.constants.MC_DURABILITY (≥ 0.3.26b3; < 0.3.41)
Returns duralibility of all tools in Minecraft as for version 1.21.5.

0.3.37: this constant is now instance of local class holding final properties representing items.
Earlier, it was a string-key-integer-value dictionary. 0.3.41: renamed this constant to ~.games.Minecraft.durability. aveytense.games submodule has been revoked in 0.3.47 to be in separate project aveytense_games. 0.3.41
aveytense.constants.MC_ENCHANTS (≥ 0.3.26b3; < 0.3.41)
Returns 42 (amount of enchantments in Minecraft as for version 1.21.5). 0.3.41: renamed this constant to ~.games.Minecraft.enchantments. aveytense.games submodule has been revoked in 0.3.47 to be in separate project aveytense_games. 0.3.41
aveytense.constants.SMASH_HIT_CHECKPOINTS (≥ 0.3.26b3; < 0.3.47)
Returns 13 (Smash Hit has 12 checkpoints + 1 endless). 0.3.47
aveytense.constants.STRING_BINARY (≥ 0.3.36)
Returns 0-1 in a string.
aveytense.constants.STRING_DIGITS (≥ 0.3.36)
Returns 0-9 in a string.
aveytense.constants.STRING_HEXADECIMAL (≥ 0.3.36)
Returns 0-9a-fA-F in a string.
aveytense.constants.STRING_LETTERS (≥ 0.3.36)
Returns a-zA-Z in a string.
aveytense.constants.STRING_LOWER (≥ 0.3.36)
Returns a-z in a string.
aveytense.constants.STRING_OCTAL (≥ 0.3.36)
Returns 0-7 in a string.
aveytense.constants.STRING_SPECIAL (≥ 0.3.36)
Returns all characters not being a letter nor digit, in a string.
aveytense.constants.STRING_UPPER (≥ 0.3.36)
Returns A-Z in a string.
aveytense.constants.VERSION (≥ 0.3.26b3; < 0.3.47)
Returns currently used version of AveyTense in a string. E.g. for 0.3.34 it will be "0.3.34". It is identical value as from PyPi.

0.3.36 0.3.47: Instead use aveytense.Tense.version.
aveytense.constants.VERSION_ID (≥ 0.3.26b3?; < 0.3.36)
Returns integer value being identifier of current version (counted via length of VERSION_LIST minus 1). This is helper constant along with VERSION_INFO; easier to inspect with if statements. For 0.3.34 it returns 70.

0.3.35: consider using VERSION_INFO instead. This constant is weak even, if it based on length of VERSION_LIST tuple.

0.3.36
aveytense.constants.VERSION_LIST (≥ 0.3.26b3; < 0.3.36)
Returns tuple of versions uploaded since version 0.2.1 (19th November 2022), including this version itself.

0.3.35: consider using VERSION_INFO instead. This constant seems to be enforced since not all versions are required to be included in a sequence, because they all appear on this page. It is also more difficult to inspect these versions via this constant anyway.

0.3.36
aveytense.constants.VERSION_INFO (≥ 0.3.26b3; < 0.3.47)
Returns tuple containing all version components concerning current version of AveyTense. This sequence consists of following segments: major, minor, micro, release level. If release level doesn't have value "final", then additional integer item known as serial is added. Sometimes, even if release is final, it may have value 0. E.g. for 0.3.34 it will be (0, 3, 34, "final"), meanwhile for 0.3.27rc1 it would be (0, 3, 27, "candidate", 1). Purpose of this constant is the same as inspection of sys.version_info with if statements.

0.3.35: renamed from VERSION_TUPLE to VERSION_INFO.

0.3.36

0.3.40: this constant is now instance of local class, which features more detailed information concerning currently used version of AveyTense. 0.3.47: Instead use aveytense.Tense.versionInfo.
type aveytense.constants.VERSION_INFO_TYPE (≥ 0.3.36; < 0.3.47)
Type of aveytense.constants.VERSION_INFO. Probable intend of this type was inspecting ~.constants.VERSION_INFO with isinstance() inbuilt function. It is worth noticing ~.constants.VERSION_INFO_TYPE refers to internal abstract class (~.constants._VERSION_INFO), and the class itself is abstract to disallow custom versioning via its constructor. 0.3.47: Instead use type(~.constants.VERSION_INFO)

Classes and type aliases

Classes are scattered around AveyTense library.
class aveytense.util.Abstract
≥ 0.3.26b3

Creates an abstract class via inheritance.

This class is different to abc.ABC. abc.ABC class marks subclass abstract only when there are methods decorated with decorator @abc.abstractmethod. In case of ~.Abstract, class is always marked abstract, no matter if there are abstract methods or not (reference to abstract classes in TypeScript and PHP with abstract class keywords). The class doesn't inherit and isn't the same as abc.ABC, what means issubclass(~.Abstract, abc.ABC) returns False. Example how to create an abstract class:

$k[from] $m[aveytense].$msu[util] $k[import] $cut[Abstract] $k[class] $c[Test]($cut[Abstract]): $o[...] $v[test] $o[=] $c[Test]() # InitializedError: attempt to initialize an abstract class 'Test'

If you want to do the same, but with abstract methods, you would want to use abc.ABC class with @abc.abstractmethod decorator instead.

$k[from] $m[abc] $k[import] $c[ABC], $f[abstractmethod] $k[class] $c[Test]($cex[ABC]):   @$f[abstractmethod]   $k[def] $f[method]($p[self]):     $o[...] 0.3.27rc1: the class is no longer experimental. Earlier, this class required following notation: class Test(~.Abstract, abstract = True). That notation came from local class typing._Final, and it isn't supported now. 0.3.34: moved this class from aveytense.types_collection to aveytense.util submodule. 0.3.40: this class is no longer a protocol class
class aveytense.util.AbstractFinal
≥ 0.3.27rc1

Blend of classes ~.Abstract and ~.Final defined in the same submodule. This class creates abstract-final class via inheritance.

Abstract-final classes are only restricted to modify fields. Errors thrown by subclassing and initializing class object are the same as in ~.Abstract and ~.Final. ~.AbstractFinal is the same as: $k[from] $m[aveytense].$msu[util] $k[import] $cut[Abstract], $cut[Final], $cut[AbstractFinal] $k[class] $c[Test]($cut[Abstract], $cut[Final]): $o[...] # create abstract-final class

However, keep in mind checking the subclass of both ~.Abstract and ~.Final classes via issubclass() function returns False:

$f[issubclass]($c[Test], $cut[AbstractFinal]) # False $f[issubclass]($c[Test], ($cut[Abstract], $cut[Final])) # True 0.3.34: moved this class from aveytense.types_collection to aveytense.util submodule.
class aveytense.extensions.ANSIColor
≥ 0.3.24; < 0.3.26rc1

This class was based on ANSI escape code for colorizing purposes, and was the primal sketch of currently available class aveytense.Color, which replaced this class, because this class wasn't developed further. Backward-compatiblity would require using different import, but it is not advised, especially in case of third import statement below, because aveytense.Color is much developed now.

$k[from] $m[aveytense] $k[import] $c[Color] # ≥ 0.3.40 $k[from] $m[tense] $k[import] $c[Color] # ≥ 0.3.26rc1 < 0.3.40 $k[from] $m[tense] $k[import] $c[ANSIColor] $k[as] $c[Color] # ≥ 0.3.24 < 0.3.26rc1

0.3.26rc1: Instead use aveytense.Color.
class aveytense.ChangeVar
≥ 0.3.26rc1

Auxiliary class for creating sentinels inside loops, especially while. Overall, this class means to be a reference to incrementation and decrementation operators, which aren't available on Python (++ and --) and for loop in many popular languages such as JavaScript, PHP, C/C++, Java, of the form for(initialValue; statement; modifier). This class isn't well-documented there, but it has documentation strings on the AveyTense code - can be easily used with the help() inbuilt function, as help(~.ChangeVar).
aveytense.ChangeVar.__init__(initialValue = 0)
aveytense.ChangeVar.__neg__()
Decreases sentinel's value by 1. That's mere decrementation operation known from several programming languages as --. Behavior can be changed with method ~.setModifier(). Method itself doesn't return anything.
aveytense.ChangeVar.__pos__()
Increases sentinel's value by 1. That's mere incrementation operation known from several programming languages as ++. Behavior can be changed with method ~.setModifier(). Method itself doesn't return anything.
class aveytense.CMYK
≥ 0.3.28

Inversion of ~.RGB. Upon constructor invocation, returned is new ~.RGB class instance with inverted colors.

$k[from] $m[aveytense] $k[import] $c[CMYK] $c[CMYK]($n[0], $n[202], $n[255]) # RGB(255, 53, 0)

In contrast to ~.RGB class, this class does not feature any members. To invert a value (not RGB tuple necessarily), it is possible to use the following:

$k[from] $m[aveytense] $k[import] $o[*] $v[rgb] $o[=] $c[RGB].$f[fromValue]($n[0x00caff]) $c[CMYK]($v[rgb].$fp[r], $v[rgb].$fp[g], $v[rgb].$fp[b]) # RGB(255, 53, 0)

This class is final, what means it cannot be inherited by other classes.

class aveytense.Color
≥ 0.3.26rc1
type-alias aveytense.Colour = aveytense.Color
≥ 0.3.37

Deputy of the class ~.extensions.ANSIColor; allows to change color and modify style for desired text (string) on the output.
aveytense.Color.__all__ (≥ 0.3.26rc2)
Returns list of all non-underscored members of the class.
aveytense.Color.__constants__ (≥ 0.3.26rc2)
Returns list of all constants being variables of the class. They are sorted in ANSI ascending order, see here to learn more.
aveytense.Color.__init__(text, /, bits = 8, foregroundColor = None, backgroundColor = None) (≥ 0.3.26rc1)
Creates a new ~.Color class instance.
text will be a string, which will be colorized, bits represents bits for colors as in ANSI (possible values: 3, 4, 8, 24), foregroundColor is color for text, which may be a string (if it has hexadecimal, decimal, octal or binary integer), integer and ~.RGB class instances (if value for bits is 24). Finally, backgroundColor is color for background, which will encase the text. Accepted values same as in foregroundColor. These values can be greater than desired amount of bits (3 - 10, 4 - 20, 8 - 255, 24 - 16777215). Check this page for more information.

0.3.27: Removed last parameter underlineColor due to no effect (signature __init__(text, /, bits = 8, foregroundColor = None, backgroundColor = None, underlineColor = None)).
aveytense.Color.__mod__(other) (≥ 0.3.26rc1)
Allows to include styles to colored text, and returns styled, colored version of text. This method equals self % other, where other must be an appriopriate constant value from this table:

Constant Lifetime Description
Single styles
~.Color.NORMAL ≥ 0.3.26rc1 Provides normal text. Nothing changes with this constant
~.Color.BOLD ≥ 0.3.26rc1 Text becomes bold
~.Color.ITALIC ≥ 0.3.26rc1 Text becomes oblique
~.Color.UNDERLINE ≥ 0.3.26rc1 Adds a line under the text
~.Color.SLOW_BLINK ≥ 0.3.26rc1 Sets blinking to less than 150 times per minute
~.Color.RAPID_BLINK ≥ 0.3.26rc1 Sets blinking to more than 150 times per minute
~.Color.REVERSE ≥ 0.3.26rc1 Swap foreground and background colors
~.Color.HIDE ≥ 0.3.26rc1 Text isn't visible on the output
~.Color.STRIKE ≥ 0.3.26rc1 Text becomes crossed out
~.Color.DOUBLE_UNDERLINE ≥ 0.3.26rc1 Adds 2 lines under the text
~.Color.PROPORTIONAL ≥ 0.3.26rc1; < 0.3.26rc2 Proportional spacing, consider using str.rpartition() instead 0.3.26rc2
~.Color.FRAME ≥ 0.3.26rc1 ?
~.Color.ENCIRCLE ≥ 0.3.26rc1 It is probably border encasing entire text.
~.Color.OVERLINE ≥ 0.3.26rc1 Adds a line over the text
~.Color.SUPERSCRIPT ≥ 0.3.26rc1 Superscripts the text
~.Color.SUBSCRIPT ≥ 0.3.26rc1 Subscripts the text
Advanced styles
~.Color.BOLD_ITALIC ≥ 0.3.26rc2 Text becomes bold and oblique
~.Color.BOLD_UNDERLINE ≥ 0.3.26rc2 Text becomes bold and underlined
~.Color.BOLD_STRIKE ≥ 0.3.26rc2 Text becomes bold and crossed out
~.Color.BOLD_OVERLINE ≥ 0.3.26rc2 Text becomes bold and overlined
~.Color.ITALIC_UNDERLINE ≥ 0.3.26rc2 Text becomes oblique and underlined
~.Color.ITALIC_STRIKE ≥ 0.3.26rc2 Text becomes oblique and crossed out
~.Color.ITALIC_OVERLINE ≥ 0.3.26rc2 Text becomes oblique and overlined
~.Color.UNDERLINE_STRIKE ≥ 0.3.26rc2 Text becomes underlined and crossed out
~.Color.UOLINE ≥ 0.3.26rc2 Adds lines under and over the text
~.Color.STRIKE_OVERLINE ≥ 0.3.26rc2 Text becomes crossed out and overlined
~.Color.BOLD_ITALIC_UNDERLINE ≥ 0.3.26rc2 Text becomes bold, oblique and underlined
~.Color.BOLD_ITALIC_STRIKE ≥ 0.3.26rc2 Text becomes bold, oblique and crossed out
~.Color.BOLD_ITALIC_OVERLINE ≥ 0.3.26rc2 Text becomes bold, oblique and overlined
~.Color.BOLD_UNDERLINE_STRIKE ≥ 0.3.26rc2 Text becomes bold, underlined and crossed out
~.Color.BOLD_UOLINE ≥ 0.3.26rc2 Text becomes bold, underlined and overlined
~.Color.ITALIC_UNDERLINE_STRIKE ≥ 0.3.26rc2 Text becomes italic, underlined and crossed out
~.Color.ITALIC_UOLINE ≥ 0.3.26rc2 Text becomes italic, underlined and overlined
~.Color.ITALIC_STRIKE_OVERLINE ≥ 0.3.26rc2 Text becomes bold, crossed out and overlined
~.Color.STRIKE_UOLINE ≥ 0.3.26rc2 Text becomes crossed out, underlined and overlined
All of these constants are actually enum members. These categorized as single styles have their enum values the same as in this article (there n), e.g. for ~.Color.BOLD it is 0. Styles 2 in 1, which start category advanced styles, start with value 1000. For styles 3 in 1 beginning is 1100. Not all of these styles are guaranteed to work. For some terminals these may have different meaning, so be cautious when using these. Superscript, subscript, overline, encircle and frame are only implemented in mintty, but e.g. Visual Studio Code supports overline on the terminal. Bold can also mean increased intensity, faint - decreased intensity or dim, double underline - not bold. The following example prints text I will be blue and italic colored blue and oblique: from import .print(Color(I will be blue and italic, 8, 69) Color.ITALIC)
aveytense.Color.__pos__()(≥ 0.3.26rc1; < 0.3.48)
aveytense.Color.__neg__()(≥ 0.3.26rc1; < 0.3.48)
aveytense.Color.__invert__()(≥ 0.3.26rc1; < 0.3.48)
aveytense.Color.__str__() (≥ 0.3.34)

All of these equal the notations, respectively: with unary + and -, binary inversion ~ operators, and invocation of str(). All of these return colored text.

from import .print(Color(I will be blue, 8, 69)) .print(Color(I will be blue, 8, 69)) .print(Color(I will be blue, 8, 69))

.print(str(Color(I will be blue, 8, 69))) .print({!s}.format(Color(I will be blue, 8, 69))) .print(Color(I will be blue, 8, 69)) print() will convert the instance to string
0.3.47: Methods __pos__(), __neg__() and __invert__() are deprecated and will be removed in 0.3.48. Use str(self) instead. 0.3.48: Methods __pos__(), __neg__() and __invert__() have been removed.
aveytense.Color.__repr__() (≥ 0.3.35)
Equals invocation of repr(), and returns more representative version about object.

from aveytense import .print(repr(Color(Hello))) <aveytense.Color object: Color("Hello")> .print({!r}.format(Color(Hello))) <aveytense.Color object: Color("Hello")>
aveytense.Color.clear() (≥ 0.3.26rc1)
Resets all values (except text), those are: bits to 8, foreground and background color to None.
This method since 0.3.37 is also invoked when used with ~.Tense.clear().
aveytense.Color.setBackgroundColor(color, /) (≥ 0.3.26rc1)
Sets color for background. Make sure value is least than desired amount of bits (3 - 10, 4 - 20, 8 - 255, 24 - 16777215), otherwise you can meet an error.
aveytense.Color.setBits(bits, /) (≥ 0.3.26rc1)
Sets bits amount. Make sure decreasing the amount won't catch an error. Possible values: 3, 4, 8, 24.

from aveytense import coloredColor(I will be blue, 3, 4) colored.setBits(8) colored.setForegroundColor(69) .print(Color(I will be blue, 8, 69))
aveytense.Color.setForegroundColor(color, /) (≥ 0.3.26rc1)
Sets color for text. Make sure value is least than desired amount of bits (3 - 10, 4 - 20, 8 - 255, 24 - 16777215), otherwise you can meet an error.
aveytense.Color.setUnderlineColor(color, /) (≥ 0.3.26rc1; < 0.3.27)
Sets color for underline. Make sure value is least than desired amount of bits (3 - 10, 4 - 20, 8 - 255, 24 - 16777215), otherwise you can meet an error.

0.3.27: No effect.
abstract-final class aveytense.Colors (≥ 0.3.41)
type-alias aveytense.Colours = aveytense.Colors (≥ 0.3.41)
Provides color palette from HTML. All members of this class are objects of class ~.RGB. All names are from this page. Attributes prefixed with mode256_ refer to 8-bit colors table from ANSI escape code article.
class aveytense.util.Final
≥ 0.3.26b3

Creates a final class via inheritance. Once a class extends this class, subclass cannot be further subclassed. This class is a reference to local class typing._Final, which is used to forbid the inheritance in special types in typing, however, doesn't work the same way.

Example how to create a final class: $k[from] $m[aveytense].$msu[util] $k[import] $cut[Final] $k[class] $c[Test]($cut[Final]): $o[...] $k[class] $c[Test2]($cex[Test]): $o[...] # SubclassedError: attempt to subclass a final class 'Test' 0.3.27rc1: the class is no longer experimental.

0.3.34: moved this class from aveytense.types_collection to aveytense.util submodule.
class aveytense.util.FinalVar (≥ 0.3.26rc1)

Creates a final variable. It's main job is to supersede typing.Final class, since it doesn't work as intended.

0.3.34: moved this class from aveytense.types_collection to aveytense.util submodule.

0.3.35: the class is no longer experimental.

0.3.38: objects of this class can now be inspected via aveytense.Tense.isFinalVar().
class aveytense.util.Flags
≥ 0.3.53

Returns buffer, code and type flags.

  • Flags.buffer (or util.BufferFlags) gets buffer flags. Content is almost the same as in inspect.BufferFlags, just every member uses CamelCase naming convention. inspect.BufferFlags in AveyTense features support before Python 3.12 - when it was added. It is defined here as aveytense.types.BufferFlags.

    • Flags.buffer.contiguousAny
    • Flags.buffer.contiguousC
    • Flags.buffer.contiguousF
    • Flags.buffer.contiguousReadOnly
    • Flags.buffer.format
    • Flags.buffer.full
    • Flags.buffer.fullReadOnly
    • Flags.buffer.indirect
    • Flags.buffer.nd
    • Flags.buffer.read
    • Flags.buffer.records
    • Flags.buffer.recordsReadOnly
    • Flags.buffer.simple
    • Flags.buffer.strided
    • Flags.buffer.stridedReadOnly
    • Flags.buffer.strides
    • Flags.buffer.writable
    • Flags.buffer.write
  • Flags.code (or util.CodeFlags) gets code flags. Content:

    • Flags.code.asyncGenerator
    • Flags.code.coroutine
    • Flags.code.generator
    • Flags.code.iterableCoroutine
    • Flags.code.nested
    • Flags.code.newLocals
    • Flags.code.noFree
    • Flags.code.optimized
    • Flags.code.varargs
    • Flags.code.varkeywords
  • Flags.type (or util.TypeFlags) gets type flags. Content:

    • Flags.type.abstract
    • Flags.type.baseExcSubclass
    • Flags.type.baseType
    • Flags.type.bytesSubclass
    • Flags.type.default
    • Flags.type.dictSubclass
    • Flags.type.haveGc
    • Flags.type.haveStacklessExtension
    • Flags.type.haveVersionTag
    • Flags.type.heapType
    • Flags.type.listSubclass
    • Flags.type.longSubclass
    • Flags.type.ready
    • Flags.type.readying
    • Flags.type.tupleSubclass
    • Flags.type.typeSubclass
    • Flags.type.unicodeSubclass
    • Flags.type.validVersionTag

Usage:

  • buffer flags: ?
  • code flags: <callable_object>.__code__.co_flags & ...
  • type flags: <type>.__flags__ & ...

type aveytense.util.FinalVarType (≥ 0.3.38)
Type of aveytense.util.FinalVar; used in aveytense.Tense.isFinalVar() for type hinting.
Once instantiated, it will behave as initializing aveytense.util.FinalVar, what means example expression
FinalVar(2) == FinalVarType(2) returns True.
class aveytense.Math (≥ 0.3.25)
A class containing math methods and constants. Inherited by class aveytense.Tense.

Comparing to math module in Python, this class features polygonal number counting,
more trigonometrical methods, number verification methods and sequence checking.
In overall, this class is its extension.

All methods in the class are class methods.
aveytense.Math.__all__ (≥ 0.3.26rc2)
Returns sorted list of all non-underscored members of the class.

Math constants

Constant Exact or approximate value Lifetime
~.Math.NAN - ≥ 0.3.25 (5th July 2024)
~.Math.INF - ≥ 0.3.25 (5th July 2024)
~.Math.SQRT2 1.41421... ≥ 0.3.25 (5th July 2024)
~.Math.E 2.71828... ≥ 0.3.25 (4th July 2024)
~.Math.PI 3.14159... ≥ 0.3.25 (4th July 2024)
~.Math.TAU 6.28318... ≥ 0.3.25 (5th July 2024)
~.Math.THOUSAND 103 ≥ 0.3.47 (7th June 2025)
~.Math.MILLION 106 ≥ 0.3.47 (7th June 2025)
~.Math.BILLION 109 ≥ 0.3.47 (7th June 2025)
~.Math.TRILLION 1012 ≥ 0.3.47 (7th June 2025)
~.Math.QUADRILLION 1015 ≥ 0.3.47 (7th June 2025)
~.Math.QUINTILLION 1018 ≥ 0.3.47 (7th June 2025)
~.Math.SEXTILLION 1021 ≥ 0.3.47 (7th June 2025)
~.Math.SEPTILLION 1024 ≥ 0.3.47 (7th June 2025)
~.Math.OCTILLION 1027 ≥ 0.3.47 (7th June 2025)
~.Math.NONILLION 1030 ≥ 0.3.47 (7th June 2025)
~.Math.DECILLION 1033 ≥ 0.3.47 (7th June 2025)
~.Math.UNDECILLION 1036 ≥ 0.3.47 (7th June 2025)
~.Math.DUODECILLION 1039 ≥ 0.3.47 (7th June 2025)
~.Math.TREDEDECILLION 1042 ≥ 0.3.47 (7th June 2025)
~.Math.QUATTUOR_DECILLION 1045 ≥ 0.3.47 (7th June 2025)
~.Math.QUINDECILLION 1048 ≥ 0.3.47 (7th June 2025)
~.Math.SEXDECILLION 1051 ≥ 0.3.47 (7th June 2025)
~.Math.SEPTEN_DECILLION 1054 ≥ 0.3.47 (7th June 2025)
~.Math.OCTODECILLION 1057 ≥ 0.3.47 (7th June 2025)
~.Math.NOVEMDECILLION 1060 ≥ 0.3.47 (7th June 2025)
~.Math.VIGINTILLION 1063 ≥ 0.3.25 (7th June 2025)
~.Math.GOOGOL 10100 ≥ 0.3.25 (19th July 2024)
~.Math.CENTILLION 10303 ≥ 0.3.25 (19th July 2024)

Trigonemetric functions

Normal
Class method name Equivalent to Lifetime Domain Possible values
~.Math.sin(x, /) - ≥ 0.3.25 (4th July 2024) x ∈ R ⟨-1; 1⟩
~.Math.cos(x, /) - ≥ 0.3.25 (4th July 2024) x ∈ R ⟨-1; 1⟩
~.Math.tan(x, /) sin xcos x ≥ 0.3.25 (4th July 2024) x ∈ R \ {k: k + 90 ∤ 90n}
(where n ∈ N \ {0})
R
~.Math.cot(x, /) 1tan x ≥ 0.3.25 (4th July 2024) x ∈ R \ {k: k ∤ 90}
R
~.Math.sec(x, /) 1cos x ≥ 0.3.25 (4th July 2024) x ∈ R \ {k: k + 90 ∤ 90n}
(where n ∈ N \ {0})
R \ (-1; 1)
~.Math.cosec(x, /) 1sin x ≥ 0.3.25 (4th July 2024) x ∈ R \ {k: k ∤ 180}
R \ (-1; 1)

Extended
Class method name Equivalent to Lifetime Domain Possible values
~.Math.versin(x, /) 1 - cos x ≥ 0.3.25 (4th July 2024) x ∈ R
⟨0; 2⟩
~.Math.vercos(x, /) 1 + cos x ≥ 0.3.25 (4th July 2024) x ∈ R ⟨0; 2⟩
~.Math.coversin(x, /) 1 - sin x ≥ 0.3.25 (4th July 2024) x ∈ R
⟨0; 2⟩
~.Math.covercos(x, /) 1 + sin x ≥ 0.3.25 (4th July 2024) x ∈ R
⟨0; 2⟩
~.Math.haversin(x, /) 1 - cos x2 ≥ 0.3.25 (4th July 2024) x ∈ R
⟨0; 1⟩
~.Math.havercos(x, /) 1 - sin x2 ≥ 0.3.25 (4th July 2024) x ∈ R
⟨0; 1⟩
~.Math.hacoversin(x, /) 1 + cos x2 ≥ 0.3.25 (4th July 2024) x ∈ R
⟨0; 1⟩
~.Math.hacovercos(x, /) 1 + sin x2 ≥ 0.3.25 (4th July 2024) x ∈ R
⟨0; 1⟩
~.Math.exsec(x, /) sec x - 1 ≥ 0.3.25 (5th July 2024) x ∈ R \ {k: k + 90 ∤ 90n}
(where n ∈ N \ {0})
⟨-2; 0⟩
~.Math.excosec(x, /) cosec x - 1 ≥ 0.3.25 (5th July 2024) x ∈ R \ {k: k ∤ 180}
⟨-2; 0⟩

Hyperbolic
Class method name Equivalent to Lifetime Domain Possible values
~.Math.sinh(x, /) ex - e-x2
≥ 0.3.25 (4th July 2024) x ∈ R R
~.Math.cosh(x, /) ex + e-x2
≥ 0.3.25 (4th July 2024) x ∈ R R
~.Math.tanh(x, /) sinh xcosh x
≥ 0.3.25 (4th July 2024) x ∈ R R
~.Math.coth(x, /) 1tanh x
≥ 0.3.46 (23rd May 2025) x ≠ 0 R
~.Math.sech(x, /) 1cosh x
≥ 0.3.46 (23rd May 2025) x ∈ R R
~.Math.cosech(x, /) 1sinh x
≥ 0.3.46 (23rd May 2025) x ≠ 0 R

Inverse
Class method name Equivalent to Lifetime Domain Possible values
~.Math.asin(x, /) sin-1 x
≥ 0.3.25 (4th July 2024) |x| ≤ 1
~.Math.asinh(x, /) ln (x + (x2 + 1)1/2)
≥ 0.3.25 (4th July 2024) x ∈ R
~.Math.acos(x, /) cos-1 x
≥ 0.3.25 (4th July 2024) |x| ≤ 1
~.Math.acosh(x, /) ln (x + (x2 - 1)1/2)
≥ 0.3.25 (4th July 2024) x ≥ 1
~.Math.atan(x, /) tan-1 x
≥ 0.3.25 (4th July 2024) x ∈ R
~.Math.atanh(x, /) 12 ln 1 + x1 - x
≥ 0.3.25 (4th July 2024) x ∈ (-1; 1)
~.Math.acot(x, /) cot-1 x
≥ 0.3.46 (23rd May 2025) x ∈ R
~.Math.acoth(x, /) *
≥ 0.3.51 x ∉ ⟨-1; 1⟩
~.Math.asec(x, /) acos(1 ÷ x)
≥ 0.3.25 (4th July 2024) |x| > 1
~.Math.asech(x, /) *
≥ 0.3.51 x ∈ (0; 1⟩
~.Math.acosec(x, /) asin(1 ÷ x)
≥ 0.3.25 (4th July 2024) |x| > 1
~.Math.acosech(x, /) *
≥ 0.3.51 x ∈ R \ {0}
~.Math.aversin(x, /) acos(1 - x)
≥ 0.3.25 (4th July 2024) x ∈ ⟨0; 2⟩
~.Math.avercos(x, /) asin(1 - x)
≥ 0.3.25 (4th July 2024) x ∈ ⟨0; 2⟩
~.Math.acoversin(x, /) acos(x - 1)
≥ 0.3.25 (4th July 2024) x ∈ ⟨0; 2⟩
~.Math.acovercos(x, /) acos(x - 1)
≥ 0.3.25 (4th July 2024) x ∈ ⟨0; 2⟩
~.Math.ahaversin(x, /) acos(1 - 2x)
≥ 0.3.25 (4th July 2024) x ∈ ⟨0; 1⟩
~.Math.ahavercos(x, /) acos(2x - 1)
≥ 0.3.25 (4th July 2024) x ∈ ⟨0; 1⟩
~.Math.ahacoversin(x, /) asin(1 - 2x)
≥ 0.3.25 (4th July 2024) x ∈ ⟨0; 1⟩
~.Math.ahacovercos(x, /) asin(2x - 1)
≥ 0.3.25 (4th July 2024) x ∈ ⟨0; 1⟩
~.Math.aexsec(x, /) asec(x + 1) ≥ 0.3.25 (5th July 2024) x ∉ (-2; 0)
~.Math.aexcosec(x, /) acosec(x + 1) ≥ 0.3.25 (5th July 2024) x ∉ (-2; 0)

Figurate number functions

0.3.39: all figurate number functions are now providing support for 0 for parameter n. In ~.Math.polygonal() change also occurred in parameter s - it must now comply with s ≥ 3.

Class method name Equivalent to Lifetime Returned value
Two-parameter functions
~.Math.polygonal(n, s, /) (s - 2)n2 - (s - 4)n2 ≥ 0.3.27a4 polygonal number
at index n with s sides
~.Math.polygonalCentered(n, s, /) sn(n + 1)2+ 1 ≥ 0.3.51 centered polygonal number
at index n with s sides
~.Math.pyramidal(n, s, /) 3n2 + n3(s - 2) - n(s - 5)6 ≥ 0.3.51 pyramidal number
at index n with s sides
One-parameter functions
2-polytopes (polygons)
~.Math.triangular(n, /) n2 + n2 ≥ 0.3.27a4 triangular number at index n
~.Math.triangularCentered(n, /) ≥ 0.3.51 centered triangular number
at index n
~.Math.square(n, /) n2 ≥ 0.3.51 square number at index n
(or n to the power 2)
~.Math.squareCentered(n, /) n2 + (n - 1)2 ≥ 0.3.51 centered square number
at index n
~.Math.pentagonal(n, /) 3n2 - n2 ≥ 0.3.27a4 pentagonal number at index n
~.Math.pentagonalCentered(n, /) ≥ 0.3.51 centered pentagonal number
at index n
~.Math.hexagonal(n, /) 2n2 - n ≥ 0.3.27a4 hexagonal number at index n
~.Math.hexagonalCentered(n, /) ≥ 0.3.51 centered hexagonal number
at index n
~.Math.heptagonal(n, /) 5n2 - 3n2 ≥ 0.3.27a4 heptagonal number at index n
~.Math.heptagonalCentered(n, /) ≥ 0.3.51 centered heptagonal number
at index n
~.Math.octagonal(n, /) 3n2 - 2n ≥ 0.3.27a4 octagonal number at index n
~.Math.octagonalCentered(n, /) (2n - 1)2 ≥ 0.3.51 centered octagonal number
at index n
~.Math.nonagonal(n, /) 7n2 - 5n2 ≥ 0.3.27a4 nonagonal number at index n
~.Math.nonagonalCentered(n, /) (3n - 2)(3n - 1)2 ≥ 0.3.51 centered nonagonal number
at index n
~.Math.decagonal(n, /) 4n2 - 3n ≥ 0.3.27a4 decagonal number at index n
~.Math.decagonalCentered(n, /) 5n2 - 5n + 1 ≥ 0.3.51 centered decagonal number
at index n
~.Math.hendecagonal(n, /) n(9n - 7)2 ≥ 0.3.51 hendecagonal number at index n
~.Math.hendecagonalCentered(n, /) 11n(n - 1) + 22 ≥ 0.3.51 centered hendecagonal number
at index n
~.Math.dodecagonal(n, /) n(5n - 4) ≥ 0.3.51 dodecagonal number at index n
~.Math.dodecagonalCentered(n, /) 6n(n - 1) + 1 ≥ 0.3.51 centered dodecagonal number
at index n
~.Math.tridecagonal(n, /) n(11n - 9)2 ≥ 0.3.51 tridecagonal number
at index n
~.Math.tridecagonalCentered(n, /) 13n(n - 1) + 22 ≥ 0.3.51 centered tridecagonal number
at index n
~.Math.pronic(n, /) n(n + 1) ≥ 0.3.51 pronic number at index n
~.Math.star(n, /) 6n(n - 1) + 1 ≥ 0.3.51 star number at index n
3-polytopes (polyhedra)
~.Math.tetrahedral(n, /) n3! ≥ 0.3.51 tetrahedral number at index n
~.Math.tetrahedralCentered(n, /) (2n + 1) ∙ (n2 + n + 33) ≥ 0.3.51 centered tetrahedral number
at index n
~.Math.cube(n, /) n3 ≥ 0.3.51 cube number
at index n (or n to the power 3)
~.Math.cubeCentered(n, /) n3 + (n + 1)3 ≥ 0.3.51 centered cube number
at index n
~.Math.octahedral(n, /) n(2n2 + 1)3 ≥ 0.3.51 octahedral number at index n
~.Math.octahedralCentered(n, /) (2n + 1)(2n2 + 2n + 3)3 ≥ 0.3.51 centered octahedral number
at index n
~.Math.stellaOctangula(n, /) n(2n2 - 1) ≥ 0.3.51 stella octangula number
at index n
~.Math.dodecahedral(n, /) n(3n - 1)(3n - 2)2 ≥ 0.3.51 dodecahedral number at index n
~.Math.dodecahedralCentered(n, /) (2n + 1)(52 + 5n + 1) ≥ 0.3.51 centered dodecahedral number
at index n
~.Math.icosahedral(n, /) n(5n2 - 5n + 2)2 ≥ 0.3.51 icosahedral number at index n
~.Math.icosahedralCentered(n, /) (2n + 1)(52 + 5n + 3)3 ≥ 0.3.51 centered icosahedral number
at index n
4-polytopes
~.Math.pentatope(n, /) n / 4! ≥ 0.3.51 pentatope number at index n

Miscellaneous functions

Class method name Equivalent to Lifetime Returned value
~.Math.abs(x, /) |x| ≥ ? (< 0.3.24) absolute value of x
~.Math.fact(n, /) n! ≥ 0.3.26rc3 factorial of n
~.Math.factFalling(x, n, /) (x)n ≥ 0.3.51 falling factorial of x at index n
~.Math.factRising(x, n, /) x ≥ 0.3.51 rising factorial of x at index n
~.Math.ln(x, /) ln x ≥ 0.3.25 (5th July 2024) natural logarithm of x
~.Math.log(x, /, base = ...) logbase x ≥ 0.3.25 (5th July 2024) logarithm of x with specific base
~.Math.log2(x, /) log2 x ≥ 0.3.25 (5th July 2024) logarithm of x with base 2
~.Math.log3(x, /) log3 x ≥ 0.3.25 (5th July 2024) logarithm of x with base 3
~.Math.log5(x, /) log5 x ≥ 0.3.25 (5th July 2024) logarithm of x with base 5
~.Math.log7(x, /) log7 x ≥ 0.3.25 (5th July 2024) logarithm of x with base 7
~.Math.log10(x, /) log10 x ≥ 0.3.25 (5th July 2024) logarithm of x with base 10
class aveytense.games.Minesweeper (≥ 0.3.41; < 0.3.47)
Provides components for minesweeper game. Referred from Windows 7 Minesweeper. These components can be used with tkinter, from which AveyTense project resigned back on 0.3.36. 0.3.47: To be used in separate project aveytense_games.
class aveytense.util.MutableString (≥ 0.3.42)
A mutable version of inbuilt class str; represents a string that can be changed.
class aveytense.util.ParamVar (≥ 0.3.42)
Blend of functions inspect.getfullargspec() and inspect.signature(). Except looking for variable and non-variable parameters, it is also possible to receive type annotations of desired callable object, and overload pointer is included. 0.3.51: Added initial support for inbuilt functions. Types can be assigned to static method ~.util.ParamVar.fromType(). Not all inbuilt (built-in) functions can be introspected, especially methods, and under angle of signature. Perhaps some share the __text_signature__ attribute, value of this attribute may be either only (*args, **kwargs) or None, what decreases the chance to inspect such functions. Reason is given in documentation of function inspect.signature() (in Note section). Overloaded inbuilt functions inspection is difficult too, because this raises an AttributeError exception for accessing undefined attribute __module__ after invocation of function typing.get_overloads().
final-class aveytense.RGB (≥ 0.3.28)
Creates a RGB (red-green-blue) tuple.
final-class aveytense.RGBA (≥ 0.3.37)
Creates a RGBA (red-green-blue-alpha) tuple.
class aveytense.util.SortedList (≥ 0.3.35)
Creates always sorted list.
class aveytense.util.StrictEnum
≥ 0.3.43; < 0.3.50
Meant to be an re-implementation of class enum.Enum. It was meant to be an abstract enumerator class, however, subclassing as class Test(~.util.Abstract, enum.Enum): ... will not work as intended - it will cause subclass conflict. Instead consider using enum.Enum. 0.3.50
class aveytense.Tense
≥ 0.3.24
Heart of AveyTense project. Contains many methods, including for math, time, checking types and utility.

All methods, except dunder ones, are class methods. If used via reference, dunder methods aren't
accessible, and will require the class instance. Instead, it is required to create an instance of this class
in order to access them.

0.3.26b3: this class is no longer final (can be subclassed).

0.3.24
aveytense.Tense.__all__ (≥ 0.3.26rc2)
Returns sorted list of all non-underscored members of the class.
aveytense.Tense.abroadBinary(value1, /, value2 = None, modifier = None, include_0b = True) (≥ 0.3.25)
Variation of abroad() function, which converts every integer to their binary equivalents.
Parameter include_0b allows to include 0b prefix in every returned binary integer in a string.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadConvect(*values)
≥ 0.3.25

Returns an abroad object depending on arguments passed.
Every value can be an integer, float, complex and sizeable objects. Method uses following formula:

  • for integers, their values are added to result
  • for floats, their values are truncated and added to result
  • for complexes, their real and imaginary parts are truncated and added to result
  • for sizeable objects, their lengths are used

If resulted integer in-code is positive, then returned is iterable as [0; n], if negative, then [n; -1].

$k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[print]($t[Tense].Convect($n[35], $s[joyride], $n[7.2], 23$o[+]12j, ($s[reckon], $s[abroad]))) # 35 + 7 + 23 + 12 + 2 = 86 => [0, 1, 2, 3, ..., 83, 84, 85]

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadEach(value1, /, value2 = None, modifier = None, *, each = None) (≥ 0.3.25)
Variation of abroad() function, which can modify iterable via parameter each before it will be returned.
That parameter may be only a callable returning an integer or float, and have one parameter,
either required or optional, but all other - optional. This variation returns a list, not an abroad object.
Examples:

from aveytense import
.print(.Each(1, 7, eachlambda x: xx))
[1, 4, 9, 16, 25, 36]

.print(.Each(100, 0, eachlambda x: x(1/2)))
[10, sqrt(99), sqrt(98), ..., sqrt(3), sqrt(2), 1]

.print(.Each(6, 13, eachlambda x: x(1/x)))
[1, 1, 1, 1, 1, 1]

0.3.26a4: this method is no longer experimental.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.

0.3.35: all objects except integer and floats are now allowed to be returned in a list.
Due to this change each is keyword-only parameter.
aveytense.Tense.abroadExclude(value1, /, value2 = None, modifier = None, *excludedIntegers) (≥ 0.3.25)
Variation of abroad() function, which excludes desired integers in parameter excludedIntegers.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadFloaty(value1, /, value2 = None, modifier = None, div = 10) (≥ 0.3.25)
Variation of abroad() function, which divides every integer by div.
Roughly equal to aveytense.Tense.abroadEach(value1, value2, modifier, each = lambda x: x / div).

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadHex(value1, /, value2 = None, modifier = None, include_0x = ABROAD_HEX_INCLUDE) (≥ 0.3.25)
Variation of abroad() function, which returns every integer in hexadecimal format as strings.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadImmutable(value1, /, value2 = None, modifier = None) (≥ 0.3.25; < 0.3.34)
Variation of abroad() function, which returns immutable version of the sequence (in this case tuple). Alias to tuple(abroad()).

0.3.34 due to shortened notation with unary -: -abroad().
aveytense.Tense.abroadInside(value1, /, value2 = None, modifier = None, string = None) (≥ 0.3.25)
Variation of abroad() function, which places every integer in curly brackets in parameter string.
It will not work with keyword-named parameters.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadLive(*values) (≥ 0.3.25)
Variation of abroad() function referring to graph; every next value is next endpoint.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class. 0.3.50
aveytense.Tense.abroadNegative(value1, /, value2 = None, modifier = None) (≥ 0.3.24)
Variation of abroad() function, which transforms every integer to negative.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadNegativeFlip(value1, /, value2 = None, modifier = None) (≥ 0.3.24)
Variation of abroad() function, which transforms every integer to negative, and reverses returned sequence.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadOctal(value1, /, value2 = None, modifier = None) (≥ 0.3.25)

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadPack(*values) (≥ 0.3.25)
Variation of abroad() function basing on inbuilt class zip.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadPositive(value1, /, value2 = None, modifier = None) (≥ 0.3.24)
Variation of abroad() function, which transforms every integer to positive.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadPositiveFlip(value1, /, value2 = None, modifier = None) (≥ 0.3.24)
Variation of abroad() function, which transforms every integer to positive, and reverses returned sequence.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadPrecede(value1, /, value2 = None, modifier = None, prefix = None) (≥ 0.3.25)
Variation of abroad() function, which returns string sequence with specific string prefix + every integer.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadSplit(value1, /, value2 = None, modifier = None, limit = 2) (≥ 0.3.25)

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadSufcede(value1, /, value2 = None, modifier = None, suffix = None) (≥ 0.3.25)
Variation of abroad() function, which returns string sequence with every integer + specific string suffix.

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class.
aveytense.Tense.abroadVivid(*values) (≥ 0.3.25)

0.3.34: due to removal of class NennaiAbroads, method was moved to Tense class. 0.3.50
aveytense.Tense.all(i, /, condition = ...) (≥ 0.3.26rc2)
Extension of all() inbuilt function. Returned is True, if all items satisfied condition. If it is an ellipsis, returned is True if conversion of all items to boolean returns True. This class method is paired with ~.Tense.any() class method.

from aveytense import
.print(.all([3, 9, 6, 12], lambda x: x30)) True
.print(.all([3, 9, 6, 12], lambda x: x20)) False

0.3.27a4: removed parameter default.

0.3.34: the method now returns boolean value instead of copy of the sequence.

0.3.36: if condition was a callable, it must return boolean value, otherwise will always return False.

0.3.39 0.3.40: condition now has default value ellipsis, support for None has been excised. Fixed internal code, as it was liable for errors
aveytense.Tense.any(i, /, condition = None) (≥ 0.3.26rc2)
Extension of any() inbuilt function. Returned is True, if at least one item satisfied condition. If it is an ellipsis, returned is True if conversion of at least one item to boolean returns True. This class method is paired with ~.Tense.all() class method.

from aveytense import
.print(.any([3, 9, 6, 12], lambda x: x20)) True
.print(.any([3, 9, 6, 12], lambda x: x70)) False

0.3.27a4: removed parameter default.

0.3.34: the method now returns boolean value instead of copy of the sequence.

0.3.39 0.3.40: condition now has default value ellipsis, support for None has been excised. Fixed internal code, as it was liable for errors
aveytense.Tense.append(i, /, *items) (≥ 0.3.27a4)
Extension of list.append() method. Appends items from parameter items (in order as they appear) to a new list formalized from first parameter, and return this list. This class method is pure and paired with ~.Tense.extend() class method.

0.3.34: because code normally converts sequence to a list builtin, the method now accepts any iterables.

0.3.39 0.3.46: added support for mappings. In order as 2-item tuples appear in parameter items, these and the mapping will be returned in a new dictionary. If key (1st tuple item) already exists in a mapping or appear more times in provided tuples, its value is value from the key's last occurrence
aveytense.Tense.asyncGenerator( i: Iterable[T], /, condition: ((T) -> bool) = ...) -> AsyncGenerator[T, Any] aveytense.Tense.asyncGenerator(i, /, condition = ...) ≥ 0.3.53

Returns an asynchronous generator object using an iterable. Example:

$k[from] $m[aveytense] $k[import] $t[Tense] $v[asyncgen1] $o[=] $t[Tense].$tm[asyncGenerator]([$s[63], $s[96]]) <async_generator object <aveytense_async_generator> at 0x0000017AB790BF10> $v[asyncgen2] $o[=] $t[Tense].$tm[asyncGenerator]([$s[63], $s[96]], $k[lambda] $p[x]: $p[x] $o[%] $n[3] $o[==] $n[0]) <async_generator object <aveytense_async_generator> at 0x0000017AB790BF10>

Excluding type checking, this is roughly equivalent to:

$k[async] $k[def] $f[asyncgen_]($p[iterable], /, $p[condition]):   $k[for] $v[e] $k[in] $p[iterable]:     $k[if] $p[condition]($v[e]):       $k[yield] $v[e] $v[asyncgen1] $o[=] $f[asyncgen_]([$s[63], $s[96]]) <async_generator object asyncgen1 at 0x0000017AB790BF10> $v[asyncgen2] $o[=] $f[asyncgen_]([$s[63], $s[96]], $k[lambda] $p[x]: $p[x] $o[%] $n[3] $o[==] $n[0]) <async_generator object asyncgen2 at 0x0000017AB790BF10>

aveytense.Tense.bisect(a, x, /, l = 0, h = None,
dir = BISECT_RIGHT, *, key = None)
(≥ 0.3.26rc2)
Same as bisect.bisect() / bisect.bisect_left(), just dir parameter determines, which bisect function to invoke. Possible values:
Constant Lifetime Description
~.Tense.BISECT_LEFT /
~.constants.BISECT_LEFT
≥ 0.3.26rc2
≥ 0.3.35
Invokes bisect.bisect_left().
~.Tense.BISECT_RIGHT /
~.constants.BISECT_RIGHT
≥ 0.3.26rc2
≥ 0.3.35
Invokes bisect.bisect_right().
aveytense.Tense.cast(v, t, /) (≥ 0.3.36)
Same as typing.cast(), just parameters being in inverted places. from import from typing import cast abhello! cast(str, a) .cast(a, str)
aveytense.Tense.clear(*v) (≥ 0.3.27a4)
An impure class method that allows to clear many mutable sequences/sets/mappings at once. This method doesn't return anything, just like all of these methods: list.clear(), set.clear() and dict.clear().

0.3.27b1: strings are now allowed.

0.3.36: mutable sets are now allowed.

0.3.37: mutable mappings are now allowed, as well as instances of class aveytense.Color. In case of aveytense.Color class instances invoked is their instance method aveytense.Color.clear().

0.3.39

0.3.40: instances of types.FrameType are now allowed. Since this version strings are factually cleared; earlier, it was an unhandled issue despite it is normally supported. 0.3.50: added support for instances of typing.IO (more specifically, every object returned from function open()). In general, objects of classes extending classes from collections.abc: MutableSequence, MutableSet or MutableMapping are allowed, so not only inbuilt solutions such as lists, sets or dictionaries. Tests on clearing strings took some time to configure. To 0.3.40 it was an unhandled problem, because there was certainty it actually worked. Reason it didn't comes from fact that strings are practically immutable, just like tuples.
aveytense.Tense.copy(x) (≥ 0.3.34)
Same as copy.copy().
type aveytense.Tense.count (≥ 0.3.34)
Type alias for itertools.count (as a method, it may not operate on all overloads because of an error saying this class isn't subscriptable).
aveytense.Tense.cycle(i, /) (≥ 0.3.34)
Equivalent to itertools.cycle.
aveytense.Tense.deepcopy(x, memo = None, _nil = []) (≥ 0.3.34)
Same as copy.deepcopy().
aveytense.Tense.difference(v1, v2, /, invert = False, value_check = True) (≥ 0.3.32)
Extension of set.difference() instance method.
Returns items of first sequence that don't belong to second sequence, or vice versa, if invert is set to True.

0.3.34: the method now also accepts types, mappings and instances of abroad() function.
aveytense.Tense.endswith(target, suffix, /, mode = ~.constants.MODE_OR, start = ..., end = ...) (≥ 0.3.42)
aveytense.Tense.equal(*v)
≥ 0.3.41

Same as v[0] == v[1] and v[1] == v[2] and ... and v[n - 1] == v[n], where n is index for last item in v.

Difference between this class method and aveytense.Math.isConstant() (undocumented, but documented in code) is that it can be used for all types, and arbitrary amount of values can be passed (compared to isConstant() only one). Every value and their types must match to return True.

This class method is paired with aveytense.Tense.inequal().
aveytense.Tense.error(handler, message)
≥ 0.3.24; < 0.3.31

Defines an error to throw.

0.3.25

0.3.31
aveytense.Tense.eval(source, /)
aveytense.Tense.eval(source, /, globals = None, locals = None)
aveytense.Tense.eval(source, /, globals = None, locals = None,
flags = 0, dont_inherit = False, optimize = -1)

≥ 0.3.26rc2

Extension of eval() inbuilt Python function.
aveytense.Tense.exclude(i, /, *items, filter = "keys")
≥ 0.3.34
Inversion of ~.Tense.append(); this pure class method returns a new list without items specified in items. First parameter can be any iterable. This method is the same as [e for e in i if e not in items], omitting the fact there is no type checking. That means type of every element is ignored - code just hints type from iterable's type. from import .exclude([opened, ajar, closed], opened, closed) ['ajar'] 0.3.46: added support for mappings. In this case added optional parameter filter to indicate, what to exclude from pairs (keys or values). If target in a pair was found, this pair is excluded from returned dictionary. .exclude({ 12: 78, 15: 23, 12: 23 }, 12, filterkeys) {15: 23} .exclude({ 12: 78, 15: 23, 12: 23 }, 23, filtervalues) {12: 78}
aveytense.Tense.expect(i, m = ">= 1", /, condition = ...) aveytense.Tense.expect(i: Iterable[T], m: str | range | AbroadInitializer | AbstractSet[int] = ">= 1", /, condition: ((T) -> bool) = ...) -> bool ≥ 0.3.40
A class method working similarly as ~.any() and ~.all(), however, it is possible to enforce amount of items to satisfy condition in order to return True.

Parameter m (alias to matches) has the main role there. It has to be a special string literal, which will feature an integer (or keyword len) and comparison operator (from following: ==, !=, >=, <=, > and <), no matter in which order. len is shorthand keyword allowing to get literal iterables' sizes (not variables necessarily). This string determines about how many item matches need to be done to return True.

Default value for m is what it is. It equals following sentence: "equal or more than one item match", which is the same as invocation of ~.any(). Below table with example values for m:
m value ~.expect() not ~.expect()
">= 3"
"3 <="
item_matches ≥ 3 item_matches < 3
"< 19"
"19 >"
item_matches < 19 item_matches ≥ 19
"== 14"
"14 =="
item_matches = 14 item_matches ≠ 14
"!= 23"
"23 !="
item_matches ≠ 23 item_matches = 23
"<= len"
"len >="
item_matches ≤ iterable_length item_matches > iterable_length
from import .expect([76, 66, 56, 46], >= 3, lambda x: Math.isComposite(x)) True; 4 matches satisfy ≥ 3 .expect([76, 66, 56, 46], < 2, lambda x: Math.isComposite(x)) False; 4 matches don't satisfy < 2 .expect([76, 66, 56, 46], > 3, lambda x: Math.isComposite(x)) TypeError: expected 'm' parameter to be a valid string literal, like "> 3" or 'None'; only integer + comparison operator (or vice versa) are permitted in the string .expect([76, 66, 56, 46], > 7, lambda x: Math.isComposite(x)) TypeError: expected an integer in range ⟨1; iterable_length⟩; passed 7 so it is bigger than iterable's length

If you want to append larger numbers, e.g. with scientific notation, you should modify it in following ways: .expect([76, 66, 56, 46], <= {}.format(int(2e+12)), lambda x: Math.isComposite(x)) .expect([76, 66, 56, 46], <= str(int(2e+12)), lambda x: Math.isComposite(x)) The len keyword allows to create ~.all() method using the following signature:

.expect(i, == len, condition) same as ~.all()

But for ~.any() method, signature doesn't use len keyword. Reason it doesn't is because "<= len" will be satisfied also for no matches overall.

.expect(i, >= 1, condition) same as ~.any()

Case for m is sensitive, so e.g. LEN will be invalid and will throw TypeError. 0.3.45: added support for integer set, abroad and range objects in parameter m. Support was predicted for version 0.3.48.
aveytense.Tense.explode(s, /, separator = None, max = -1, noEmpty = False) aveytense.Tense.explode(s: str, /, separator: str | None = None, max: int = -1,
noEmpty: bool = False) -> list[str]
≥ 0.3.34
Name reference to PHP inbuilt function explode() and equivalent to inbuilt string method str.split().

0.3.51: renamed parameter no_empty to noEmpty.
aveytense.Tense.extend(i, /, *iters) aveytense.Tense.extend(i: Mapping[KT1, VT1], /,
*iters: Mapping[KT2, VT2]) -> dict[KT1|KT2, VT1|VT2]

aveytense.Tense.extend(i: Iterable[T1], /,
*iters: Iterable[T2]) -> list[T1|T2]

≥ 0.3.27a4
Appends items from all iterables (in order as they appear) to a new list formalized from first parameter, and return this list. This class method is pure and paired with ~.Tense.append() class method. Typically this class method is extension of inbuilt list method list.extend(). $k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[extend]([$s[e]], {$s[f], $s[g]}, ($s[h],)) # ['e', 'f', 'g', 'h']

0.3.34: because code normally converts sequence to a list builtin, the method now accepts any iterables.

0.3.39 0.3.46: added support for mappings. In order as they appear in both parameters, these will be returned in a new dictionary. If key in 2 or more mappings are the same, its value is value from the key's last occurrence. Example: $t[Tense].$tm[extend]({$n[1]: $n[87]}, {$n[2]: $n[70], $n[3]: $n[112]}, {$n[1], $n[96]}) # {1: 96, 2: 70, 3: 112}
aveytense.Tense.first(i: Sequence[T] | AbstractSet[T], /, condition: ((T) -> bool) | None = None,
default: S = None) -> T|S
aveytense.Tense.first(i, /, condition = None, default = None) ≥ 0.3.26rc2

Returns first item from sequence, which satisfied condition or default, if none satisfied condition. This class method is paired with ~.Tense.last() class method.

0.3.27a4: removed parameter default.

0.3.34: restored parameter default.

0.3.39
aveytense.Tense.flatten(i, /)
≥ 0.3.49
A pure class method being a re-implementation of class method itertools.chain.from_iterable(). This class method returns a flattened version of a duo-dimensional iterable object. $k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[flatten]([$s[e], $s[f], $s[g], $s[h]]) # ≥ 0.3.50 # <generator object Tense.flatten.<locals>.<genexpr> at 0x0000021214D16EC0> # < 0.3.50: ['e', 'f', 'g', 'h'] 0.3.50: generator is returned instead of a list (list 0.3.49 exclusive).
aveytense.Tense.generator(i: Iterable[T], /, condition: ((T) -> bool) = ...) -> Generator[T, Any, None] aveytense.Tense.generator(i, /, condition = ...) ≥ 0.3.50
A pure class method returning a generator using specific iterable. $k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[generator]([$n[634], $n[53]]) # ≥ 0.3.53: <generator object <aveytense_generator> at 0x0000021214D16EC0> # < 0.3.53: <generator object Tense.generator.<locals>.<genexpr> at 0x0000021214D16EC0> Generator objects are instances of a runtime protocol class collections.abc.Generator, and this class is one of the very few classes from library collections.abc to have instances gained normally and without type hinting. Almost every class from library itertools return a generator object, despite type hinting somehow camouflages this fact with the itertools.pyi file.

0.3.53: Generator expression is no longer used to return the generator object.
aveytense.Tense.getAllItemsTypes(i, /) aveytense.Tense.getAllItemsTypes(i: Iterable[T], /) -> tuple[type[T, ...]] ≥ 0.3.51

This class method is a part of sequence items type checking; returns an unique (without duplicate items) tuple of all iterable items types. Perhaps an iterable object is allowed, it is better to pass a sequence, like a list built-in.

$k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[getAllItemsTypes]([$n[32]] $o[+] [$s[64]]) # (<class 'int'>, <class 'str'>) $t[Tense].$tm[getAllItemsTypes]([$n[32], $n[96]] $o[+] [$s[64]]) # (<class 'int'>, <class 'str'>) # NOT (<class 'int'>, <class 'int'>, <class 'str'>)

If an item isn't an object, however, is a protocol class or subclass of one or more protocol classes, internal code tries to detect if this item is instance of internal class typing._ProtocolMeta, which is a metaclass of class typing.Protocol. In this case there is no use of type constructor. Meanwhile for non-protocol classes e.g.: int, as in type(int), or ~.util.ParamVar as type(~.util.ParamVar), type is returned instead. Usually it is not a good idea, as nesting types with type constructor would return the same type from its parameter.
aveytense.Tense.getGeneric(v, /, tupleEllipsis = False) aveytense.Tense.getGeneric(v: typing.Any, /, tupleEllipsis: bool = False) -> (types.GenericAlias | None) ≥ 0.3.52

Returns types.GenericAlias instance from a target value or None if it is not possible. Can be referred as better equivalent of typing.reveal_type()

In case of objects of classes being subclasses of ABCs from collections.abc, Sequence, AbstractSet and Mapping are doing pretty well:

$k[from] $m[aveytense] $k[import] $t[Tense] $k[from] $m[aveytense].$msu[types] $k[import] $o[*] $k[assert] $t[Tense].$tm[getGeneric]([$n[72]]) $o[==] $c[list][$c[int]] $k[assert] $t[Tense].$tm[getGeneric]({$n[72]}) $o[==] $c[set][$c[int]] $k[assert] $t[Tense].$tm[getGeneric]([$n[72], $s[78]]) $o[==] $c[list][$c[Union][$c[int], $c[str]]] $k[assert] $t[Tense].$tm[getGeneric]({$n[72]: $s[78]}) $o[==] $c[dict][$c[int], $c[str]]

Support for Awaitable, Generator and Coroutine is partial. Perhaps generators are iterable, and to get generator from a coroutine there is __await__() method from Awaitable, generic alias from both are addicted to origin and first type parameter known as yield (in Awaitable class there is only one type parameter), and the rest parameters (known as send and return) have value typing.Any (unlike normally these have value None):

# clarification: # - Generator[YieldType, SendType, ReturnType] # - Coroutine[YieldType, SendType, ReturnType] # - Awaitable[ReturnType] $k[assert] $t[Tense].$tm[getGeneric]($t[Tense].$tm[generator]([$v[i] $k[for] $v[i] $k[in] ($n[1], $n[2], $n[3])])) $o[==] $c[Generator][$c[int], $c[Any], $c[Any]] $k[assert] $t[Tense].$tm[getGeneric]($t[Tense].$tm[generator]([$v[i] $k[for] $v[i] $k[in] ($n[1], $s[2])])) $o[==] $c[Generator][$c[Union][$c[int], $c[str]], $c[Any], $c[Any]]

It is better to use generator objects over Coroutine and Awaitable instances. Since Python 3.13, the close() generator method can return the return type parameter after closing the generator. This subject will be under thoughts. Intention would be copying generator's content before closing procedure. However, this will be only for Python 3.13 and later.

Same goes with Callable. When an annotation is not defined in a parameter, including the return annotation, then typing.Any is used. Every parameter also lose their parameter category (positional, universal, keyword) and their default values:

$k[assert] $t[Tense].$tm[getGeneric]($k[lambda] $p[x]: $con[None]) $o[==] $c[Callable][[$c[Any]], $c[Any]] $tv[_T] $o[=] $c[TypeVar]($s[_T]) # for context, 'aveytense.Tense.expect()' has same annotations as on the right of == operator, # the Callable's arguments. the return type is boolean, but there is no return type annotation, # hence 'typing.Any' $k[assert] $t[Tense].$tm[getGeneric]($t[Tense].$tm[expect]) $o[==] $c[Callable][[$c[Iterable][$tv[_T]], $c[Union][$c[str], $c[range], $c[AbroadType], $c[Uniqual][$c[int]]], $c[Callable][[$tv[_T]], $c[bool]]], $c[Any]] # AssertionError $k[assert] $c[str]($t[Tense].$tm[getGeneric]($t[Tense].$tm[expect])) $o[==] $c[str]($c[Callable][[$c[Iterable][$tv[_T]], $c[Union][$c[str], $c[range], $c[AbroadType], $c[Uniqual][$c[int]]], $c[Callable][[$tv[_T]], $c[bool]]], $c[Any]]) # no AssertionError

If generic alias returned from aveytense.Tense.getGeneric() class method can't match another generic alias built using generic alias syntax, however, are nearly identical, it is good to inspect both with the str class constructor. When value is already a generic alias, it is returned.

0.3.53: Abstract base classes AsyncIterable, AsyncIterator, AsyncGenerator, ItemsView, KeysView and ValuesView are now supported, enhanced segment with Iterator and added optional parameter tupleEllipsis for returned generic version of tuple. Fixed tuples at all (generic alias always had only one, no matter if union, type argument). For mapping views, to prevent name inaccuracy, there are 3 new classes in aveytense.types:

  • aveytense.types.DictItems
  • aveytense.types.DictKeys
  • aveytense.types.DictValues

Denomination reference for mapping views are classes in _collections_abc internal Python module: dict_items, dict_keys and dict_values, meanwhile creating asynchronous generators is much easier with the new class method aveytense.Tense.asyncGenerator().

Examples:

### iterators $k[assert] $t[Tense].$tm[getGeneric]($f[iter]($c[list]())) $o[==] $c[Iterator][$c[list][$c[Any]]] $k[assert] $t[Tense].$tm[getGeneric]($f[iter]([$n[72]])) $o[==] $c[Iterator][$c[list][$c[int]]] $k[assert] $t[Tense].$tm[getGeneric]($f[iter]($c[bytes]())) $o[==] $c[Iterator][$c[bytes]] ### tuples $k[assert] $t[Tense].$tm[getGeneric](($n[72], $n[720])) $o[==] $c[tuple][$c[int], $c[int]] $k[assert] $t[Tense].$tm[getGeneric](($n[72], $n[720]), $p[tupleEllipsis] $o[=] $con[True]) $o[==] $c[tuple][$c[int], $o[...]] $k[assert] $t[Tense].$tm[getGeneric](($n[72], $s[720])) $o[==] $c[tuple][$c[int], $c[str]] $k[assert] $t[Tense].$tm[getGeneric](($n[72], $s[720]), $p[tupleEllipsis] $o[=] $con[True]) $o[==] $c[tuple][$c[Union][$c[int], $c[str]], $o[...]] ### asynchronous generator $k[assert] $t[Tense].$tm[getGeneric]($t[Tense].$tm[asyncGenerator]([$v[i] $k[for] $v[i] $k[in] ($n[1], $n[2], $n[3])])) $o[==] $c[AsyncGenerator][$c[int], $c[Any]] $k[assert] $t[Tense].$tm[getGeneric]($t[Tense].$tm[asyncGenerator]([$v[i] $k[for] $v[i] $k[in] ($n[1], $n[2], $s[3])])) $o[==] $c[AsyncGenerator][$c[Union][$c[int], $c[str]], $c[Any]] ### mapping views # ≥ 3.10 $k[assert] $t[Tense].$tm[getGeneric]({$n[78]: $n[96]}.$f[keys]()) $o[==] $c[DictKeys][$c[int], $c[int]] $k[assert] $t[Tense].$tm[getGeneric]({$n[78]: $n[96]}.$f[values]()) $o[==] $c[DictValues][$c[int], $c[int]] $k[assert] $t[Tense].$tm[getGeneric]({$n[78]: $n[96]}.$f[items]()) $o[==] $c[DictItems][$c[int], $c[int]] # < 3.10 $k[assert] $t[Tense].$tm[getGeneric]({$n[78]: $n[96]}.$f[keys]()) $o[==] $c[DictKeys][$c[int], $c[Any]] $k[assert] $t[Tense].$tm[getGeneric]({$n[78]: $n[96]}.$f[values]()) $o[==] $c[DictValues][$c[Any], $c[int]] $k[assert] $t[Tense].$tm[getGeneric]({$n[78]: $n[96]}.$f[items]()) $o[==] $c[DictItems][$c[int], $c[int]]

It is worth noticing that returned generic alias of a dict class can be a lot more complex if e.g. vars() or frame object property such as f_locals or f_globals is passed. Value types will be gleaned in the second type parameter (aka the value type parameter) and their count will be huge. This complexity is not good for comparing 2 generic aliases returned from aveytense.Tense.getGeneric(). It is recommended to use their __args__ attribute in this case (value types - __args__[1].__args__).
aveytense.Tense.group(*statements, mode = "and-or") aveytense.Tense.group(*statements: Sequence[bool] | AbstractSet[bool], mode: str = "and-or") -> bool ≥ 0.3.34

Returns one boolean value combining all statements into one boolean value.
Parameter mode determines about used logical operators inside and outside provided sequences.
Those are, respectively: before and after the - sign. Every sequence must contain boolean values.

Allowed are following modes:

  • "and-and"
  • "and-or"
  • "and-nand" (since 0.3.40)
  • "and-nor"
  • "or-and"
  • "or-or"
  • "or-nand"
  • "or-nor" (since 0.3.40)
  • "nand-and" (since 0.3.40)
  • "nand-or"
  • "nand-nand"
  • "nand-nor"
  • "nor-and"
  • "nor-nand"
  • "nor-or" (since 0.3.40)
  • "nor-nor"

If you aren't familiar with nor and nand, those are actually equal to, respectively: not OR and not AND. This variation of mode parameter isn't the same as in there.

0.3.40: Case for mode parameter is now insensitive, and added lacking modes: and-nand, nand-and, or-nor and nor-or.
aveytense.Tense.groupby
≥ 0.3.35

Type alias for iterools.groupby
aveytense.Tense.hasattr(o, attr, /, mode = "or")
≥ 0.3.34

Extension of inbuilt function hasattr(), used to detect many attributes at once via parameter attr.
Parameter mode only takes place whether attr is a string tuple.

from aveytense import
a{3: 3}
.print(.hasattr(a, values)) True
.print(.hasattr(a, (values, keys))) True
.print(.hasattr(a, (values, abroad))) True
.print(.hasattr(a, (values, abroad), modeand)) False

0.3.39 0.3.49: many objects can be inspected. In this case o parameter must be a tuple of objects to take place. However, class method permits check only one attribute at once.
aveytense.Tense.improvedBogoSort(i, /, key = ...)
≥ 0.3.42

Returns accesses as an integer and sorted iterable as a list in a 2-item tuple. Bogosort uses constant shuffling until the sequence is sorted.
aveytense.Tense.inequal(*v)
≥ 0.3.41

Same as v[0] != v[1] and v[1] != v[2] and ... and v[n - 1] != v[n], where n is index for last item in v.

This class method can be used to detect, if a sequence has only unique items by using unpacking operator *. If at least one value repeats, or has different type than all other values, then False is returned.

This class method is paired with aveytense.Tense.equal().
aveytense.Tense.insort(a, x, /, l = 0, h = None,
dir = INSORT_LEFT, *, key = None)

≥ 0.3.26rc2

Same as bisect.insort() / bisect.insort_left(), just dir parameter determines, which insort function to invoke. Possible values:
Constant Lifetime Description
~.Tense.INSORT_LEFT /
~.constants.INSORT_LEFT
≥ 0.3.26rc2
≥ 0.3.35
Invokes bisect.insort_left().
~.Tense.INSORT_RIGHT /
~.constants.INSORT_RIGHT
≥ 0.3.26rc2
≥ 0.3.35
Invokes bisect.insort_right().
aveytense.Tense.intersection(v, /, *_)
≥ 0.3.34

Returns boolean, integer or iterables intersection, depending, which one is passed to the first parameter.
For integers, returned is bitwise AND of all integers (v & _[0] & _[1] & ...).
For boolean values, returned is logical AND (v and _[0] and _[1] and ...).
For iterables, used is set(v).intersection(*_).

This class method is paired with ~.Tense.union().
aveytense.Tense.isAbroad(v, /, *_, mode = MODE_AND)
≥ 0.3.50
Used to inspect abroad objects.
aveytense.Tense.isBool(v, /, *_, mode = MODE_AND)
aveytense.Tense.isBoolean(v, /, *_, mode = MODE_AND)
1. ≥ 0.3.26b3
2. ≥ 0.3.26rc1

Determine whether passed object is a bool object.

0.3.36: many values may be now inspected. Previous signature (v, /) is now an overload.
aveytense.Tense.isByteArray(v, /, *_, mode = MODE_AND)
≥ 0.3.35

Determine whether passed object is a bytearray object.

0.3.36: many values may be now inspected. Previous signature (v, /) is now an overload.
aveytense.Tense.isBytes(v, /, *_, mode = MODE_AND)
≥ 0.3.35

Determine whether passed object is a bytes object.

0.3.36: many values may be now inspected. Previous signature (v, /) is now an overload.
aveytense.Tense.isComplex(v, /, *_, mode = MODE_AND)
≥ 0.3.26b3

Determine whether passed object is a complex object.

from aveytense import
a6572j
b68
.print(.isComplex(a)) True
.print(.isComplex(b)) False

since 0.3.36, see change note below
.print(.isComplex(a, b)) False
.print(.isComplex(a, b, modeand)) False
.print(.isComplex(a, b, modeor)) True

0.3.36: many values may be now inspected. Previous signature (v, /) is now an overload.
aveytense.Tense.isDict(v, /, ktype = Any, vtype = Any)
≥ 0.3.31

Determine whether passed object is a dict object.

$k[from] $m[aveytense] $k[import] $o[*] $k[from] $m[aveytense].$msu[types] $k[import] $c[Union] $v[a] $o[=] {$n[3]: $s[3]} $t[Tense].$tm[print]($t[Tense].$tm[isDict]($v[a])) # True ### ≥ 0.3.34 $t[Tense].$tm[print]($t[Tense].$tm[isDict]($v[a], $c[int])) # True $t[Tense].$tm[print]($t[Tense].$tm[isDict]($v[a], $c[int], $c[str])) # True $t[Tense].$tm[print]($t[Tense].$tm[isDict]($v[a], $c[str], $c[int])) # False ### ≥ 0.3.35 $t[Tense].$tm[print]($t[Tense].$tm[isDict]($v[a], ($c[int], $c[str]), $c[int])) # False $t[Tense].$tm[print]($t[Tense].$tm[isDict]($v[a], ($c[int], $c[str]), ($c[int], $c[str]))) # True

0.3.34: added parameters ktype and vtype to enhance dict type checking.
ktype is demanded type for keys and vtype is demanded type for values.

0.3.35: ktype and vtype now support union types. In this case it is required to wrap these in a tuple. Examples:
  • isDict(v, ()) and isDict(v, (), ()) are the same as isDict(v)
  • isDict(v, (int, str)) is the same as isDict(v, int) or isDict(v, str) (key must be of type either int or str)
  • isDict(v, (int, str), str) means key must be of type either int or str, and value must be of type str
  • isDict(v, (int, str), (int, str)) means key and value must be of types either int or str

0.3.36: type now supports union types with typing.Union and since Python 3.10: X | Y | .... This also patched an error when using these for version 0.3.35; instead of type(int | str) it is now freely possible to use int | str. In the same version provided initial support for generic types, which may be extended in further versions.

It is recommended to use bool(~.Tense.isDict(...)) if type hinting doesn't work as intended.
aveytense.Tense.isEllipsis(v, /, *_, mode = MODE_AND)
≥ 0.3.26

Determine whether passed object is an Ellipsis object.

0.3.36: many values may be now inspected. Previous signature (v, /) is now an overload.
aveytense.Tense.isFinalClass(v, /, *_, mode = MODE_AND)
≥ 0.3.41

Returns True, if value is a final class.
aveytense.Tense.isFinalProperty(v, /, *_, mode = MODE_AND)
≥ 0.3.41

Returns True, if value is instance of aveytense.util.finalproperty class.
aveytense.Tense.isFinalVar(v, /, *_, mode = MODE_AND)
≥ 0.3.38

Determine whether passed object is an instance of class aveytense.util.FinalVar.
aveytense.Tense.isFloat(v, /, *_, mode = MODE_AND)
≥ 0.3.26b3

Determine whether passed object is a float object.

0.3.36: many values may be now inspected. Previous signature (v, /) is now an overload.
aveytense.Tense.isFrozenSet(v, /, type = Any)
≥ 0.3.35

Determine whether passed object is a frozenset object.
Parameter type allows to enhance frozenset type checking. For union types, wrap types in a tuple. Examples:
  • isFrozenSet(v, ()) is the same as isFrozenSet(v)
  • isFrozenSet(v, (int, str)) is the same as isFrozenSet(v, int) or isFrozenSet(v, str) (either int or str)

0.3.36: type now supports union types with typing.Union and since Python 3.10: X | Y | .... This also patched an error when using these for version 0.3.35; instead of type(int | str) it is now freely possible to use int | str. In the same version provided initial support for generic types, which may be extended in further versions.

It is recommended to use bool(~.Tense.isFrozenSet(...)) if type hinting doesn't work as intended.
aveytense.Tense.isGeneric(v, /, *_, mode = MODE_AND)
≥ 0.3.53

Determine whether a value is a generic class. First code checks if it is a subclass of typing.Generic, then it looks for the __class_getitem__() method, which is supposed to return instance of types.GenericAlias (available since Python 3.9). The second statement is ignored when using Python 3.8.
aveytense.Tense.isInt(v, /, *_, mode = MODE_AND)
aveytense.Tense.isInteger(v, /, *_, mode = MODE_AND)
1. ≥ 0.3.26b3
2. ≥ 0.3.26rc1

Determine whether passed object is an int object.

0.3.36: many values may be now inspected. Previous signature (v, /) is now an overload.
aveytense.Tense.isList(v, /, type = Any)
≥ 0.3.26rc1

Determine whether passed object is a list object.

$k[from] $m[aveytense] $k[import] $o[*] $k[from] $m[aveytense].$msu[types] $k[import] $c[Union] $t[Tense].$tm[print]($t[Tense].$tm[isList]([$n[120]])) # True $t[Tense].$tm[print]($t[Tense].$tm[isList]({$n[120]})) # False ### ≥ 0.3.34 $t[Tense].$tm[print]($t[Tense].$tm[isList]([$n[120]], ())) # True $t[Tense].$tm[print]($t[Tense].$tm[isList]([$n[120]], $c[int])) # True $t[Tense].$tm[print]($t[Tense].$tm[isList]([$n[120]], $c[str])) # False ### ≥ 0.3.35 $t[Tense].$tm[print]($t[Tense].$tm[isList]([$n[120]], ($c[int], $c[str]))) # True $t[Tense].$tm[print]($t[Tense].$tm[isList]([$n[120]], ($c[float], $c[str]))) # False ### ≥ 0.3.36 $t[Tense].$tm[print]($t[Tense].$tm[isList]([$n[120]], $c[Union][$c[int], $c[str]])) # True $t[Tense].$tm[print]($t[Tense].$tm[isList]([$n[120]], $c[Union][$c[float], $c[str]])) # False

0.3.34: added parameter type to enhance list type checking.

0.3.35: parameter type now supports union types. In this case it is required to wrap these in a tuple. Examples:
  • isList(v, ()) is the same as isList(v)
  • isList(v, (int, str)) is the same as isList(v, int) or isList(v, str) (either int or str)

0.3.36: type now supports union types with typing.Union and since Python 3.10: X | Y | .... This also patched an error when using these for version 0.3.35; instead of type(int | str) it is now freely possible to use int | str. In the same version provided initial support for generic types, which may be extended in further versions.

It is recommended to use bool(~.Tense.isList(...)) if type hinting doesn't work as intended.
aveytense.Tense.isMemoryView(v, /, *_, mode = MODE_AND)
≥ 0.3.35

Determine whether passed object is memoryview object.

0.3.36: many values may be now inspected. Previous signature (v, /) is now an overload.
aveytense.Tense.isNone(v, /, *_, mode = MODE_AND)
≥ 0.3.26b3

Determine whether passed object is None.

0.3.36: many values may be now inspected. Previous signature (v, /) is now an overload.
aveytense.Tense.isSet(v, /, type = Any)
≥ 0.3.35

Determine whether passed object is a set object. Parameter type allows to enhance set type checking. For union types, wrap types in a tuple. Examples: $k[from] $m[aveytense] $k[import] $o[*] $k[from] $m[aveytense].$msu[types] $k[import] $c[Union] $t[Tense].$tm[print]($t[Tense].$tm[isSet]({$n[54]})) # True $t[Tense].$tm[print]($t[Tense].$tm[isSet]([$n[54]])) # False $t[Tense].$tm[print]($t[Tense].$tm[isSet]({$n[54]}, ())) # True $t[Tense].$tm[print]($t[Tense].$tm[isSet]({$n[54]}, $c[int])) # True $t[Tense].$tm[print]($t[Tense].$tm[isSet]({$n[54]}, $c[str])) # False $t[Tense].$tm[print]($t[Tense].$tm[isSet]({$n[54]}, ($c[int], $c[str]))) # True $t[Tense].$tm[print]($t[Tense].$tm[isSet]({$n[54]}, ($c[float], $c[str]))) # False ### ≥ 0.3.36 $t[Tense].$tm[print]($t[Tense].$tm[isSet]({$n[54]}, $c[Union][$c[int], $c[str]])) # True $t[Tense].$tm[print]($t[Tense].$tm[isSet]({$n[54]}, $c[Union][$c[float], $c[str]])) # False

0.3.36: type now supports union types with typing.Union and since Python 3.10: X | Y | .... This also patched an error when using these for version 0.3.35; instead of type(int | str) it is now freely possible to use int | str. In the same version provided initial support for generic types, which may be extended in further versions.

It is recommended to use bool(~.Tense.isSet(...)) if type hinting doesn't work as intended.
aveytense.Tense.isStr(v: Any, /, *_: Any, mode: _Mode = MODE_AND) -> bool
aveytense.Tense.isString(v: Any, /, *_: Any, mode: _Mode = MODE_AND) -> bool (where _Mode = Literal["and", "or", MODE_AND, MODE_OR])
aveytense.Tense.isStr(v, /, *_, mode = MODE_AND)
aveytense.Tense.isString(v, /, *_, mode = MODE_AND)
1. ≥ 0.3.26b3
2. ≥ 0.3.26rc1

Determine whether passed object is a str object.

0.3.36: many values may be now inspected. Previous signature (v, /) is now an overload.
aveytense.Tense.isTuple(v: Any, /, type: type = Any) -> bool aveytense.Tense.isTuple(v, /, type = Any) ≥ 0.3.26rc1

Determine whether passed object is a tuple object.

$k[from] $m[aveytense] $k[import] $o[*] $k[from] $m[aveytense].$msu[types] $k[import] $c[Union] $t[Tense].$tm[print]($t[Tense].$tm[isTuple](($n[72],))) # True $t[Tense].$tm[print]($t[Tense].$tm[isTuple]([$n[72],])) # False ### ≥ 0.3.34 $t[Tense].$tm[print]($t[Tense].$tm[isTuple](($n[72],), ())) # True $t[Tense].$tm[print]($t[Tense].$tm[isTuple](($n[72],), $c[int])) # True $t[Tense].$tm[print]($t[Tense].$tm[isTuple](($n[72],), $c[str])) # False ### ≥ 0.3.35 $t[Tense].$tm[print]($t[Tense].$tm[isTuple](($n[72],), ($c[int], $c[str]))) # True $t[Tense].$tm[print]($t[Tense].$tm[isTuple](($n[72],), ($c[float], $c[str]))) # False ### ≥ 0.3.36 $t[Tense].$tm[print]($t[Tense].$tm[isTuple](($n[72],), $c[Union][$c[int], $c[str]])) # True $t[Tense].$tm[print]($t[Tense].$tm[isTuple](($n[72],), $c[Union][$c[float], $c[str]])) # False

0.3.34: added parameter type to enhance tuple type checking.

0.3.35: parameter type now supports union types. In this case it is required to wrap these in a tuple. Examples:
  • isTuple(v, ()) is the same as isTuple(v)
  • isTuple(v, (int, str)) is the same as isTuple(v, int) or isTuple(v, str) (either int or str)

0.3.36: type now supports union types with typing.Union and since Python 3.10: X | Y | .... This also patched an error when using these for version 0.3.35; instead of type(int | str) it is now freely possible to use int | str. In the same version provided initial support for generic types, which may be extended in further versions.

It is recommended to use bool(~.Tense.isTuple(...)) if type hinting doesn't work as intended.
aveytense.Tense.isTuple2(v1: tuple, v2: tuple[type, ...], /) -> bool aveytense.Tense.isTuple2(v1, v2, /) ≥ 0.3.43
Extension of ~.Tense.isTuple() class method and inbuilt function isinstance(). Returns True, if type requirement for all items in first parameter from second parameter are satisfied. This class method is the experimental concept with types parameter in method ~.Tense.isTuple(), which was finally revoked in version 0.3.34, to decrease strictness of this method and after conclusion it didn't work as intended. Both v1 and v2 must be tuples; in case of v2 a tuple of types only. Value assignment in v2 parameter is similar to type parameter in ~.Tense.isTuple() class method, however, types themselves must be encased in a tuple, as in examples below. Returned boolean value is addicted to both parameters v1 and v2. This class method uses the following rules:
  • If v2 tuple has size least than v1 tuple, then v2 tuple last item has to satisfy the remaining items in v1 tuple.
  • If v2 tuple has the same size as v1 tuple, each item in v1 tuple has its type requirement with same indexes as in v2 tuple.
  • If v2 tuple has size greater than v1 tuple, then TypeError is thrown.
Examples: $k[from] $m[aveytense] $k[import] $o[*] $t[Tense].$m[print]($t[Tense].$tm[isTuple2]((), ())) # True $t[Tense].$m[print]($t[Tense].$tm[isTuple2]((), ($msu[util].$v[Any],))) # True $t[Tense].$m[print]($t[Tense].$tm[isTuple2]((), ($msu[util].$v[Any], $msu[util].$v[Any]))) # False $t[Tense].$m[print]($t[Tense].$tm[isTuple2]((), ($msu[util].$v[Any], $msu[util].$v[Any], $msu[util].$v[Any]))) # False $t[Tense].$m[print]($t[Tense].$tm[isTuple2](($n[132], $n[432]), ($c[int],))) # True; same as ~.Tense.isTuple((132, 432), int) $t[Tense].$m[print]($t[Tense].$tm[isTuple2](($n[132], $n[432]), ($c[int], $c[int]))) # True $t[Tense].$m[print]($t[Tense].$tm[isTuple2](($n[132], $n[432]), ($c[int], $c[int], $c[int]))) # throws TypeError $t[Tense].$m[print]($t[Tense].$tm[isTuple2](($n[132], $n[432]), (($c[int], $c[str]),))) # True; same as ~.Tense.isTuple((132, 432), (int, str)) $t[Tense].$m[print]($t[Tense].$tm[isTuple2](($n[132], $n[432]), ($c[int], $c[str]))) # False; NOT same as ~.Tense.isTuple((132, 432), (int, str)) $t[Tense].$m[print]($t[Tense].$tm[isTuple2](($n[132], $n[432]), ($c[str],))) # False; same as ~.Tense.isTuple((132, 432), str) $t[Tense].$m[print]($t[Tense].$tm[isTuple2](($n[132], $n[432]), (($c[int], $c[str]), int))) # True $t[Tense].$m[print]($t[Tense].$tm[isTuple2](($n[132], $n[432]), (($c[int], $c[str]), str))) # False $t[Tense].$m[print]($t[Tense].$tm[isTuple2](($n[132], $n[432]), (($c[int], $c[str]), ($c[int], $c[str])))) # True

It is recommended to use bool(~.Tense.isTuple2(...)) if type hinting doesn't work as intended.
aveytense.Tense.last(i: Sequence[T] | AbstractSet[T], /, condition: ((T) -> bool) | None = None,
default: S = None) -> T|S
aveytense.Tense.last(i, /, condition = None, default = None) ≥ 0.3.26rc2

Returns the last item from sequence, which satisfied condition or default, if none satisfied condition. This class method is paired with ~.Tense.first() class method.

0.3.27a4: removed parameter default.

0.3.34: restored parameter default.
aveytense.Tense.occurrences(v: <mixed>, *items: <mixed>, mode: <mixed> = ...) -> int aveytense.Tense.occurrences(v, *items, mode = ...) ≥ 0.3.32
Returns amount of times whether item or items appear in specified sequence. This is like how str.count() string method works, just it applies to de facto every type of sequences.
aveytense.Tense.pick(i: Sequence[T] | AbstractSet[T] | Mapping[T, Any], /) -> T aveytense.Tense.pick(i, /) ≥ 0.3.8
Returns a random item from a sequence. This class method is more developed version of random.choice().

0.3.34: added support for mappings and new parameter secure to generate cryptographically safe result. The secure parameter was actually a reference of re-implemented pseudo-random functions in inbuilt Python module secrets, especially words cryptographically secure. This parameter has been removed on 0.3.51, because both secrets.choice() and random.choice() seem to be the same to each other. 0.3.51: removed parameter secure (see note above).
aveytense.Tense.probability(*vf: T | Sequence[T | int | EllipsisType | None] | AbstractSet[T | int | EllipsisType | None] | Mapping[T, int | EllipsisType | None]) -> T (≥ 0.3.8) aveytense.Tense.probability(*vf) ≥ 0.3.8
Returns one of values passed to parameter vf (alias to values-frequencies) with given chances. Unlike for random.sample(), no item repetition is used as with parameter counts, and an internal dictionary is created instead of list, to be used for ~.Tense.pick() class method.

This class method bases on the math probability defintion.

In-code syntax would be (<> - required, [] - optional):

# ≥ 0.3.46 $t[Tense].$tm[probability](   -> $k[sequence] (e.g. list, tuple, set, frozenset):     <item 1: any-value>, [item 2: positive integer]     at least 2 sequences if nothing else provided   -> $k[mapping] (e.g. dict):     <key: any-value>, <value: positive integer>     at least 2 key-value pairs if nothing else provided   -> $k[value]     at least 2 if nothing else provided ) # < 0.3.46 $t[Tense].$tm[probability](   -> $k[list], $k[tuple], $k[set], $k[frozenset], $k[deque]:     <item 1: integer>, [item 2: positive integer]     at least 2 sequences if nothing else provided   -> $k[dict]:     <key: integer>, <value: positive integer>     at least 2 dictionairies with one pair if nothing else provided   -> $k[integer]     at least 2 if nothing else provided )

If only one-item sequences, mappings with frequency 1 and non-sequence-non-mapping values are passed, the code treats all of the values with the same chance of dropping (fn = 1), makes it working practically the same as ~.Tense.pick(). In reality this class method invokes ~.Tense.probability3() class method; before 0.3.46 its internal code was way more complex and also too repetitive in case of statements, what was less efficient.

If fn (alias to frequency, right-side integer in 2-item sequence) for any n wasn't defined, then fn defaults to 1. fn takes a role as probability fraction nominator, as in: P(vn) = fn / Sn, where Sn is sum of all fn values.

Below example for coin flip:

$k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[print]($t[Tense].$tm[probability]([$n[0], $n[2]], [$n[1], $n[5999]], [$n[2], $n[5999]])) # 0 means 'side' $t[Tense].$tm[print]($t[Tense].$tm[probability]([$s[side], $n[2]], [$s[heads], $n[5999]], [$s[tails], $n[5999]])) # ≥ 0.3.46

Left-side item in sequences or key in a mappings (there vn) is a value to drop, meanwhile right-side integer in sequences or integer value in a mappings (there fn) is value for nominator in fraction probability would return. Sum of all right-side integers and values in mappings create length (there Sn), which becomes probability fraction denominator for every vn. If there was only one item in a sequence, then that's considered addition by 1. Same goes when fn equals Ellipsis.

Since only two-item lists are passed, then Sn equals: 2 + 5999 + 5999 = 12000. This is affirmed probability fraction denominator for every vn, every vn has its fraction nominator fn, so the conclusion is:

  • coin on side: P(0) = 212000 = 16000 = 0.01(6)%
  • coin on heads: P(1) = 599912000 = 49.991(6)%
  • coin on tails: P(2) = 599912000 = 49.991(6)%

vn is returned as frequently as high its probability value P(vn) is. There 0 and "side" have the weakest chances to return themselves.

0.3.19: new signature (*valuesAndFrequencies, length = -1) (12th October 2023), and renamed method from complexity() to current name. Earlier, this method had signature (values, frequencies, length = -1), which was more liable for errors (expected values and frequencies to have same size).

0.3.24: added support for dictionairies, and constant PROBABILITY_COMPUTE (previous name was PROBABILITY_ALL) as default value for parameter length.

0.3.25: renamed parameter valuesAndFrequencies to vf (values-frequencies), added support for sets, frozensets. Also, added support for default values (normally 1 per each value): None and ellipsis.

0.3.26a3: first patch of ZeroDivisionError. It was in case of 2 values (tests from morning 19th July 2024).

0.3.26b3: added limit to sys.maxsize (earlier there wasn't one).

0.3.26rc1: added support for final variables initialized via aveytense.util.FinalVar.

0.3.26rc2: cancelled support for aveytense.util.FinalVar and added support for tkinter.IntVar.

0.3.31: cancelled support for tkinter.IntVar.

0.3.33: revamp in code; attempt shortening the code.

0.3.35: second patch of ZeroDivisionError (modulo operation was the cause). 0.3.46: third patch of ZeroDivisionError; shortened internal code and removed length parameter. Support for None will be retracted in the future. Moreover, removed necessity passing True to option ~.TenseOptions.disableProbability2LengthLimit to bypass sys.maxsize. If there is only one item, it must be a mapping to prevent throwing an error. Supported types is wider: to objects of classes extending one of following collections.abc ABCs: Sequence, AbstractSet or Mapping. Returned type is no longer restricted to integer too.
aveytense.Tense.probability2(x: T1 = 1, y: T2 = 0, frequency: int = 1,
length: int | Tense.PROBABILITY_COMPUTE = 10000) -> T1|T2
aveytense.Tense.probability2(x = 1, y = 0, frequency = 1, length = 10000) ≥ 0.3.8; < 0.3.24; ≥ 0.3.25
Simplier implementation of math probability; operates on 2 values. This method is invoked whether ~.Tense.probability() gets 2 values. Probability of returning x and y is determined by both length and frequency:
  • returned is x with probability P(x) = frequency / length
  • returned is x with probability P(y) = 1 - (frequency / length) = 1 - P(x)

Basically P(y) equals P(x') (see complementary event). In opposite of ~.Tense.probability() class method, this class method serves any types support before 0.3.46, however, until 0.3.46 both x and y had to have the same type to avoid additional type checking. Code below is re-implementation of coin flip with same probability as in example in ~.Tense.probability(): $k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[print]($t[Tense].$tm[probability2]($s[side], $t[Tense].$tm[pick](($s[heads], $s[tails])), $p[length] $o[=] $n[6000])) Math probability properties:
  • frequency ≥ 0
  • length > 0
  • return x with 100% chance, if frequency / length ≥ 1 (occurs when frequency ≥ length)
  • return y with 100% chance, if frequency = 0

If x = y, y is returned. Since both of these parameters are equal, there is no matter which one will be returned.

x = y comes from comparison with the == operator, which can be manipulated by defining the __eq__() special dunder method. If it is not defined wisely (e.g. not boolean value returned), this can lead to unintentional error. Most common is TypeError deriving from unsupported types when using this operator. On 0.3.51 provided TypeError catching statement to prevent this. 0.3.19: new signature (rareValue = 1, usualValue = 0, frequency, length), and renamed method from probability() to current name.
Earlier, this method had signature (value = 1, frequency, value), and not many things were able to be done due to restricting returned values to 0 and value.

0.3.24. This happened unexpectedly while rewriting the code utterly.

0.3.25: restored method probability2() with same parameters, with some denomination changes: rareValue was renamed to x,
and usualValue was renamed to y. Default values of both were kept.

0.3.26a3: length now can have value -1 to refer to default value 10000.

0.3.31: added option aveytense.TenseOptions.disableProbability2LengthLimit to remove the limit related to sys.maxsize (default value False).

0.3.33: finished tests on this option. 0.3.46: removed necessity passing True to option ~.TenseOptions.disableProbability2LengthLimit to bypass sys.maxsize.

Before version 0.3.46, to disqualify limit imposed by sys.maxsize attribute, there was a special attribute ~.TenseOptions.disableProbability2LengthLimit, which was defined on 0.3.31 and became operational on 0.3.33. Reason there was such limit was because internal code used a list that was subsequently used in ~.Tense.pick() class method in order to return the value. And due to play of the attribute sys.maxsize there, limit varied due to system's architecture (2a - 1, where a ∈ {32, 64}). As version 0.3.46 has been published, limit has been removed, along with ~.TenseOptions.disableProbability2LengthLimit. 0.3.51: provided TypeError catching when comparing x with y using == operator. See warning note above.
aveytense.Tense.probability3(vf: Mapping[T, int | EllipsisType], /) -> T aveytense.Tense.probability3(vf, /) ≥ 0.3.46
Abridged version of ~.Tense.probability() class method. In contrast to ~.Tense.probability(), it also operates on many values, however, difference is that vf parameter only accepts a mapping with at least 2 pairs. Value (there fn) in a pair key-value must be either positive integer or an ellipsis (interpreted as value 1). Math scheme is following: P(vn) = fnlength, where length is deduced from sum of all fn numbers, and syntax in-code: $k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[probability3]({   <v1: f1>,   <v2: f2>,   [v3: f3],   ...,   [vN: fN] }) Coin flip example: $k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[print]($t[Tense].$tm[probability3]({ $s[side]: $n[2], $s[heads]: $n[5999], $s[tails]: $n[5999] })) Because vf parameter isn't variable as in ~.Tense.probability(), and its internal code is shorter, ~.Tense.probability3() is circa 3 times faster than ~.Tense.probability().
aveytense.Tense.random(x: Sequence[T] | AbstractSet[T], /) -> T
aveytense.Tense.random(x: int, /) -> int
aveytense.Tense.random(x: int, y: int, /) -> int
aveytense.Tense.random(x, y = None, /) ≥ 0.3.24

If y is None, returns random item from sequence or integer from range [0, x], otherwise returns integer from range [x, y], depending which one is greater.

0.3.34: support for sequences and single integer.
aveytense.Tense.repeat(value: T, times: Optional[int] = None, /) -> Generator[T, Any, None] aveytense.Tense.repeat(value, times = None, /) ≥ 0.3.25

Re-implementation of itertools.repeat().

Repeats value specified amount of times and returns a generator. In previous versions this class method can return a list.
aveytense.Tense.reverse(v: str) -> str
aveytense.Tense.reverse(v: ~.util.MutableString) -> ~.util.MutableString
aveytense.Tense.reverse(v: AbroadInitializer) -> list[int]
aveytense.Tense.reverse(v: Sequence[T] | AbstractSet[T]) -> list[T]
aveytense.Tense.reverse(v: Generator[Yield, Send, Return]) -> Generator[Yield, Send, Return]
aveytense.Tense.reverse(v: AsyncGenerator[Yield, Send]) -> AsyncGenerator[Yield, Send]
aveytense.Tense.reverse(v: Mapping[KT, VT]) -> dict[KT, VT]
aveytense.Tense.reverse(v: Reversible[T]) -> Iterator[T]
aveytense.Tense.reverse(v) ≥ 0.3.26rc2
A pure class method returning reversed version of an iterable passed to the parameter. It is bound with use of slicing [::-1] and the reversed class. See changes below for type support. Primal supported types are sequences, including strings. This class method is paired with ~.Tense.shuffle() class method. $k[from] $m[aveytense] $k[import] $t[Tense] $v[a] $o[=] $s[hello!] $t[Tense].$tm[print]($t[Tense].$tm[reverse]($v[a]), $v[a]) # "!olleh" "hello!"

0.3.34: added support for mappings and abroad objects. 0.3.42: instances of classes inheriting collections.abc.AbstractSet (including set class) now return a shuffled set inbuilt class instance. Earlier, these returned shuffled list. Added support for generators (these return list). 0.3.43: added support for ~.util.MutableString instances. 0.3.45: sets return list (sets are always placed ascendingly) 0.3.53: generators now return generators, added support for asynchronous generators
aveytense.Tense.shuffle(v: str) -> str
aveytense.Tense.shuffle(v: ~.util.MutableString) -> ~.util.MutableString
aveytense.Tense.shuffle(v: AbroadInitializer) -> list[int]
aveytense.Tense.shuffle(v: Sequence[T] | AbstractSet[T]) -> list[T]
aveytense.Tense.shuffle(v: Generator[Yield, Send, Return]) -> Generator[Yield, Send, Return]
aveytense.Tense.shuffle(v: AsyncGenerator[Yield, Send]) -> AsyncGenerator[Yield, Send]
aveytense.Tense.shuffle(v: Mapping[KT, VT]) -> dict[KT, VT]
aveytense.Tense.shuffle(v) ≥ 0.3.26rc2
A pure class method returning shuffled version of an iterable passed to the parameter. It is bound with use of random.shuffle() impure function. See changes below for types support. Primal supported types are sequences, including strings. This class method is paired with ~.Tense.reverse() class method. $k[from] $m[aveytense] $k[import] $t[Tense] $v[a] $o[=] $s[hello!] $t[Tense].$tm[print]($t[Tense].$tm[shuffle]($v[a]), $v[a]) # "ohl!el" "hello!"

0.3.34: added support for mappings and abroad objects. 0.3.42: instances of classes inheriting collections.abc.AbstractSet (including set class) now return a reversed set inbuilt class instance. Earlier, these returned reversed list. Added support for generators (these return list) and instances of classes inheriting collections.abc.Reversible. 0.3.43: added support for ~.util.MutableString instances. 0.3.45: sets return list (sets are always placed ascendingly) 0.3.53: generators now return generators, added support for asynchronous generators
aveytense.Tense.sleep(seconds: float, /) -> ~.Tense (≥ 0.3.46) aveytense.Tense.sleep(seconds, /) ≥ 0.3.25
Equivalent to time.sleep(), just returns reference to ~.Tense instead of None. AveyTense owner's footnote: This might be equal to passing value of time.time() function to an internal variable, and using the while loop with statement while time.time() - <var> ≥ seconds: <var> = time.time().
aveytense.Tense.starmap(f, i, /)
≥ 0.3.35
Equivalent to itertools.starmap.
aveytense.Tense.startswith(target, prefix, /, mode = constants.MODE_OR, start = ..., end = ...)
≥ 0.3.42
Blend of str.startwith() and bytes.startwith() that allows to inspect many values at once.
aveytense.Tense.test(target, pattern, flags = 0)
≥ 0.3.42
Equivalent to re.match(pattern, target, flags) is not None. Noteworthy that target and pattern parameters, unlike in re.match() function, have inverted positions. Name of this class method is reference to JavaScript method RegExp.test().

aveytense.Tense.timeit(statement: () -> Any, /) -> float aveytense.Tense.timeit(statement, /) ≥ 0.3.26rc3

Returns invocation time of specified statement. This class method is simplified version of timeit.timeit() function. To invoke callable with arguments, use lambda: <func-name>(...).

$k[from] $m[aveytense] $k[import] $o[*] $t[Tense].$tm[print]($t[Tense].$tm[timeit]($k[lambda]: $t[Tense].$tm[generator]([$n[66]]))) # 1.52587890625e-05 $t[Tense].$tm[print]($t[Tense].$tm[timeit]($k[lambda]: $c[Math].$f[fact]($n[66]))) # 4.76837158203125e-06 $t[Tense].$tm[print]($t[Tense].$tm[timeit]($k[lambda]: $a[d]($n[66]))) # 5.91278076171875e-05 $t[Tense].$tm[print]($t[Tense].$tm[timeit]($k[lambda]: $n[66])) # 9.5367431640625e-07

aveytense.Tense.union(v, /, *_)
≥ 0.3.34
Returns boolean, integer or iterables union, depending, which one is passed to the first parameter.
aveytense.Tense.until(desiredString, /, message = None, caseInsensitive = True)
≥ 0.3.25

Console-specific method, creates a while loop and it ends until user writes desired string, or any from specified, if first parameter is a string sequence. message will be written as an argument of inbuilt input() function. caseInsensitive makes string matching less strict; allows any-cased string.

0.3.35: extended gamut of sequences that can be passed to parameter desiredString, and added string type hint.
aveytense.Tense.upgrade(aveytense = True)
≥ 0.3.36; < 0.3.48

Console-specific class method for installing libraries from PyPi.

0.3.39: added parameter aveytense.

0.3.46

0.3.48
aveytense.Tense.uuidMd5(namespace, name)
≥ 0.3.26a1

Return an UUID from the MD5 (Message Digest) hash of a namespace UUID and a name

0.3.31: cancelled support for tkinter.StringVar
aveytense.Tense.uuidPrimary(node, clockSeq)
≥ 0.3.26a1

Return an UUID from host ID, sequence number and the current time.

0.3.31: cancelled support for tkinter.IntVar
aveytense.Tense.uuidRandom()
≥ 0.3.26a1

Return a random UUID
aveytense.Tense.uuidSha1(namespace, name)
≥ 0.3.26a1

Return an UUID from the SHA-1 (Secure Hash Algorithm) hash of a namespace UUID and a name

0.3.31: cancelled support for tkinter.StringVar
aveytense.Tense.version
≥ 0.3.26?

Returns current version of AveyTense in a string. Equivalent to removed constant aveytense.constants.VERSION. For example: for version 0.3.48 returned is string "0.3.48". 0.3.50
aveytense.Tense.versionId
≥ 0.3.26?; < 0.3.36

This attribute was equivalent to ~.constants.VERSION_ID. Marked as deprecated and removed in favor of ~.Tense.versionInfo.

0.3.35

0.3.36
aveytense.Tense.versionInfo
≥ 0.3.26?

Equivalent to removed constant ~.constants.VERSION_INFO.

Returns useful information about the AveyTense version on the terminal output, and behaves like sys.version_info variable when it comes to introspection. ~.Tense.versionInfo, like sys.version_info, is instance of a non-instantiable class. To get a tuple version of the version components, use ~.Tense.version.tuple. It is also possible to receive specific version components via following final properties (example for version 0.3.48):

  • ~.Tense.versionInfo.major returns major version component; there 0
  • ~.Tense.versionInfo.minor returns minor version component; there 3
  • ~.Tense.versionInfo.micro returns micro version component; there 48
  • ~.Tense.versionInfo.releaselevel returns release level component as a string; there "final"
  • ~.Tense.versionInfo.serial returns serial version component. It only gets non-zero value when ~.Tense.versionInfo.releaselevel is equal "alpha", "beta" or "candidate". In case of final releases 0 is always returned.

The following code prints detailed information about AveyTense version and its components:

$k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[print]($t[Tense].$v[versionInfo]) 0.3.50
abstract-final-class aveytense.TenseOptions
≥ 0.3.27a5
Provides additional options influencing methods in class ~.Tense. All are variables, which can hold boolean values only.
Option name Lifetime Description
~.disableProbability2LengthLimit ≥ 0.3.31; < 0.3.46 It was applied to ~.Tense.probability2(). Allowed to remove the lengh limit related to sys.maxsize. This attribute was been removed in version 0.3.46, according to change occured in class methods ~.Tense.probability() and ~.Tense.probability2(). 0.3.46
~.initializationMessage ≥ 0.3.27a5; < 0.3.40 It was applied to constructor of ~.Tense. 0.3.40
~.insertionMessage ≥ 0.3.27b1 Applies to . 0.3.50
~.probabilityExtendedLength ≥ unavailable (0.3.27rc1 in code) Had to apply to ~.Tense.probability(). This variable was bound with usage of nested list in order to extend number support, bypassing sys.maxsize. This attribute was marked unrealized in version 0.3.46, according to change occured in class methods ~.Tense.probability2() and ~.Tense.probability().
0.3.50
class aveytense.util.uniquelist(iterable = ...)
≥ 0.3.48
Returns a set-like list object without duplicate items.

This class can be expected as shortcut of list(set(iterable)), but this isn't true. Except no duplicate items, order of the iterable's items doesn't change (set objects sort the iterable in ascending order, as in math), even if excluding the same items directly mutate the returned list. Example:

$k[from] $m[aveytense].$msu[util] $k[import] $c[uniquelist] $v[a] $o[=] [$n[761], $n[891], $n[112], $n[112], $n[891]] $f[print]($c[list]($c[set]($v[a]))) # [112, 761, 891] $f[print]($c[uniquelist]($v[a]))) # [761, 891, 112]

Implementation of aveytense.util.uniquelist class constructor is almost the same (without type hinting) as:

$k[def] $f[uniquelist]($p[iterable] $o[=] $o[...]):   $k[if] $p[iterable] $k[is] $con[Ellipsis]:     $k[return] []   $v[_new_list_] $o[=] []   $v[_list_] $o[=] $c[list]($p[iterable])   $k[for] $v[e] $k[in] $v[_list_]:     $k[if] $v[e] $k[not] $k[in] $v[_list_]:       $v[_new_list_].$f[append]($v[e])   $k[return] $v[_new_list_]

To check, if all items are unique, consider using aveytense.Tense.inequal() with unpacking operator * as aveytense.Tense.inequal(*aveytense.util.uniquelist(iterable)).
class aveytense.util.uniquetuple(iterable = ...)
≥ 0.3.48
Returns a set-like tuple object without duplicate items, as well without order change. In AveyTense code it is the same as tuple(aveytense.util.uniquelist(...)).

Functions and decorators

Functions and decorators in AveyTense. Methods are included in classes.
aveytense.abroad(value1, /, value2 = None, modifier = None) (≥ 0.3.9)
Overall extension of range() function. Represents the easiest function to return abroad objects. The differences between range() and ~.abroad() functions are: Understanding this function might be more sophisticated than range(), but there are benefits: Parameters:

Previous parameter notations probably came to support pre-PEP 570 parameters. This function was really fun to make and solve mistakes inside its code. Its name abroad (behind or outside border) is tantamount with following sentence: this function really deviate from common functionality range() function offers. The argument, which led to start building my own version of range() function is because of reluctance to use this function for no reason totally! It was typically just a resign from using combination range(len()) in favor of this function. Moreover, this function solves several problems, like in class method ~.Tense.probability(). What's interesting, inner code of abroad() function has lack of for loops (only while) and there are no invocations (even one) of range()! Below example counting backwards, with range() function: list((6)) [-6, -5, -4, -3, -2, -1]
list(range(6)) []
0.3.10 0.3.28: the function returns abroad object instead of list built-in.
aveytense.games.aeify(s, /) (≥ 0.3.9; < 0.3.24; ≥ 0.3.26a4; < 0.3.47)
This function converted all a and e letters occurrences into æ. Not recommended for terminals that don't read letters outside Latin-1 (ISO/IEC 8859-1 encoding). 0.3.47: To be used in separate project aveytense_games.
@aveytense.util.final (≥ 0.3.26b3)
Creates a final class. Equivalent to ~.Final, just used as decorator instead of base class.
@aveytense.util.finalmethod (≥ 0.3.27rc2)
Creates a final method. Equivalent to @typing.final.
class @aveytense.util.finalproperty (≥ 0.3.37)
Creates a final property accessible via class instance. This kind of properties cannot be modified nor deleted. To inspect these properties, it is advisable to use ~.Tense.isFinalProperty() class method. Usage with isinstance() Python function as isinstance(<class.attribute>, ~.util.finalproperty) works too. Using isinstance() as isinstance(<class.finalproperty>, property) returns False. Unlike for @property decorator, before 0.3.42, property created via ~.finalproperty decorator had typing.Any type hinted. Version 0.3.42 fixed this issue, but properties decorated with this class (~.finalproperty is actually a class) can have their values accessed via class reference too. Only in version 0.3.43 it has been fixed - and technique from 0.3.42 in method ~.Tense.isFinalProperty(), which required 2-item tuple with a type (class) and member name in a string is no longer required, however, will be kept for backward-compatibility. Since version 0.3.42 ~.finalproperty is generic class. Correct type hint was provided in 0.3.43.
class @aveytense.util.finalpropertycontainer(**properties) (≥ 0.3.43)
This class decorator creates class holding final properties, which values are assigned via variable keyword parameter properties to the affected class. If properties had keyword _static_ (with value True), affected class cannot be initialized, and can access all final properties via reference. If there are already attributes defined, and properties has the same names of attributes, these are overriden by these defined in properties. When _static_ has value True, internal code actually creates an object of the class, and in type hinting it isn't visible. 0.3.50: Marked experimental and not recommended to use; instead use @finalproperty.
aveytense.games.oeify(s, /) (≥ 0.3.9; < 0.3.24; ≥ 0.3.26a4; < 0.3.47)
This function converted all o and e letters occurrences into œ. Not recommended for terminals that don't read letters outside Latin-1 (ISO/IEC 8859-1 encoding). 0.3.47: To be used in separate project aveytense_games.
aveytense.games.owoify(s, /) (≥ 0.3.9; < 0.3.24; ≥ 0.3.25; < 0.3.47)
aveytense.games.uwuify(s, /) (≥ 0.3.27b2; < 0.3.47)
A joke function, which translated a string into a furry talk. Source here 0.3.47: To be used in separate project aveytense_games.
Site created by Aveyzan on 31st July 2022