AveyTense

Some definitions linked in the documentation may repeat because the documentation is being redone. Some definitions in the documentation are out-of-date, but these are slowly being adjusted for every current versions. Don't get confused, and we apologize for this.

What will be included likely for every definition is detailed information about parameters. Some definitions will discover longer and somewhat fixed descriptions.

Note written on 12th March 2026

AveyTense is a versatile PyPi project that offers extensions and backported updates of inbuilt Python definitions, aiming for Python 3.8 and later! The project is coded completely with Python, with no C code ever included. The project also offers utility definitions, math functions and typing special forms for type hinting purposes. The source code of the project is visible on GitHub.

The project isn't a malware. If you have doubts, you can verify the source code of the recent release of the project. Project inquiries: aveyzan@gmail.com 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] $o[...] $k[or] $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]))

Or even more simplier:

$t[Tense].$tm[hasAttr](o, "attr1 attr2 ... attrN") # instead of "attr1 attr2 ... attrN".split(" ") These definitions are there to faciliate things! Not intended to be a malware in any way.

© 2024-Present Aveyzan // License: MIT

Relation to PEP 8

AveyTense doesn't completely follow styles given from PEP 8. Example in definition naming: In global scope: In local scope notations vary. Usually functions follow Python's function naming syntax, and variables can be singly underscored around.

Versioning

Every AveyTense version base on the syntax given in PEP 440. [N!]N(.N)*[{a|b|rc}N][.postN][.devN]

Current syntax in AveyTense versioning is 0.3.x (every time micro value incremented by one) and has perceivable lack of the epoch, .postN and .devN components. For quick updates, an alpha, beta or release candidate versions are uploaded. Their upload dates deviate from currently given next final releases upload schedule (final releases are sent on 12th and 24th day every month, the only exception is 2nd April).

It is believed that version of the form 0.3.1xx will create stable releases that can be factually used in production code. First version from this category, 0.3.100, is likely to show up on 24th June 2027.

To check the current version of AveyTense, check out the aveytense.Tense.version attribute. You can also use inbuilt Python solution, that is function importlib.metadata.version(), defined in Python 3.8, with "aveytense" as the argument value.

Supported Python versions

Currently, AveyTense supports Python 3.8 and later (since 0.3.46). For older AveyTense versions, gamut of supported Python versions was smaller (< 0.3.46 - 3.9+; < 0.3.24 - 3.10+).

The main reason why this project cannot support older versions of Python is PEP 570, affirmed in Python 3.8. This will require huge code alteration effort, since / in functions in AveyTense occur often. While rewriting the code, the __future__ library will need, aside from importing __future__.annotations (what shouldn't be imported since Python 3.9 or 3.10, however, no solution was formed, see PEP 649 and PEP 749), import also __future__.generator_stop, up to Python 3.7.

Moreover, typing_extensions version 4.10.0, minimal version for AveyTense, supports Python 3.8+. Older Python versions already lost support in typing_extensions (for 3.5 the last supported version was 3.10.0.2, for 3.6 - 4.1.1, for 3.7 - 4.7.1). For Python 3.8 the last version was 4.13.2, for Python 3.9+ it is the current version - 4.15.0 (while writing this on 16th May 2026).

The reason why AveyTense wants at least version 4.10.0 of typing_extensions is because the presence of the typing.TypeIs (Python 3.13+) special form.

To assure definitions to work for every supported version, the following Python releases are used:

3.8.10 3.9.13 3.10.11 3.11.9 3.12.10 3.13.13 3.14.5

Used micro releases of versions 3.8, 3.9, 3.10, 3.11 and 3.12 are final, meanwhile used micro releases of 3.13 and 3.14 will still change. Before 14th May 2026, 3.13.8 and 3.14.0 were used instead.

Versions of typing_extensions used in defintion inspections: Python 3.8 - 4.13.2, Python 3.9+ - 4.15.0

The project currently doesn't fully support Python 3.15, although all or the most of the definitions should work when that version is used. Once Python 3.15 first final release was sent in October 2026, the project's projected version 0.3.82 or 0.3.83 should support it completely.

Download

The current AveyTense version is 0.3.73 (24th May 2026).

The simpliest way to download AveyTense is using the following command:

$c[pip] $c[install] $m[aveytense]

Make sure you have installed Python 3.8 or later. Invoking this command also installs typing_extensions. Minimal supported version of typing_extensions is 4.10.0.

pip install command for AveyTense has been provided on 6th August 2024, day prior when version 0.3.26rc1 was sent to PyPi. Since 0.3.30 this method became standard for the project and today it is considered as the only way to install the project. All other releases before 0.3.26rc1 were able to be installed only as ZIP and 7Z archive files.

Before 0.3.30, there were 2 ways to install the library: with PyPi and with traditional ZIP/7Z installation. Changes in the code were provided in file ./tense/information/changes.txt in the meantime.

None of the versions published as ZIP or 7Z archives are ever able to be accessed. On PyPi releases are yanked, although discouraged to get them. It is preferred to install the newest version, and upgrade if being out of date.If you happen to be out of date, use the command below:

$c[pip] $c[install] --upgrade $m[aveytense]

If you have AveyTense 0.3.54 or above, you can also use command aveytense-upgrade in the following way:

$c[aveytense-upgrade]

All available AveyTense versions on PyPi and projected versions:

Version Upload Date Yanked Date
0.3.81 24th Sep 2026 * -
0.3.80 12th Sep 2026 * -
0.3.79 24th Aug 2026 * -
0.3.78 12th Aug 2026 * -
0.3.77 24th Jul 2026 * -
0.3.76 12th Jul 2026 * -
0.3.75 24th Jun 2026 * -
0.3.74 12th Jun 2026 * -
0.3.73 24th May 2026 -
0.3.72 12th May 2026 -
0.3.71 24th Apr 2026 -
0.3.70 12th Apr 2026 -
0.3.69 2nd Apr 2026 -
0.3.68 24th Mar 2026 -
0.3.67 12th Mar 2026 -
0.3.66 24th Feb 2026 -
0.3.65 12th Feb 2026 -
0.3.64 24th Jan 2026 -
0.3.63 12th Jan 2026 -
0.3.62 24th Dec 2025 -
0.3.61 12th Dec 2025 -
0.3.60 30th Nov 2025 -
0.3.59 12th Nov 2025 -
0.3.58 30th Oct 2025 -
0.3.57 18th Oct 2025 -
0.3.56 6th Oct 2025 -
0.3.55 24th Sep 2025 -
0.3.55b1 21st Sep 2025 -
0.3.55a2 18th Sep 2025 -
0.3.55a1 15th Sep 2025 -
0.3.54 12th Sep 2025 -
0.3.53 30th Aug 2025 -
0.3.52 18th Aug 2025 -
0.3.51 3rd Aug 2025 -
0.3.50 12th Jul 2025 -
0.3.49 3rd Jul 2025 -
0.3.48 24th Jun 2025 -
0.3.47 12th Jun 2025 -
0.3.46 30th May 2025 -
0.3.45 16th May 2025 -
0.3.44 3rd May 2025 -
0.3.43 18th Apr 2025 -
0.3.42 2nd Apr 2025 -
0.3.41 14th Mar 2025 -
0.3.40 27th Feb 2025 -
0.3.39 14th Feb 2025 -
0.3.38 11th Feb 2025 -
0.3.37 9th Feb 2025 -
0.3.37a1 3rd Feb 2025 -
0.3.36 2nd Feb 2025 -
0.3.35 23rd Jan 2025 -
0.3.34 15th Jan 2025 -
0.3.33 25th Dec 2024 -
0.3.32 16th Dec 2024 -
0.3.31 8th Dec 2024 -
0.3.30 29th Nov 2024 -
0.3.29 27th Nov 2024 2nd Apr 2026
0.3.28 23rd Nov 2024 2nd Apr 2026
0.3.27 22nd Nov 2024 2nd Apr 2026
0.3.27rc2 27th Oct 2024 2nd Apr 2026
0.3.27rc1 20th Oct 2024 2nd Apr 2026
0.3.27b3 13th Oct 2024 2nd Apr 2026
0.3.27b2 26th Sep 2024 2nd Apr 2026
0.3.27b1 23rd Sep 2024 2nd Apr 2026
0.3.27a5 13th Sep 2024 2nd Apr 2026
0.3.27a4 9th Sep 2024 2nd Apr 2026
0.3.27a3 3rd Sep 2024 2nd Apr 2026
0.3.27a2 29th Aug 2024 2nd Apr 2026
0.3.27a1 27th Aug 2024 2nd Apr 2026
0.3.26 26th Aug 2024 2nd Apr 2026
0.3.26rc3 21st Aug 2024 2nd Apr 2026
0.3.26rc2 16th Aug 2024 2nd Apr 2026
0.3.26rc1 7th Aug 2024 2nd Apr 2026

* indicate projected dates for upload or yanking; these may vary

Issues send either to my email or sending an issue to the repository. For code updates visit this Google document.

Python exclusive

Version Upload Date End-of-Life (PyPi: Yanked Date)
0.3.29 archive: 27th Nov 2024
pypi: 27th Nov 2024
2nd April 2026
0.3.28 archive: 23rd Nov 2024
pypi: 23rd Nov 2024
2nd April 2026
0.3.27 archive: 11th Nov 2024
pypi: 22nd Nov 2024
2nd April 2026
0.3.27rc2 archive: 27th Oct 2024
pypi: 27th Oct 2024
2nd April 2026
0.3.27rc1 archive: 19th Oct 2024
pypi: 20th Oct 2024
2nd April 2026
0.3.27b3 archive: 13th Oct 2024
pypi: 13th Oct 2024
2nd April 2026
0.3.27b2 archive: 26th Sep 2024
pypi: 26th Sep 2024
2nd April 2026
0.3.27b1 archive: 23rd Sep 2024
pypi: 23rd Sep 2024
archive: 1st Jan 2026
pypi: 2nd April 2026
0.3.27a5 archive: 13th Sep 2024
pypi: 13th Sep 2024
archive: 1st Jan 2026
pypi: 2nd April 2026
0.3.27a4 archive: 9th Sep 2024
pypi: 9th Sep 2024
archive: 1st Jan 2026
pypi: 2nd April 2026
0.3.27a3 archive: 2nd Sep 2024
pypi: 3rd Sep 2024
archive: 1st Jan 2026
pypi: 2nd April 2026
0.3.27a2 archive: 28th Aug 2024
pypi: 29th Aug 2024
archive: 1st Jan 2026
pypi: 2nd April 2026
0.3.27a1 archive: 27th Aug 2024
pypi: 27th Aug 2024
archive: 1st Jan 2026
pypi: 2nd April 2026
0.3.26 archive: 24th Aug 2024
pypi: 26th Aug 2024
archive: 1st Jan 2026
pypi: 2nd April 2026
0.3.26rc3 archive: 21st Aug 2024
pypi: 21st Aug 2024
archive: 1st Jan 2026
pypi: 2nd April 2026

With other programming languages

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

AveyTense Definitions

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

Tutorial

Now time to familarize you with some definitions. If you would like to read more about them, check the table of content written below.

Let's begin the adventure by importing module aveytense. For tutorial purposes we will use solid aveytense import in the following form:

$k[import] $m[aveytense]

Before 0.3.40, the main module of AveyTense was called tense. For backward-compatibility, in the Python file you can use the method below:

$k[import] $m[tense] $k[as] $m[aveytense]

Now let's start using some definitions! This tutorial is written for users having AveyTense 0.3.52 or above.

aveytense.Tense

Most of the definitions are stored in class aveytense.Tense. These are defined in this class to prevent conflicts with module imports with definitions of the same name. For example: random.shuffle() and aveytense.Tense.shuffle().

In the code below, we are converting a list into a generator:

$v[gen] $o[=] $m[aveytense].$t[Tense].$tm[generator]([$n[72], $n[66], $n[12]])

aveytense.extensions

The submodule aveytense.extensions features types from builtins, collections, collections.abc, contextlib, itertools and typing that can be used in all Python versions supported by AveyTense. This list included generic types and backported generic/non-generic types. This part of the tutorial is mainly addressed to programmers, who know how to use type hinting as specified in PEP 484.

aveytense.extensions submodule import is flexible as os.path, meaning there is no need to import aveytense.extensions to access this module itself.

$k[import] $m[aveytense] # instead of 'import aveytense.extensions' $v[backportedBatched] $o[=] $m[aveytense].$msu[extensions].$c[batched]

Generic type examples:

$tv[_T] $o[=] $m[aveytense].$msu[extensions].$c[TypeVar]($s[_T]) $k[def] $f[tolist]($p[iterable]: $m[aveytense].$msu[extensions].$c[AVT_Iterable][$tv[_T]]):   $k[return] $c[list]($p[iterable]) $k[class] $c[IntegerGeneratorSubclass]($m[aveytense].$msu[extensions].$c[AVT_Generator][$c[int]]): $o[...]

The benefit of using types with the AVT prefix is that you don't need to re-import these from different Python libraries, as well as from PyPi project typing_extensions, when it comes to use different Python versions (between 3.8 and current). For example: to subscript list in Python 3.8, you needed typing.List, since Python 3.9 list is subscriptable. To adjust to this change, generic type alias AVT_List does its job. That's much better than doing it yourself, like this:

$k[import] $m[sys] $k[if] $m[sys].$v[version_info] < ($n[3], $n[9]):   $k[from] $m[typing] $k[import] $c[List] $k[as] $c[l]$c[ist]

About statement with sys.version_info, we use it to determine if user has Python 3.8 or least.

Available definitions

This section is dedicated for available definitions, either standard or not. This section also features deprecated definitions before these will be moved to the Removed definitions section.

Navigation

aveytense module
aveytense.__all__
list[str]

≥ ?

Returns list of all global definitions that can be seen in module aveytense. This list is also returned from dir(aveytense).
aveytense.__author__
str

≥ ?

Returns the project's author name and e-mail inside angled brackets. The string value is constant:

Aveyzan <aveyzan@gmail.com>
aveytense.__version__
str

≥ ?

Returns currently used AveyTense version in a string. It is equivalent to the result of importlib.metadata.version("aveytense").

# assuming we use 0.3.72 $k[import] $m[aveytense] $f[print]($m[aveytense].$v[__version__]) # 0.3.72
class aveytense.AbroadType

≥ 0.3.52

A non-instantiable iterable class for aveytense.abroad() function for checking purposes, designed to be used with isinstance() function. This technique works the same as aveytense.Tense.isAbroad() class method. The class isn't subscriptable, and perhaps doesn't inherit from collections.abc.Iterable, it still has its own __iter__() method implementation.

Using this class as a role of the second parameter in isinstance() has untapped potential due to type hinting and not hinting every method from abroad objects. It is recommended to use aveytense.Tense.isAbroad() class method instead. This class may be dropped in the future.
type-alias aveytense.AveyTense
instance aveytense.aveytense
class aveytense.Tense

≥ 0.3.62 / ≥ 0.3.61 / ≥ 0.3.24

The aveytense.Tense class hoards immense amount of class methods that mostly aim to extend inbuilt Python solutions.

The class constructor takes no arguments. By non-standard, the class inherits from aveytense.Math and aveytense.Time. Meaning non-standard, it is possible the class can stop inheriting both classes any time, so their members will need to be used separatedly, that means for example: Tense.abs() will no longer be available, instead Math.abs() will have to be used.

All methods are actually class methods, what means all of these can be accessed using both class instance and class reference.

If you want to import class methods from aveytense.Tense directly, consider importing module aveytense.functions.

All other definitions are defined in the following way:

$t[AveyTense] = $c[Tense] aveytense = $c[Tense]()

0.3.24: aveytense.Tense

0.3.26b3: The class can now be inherited.
aveytense.Tense.__all__
list[str]

≥ 0.3.26rc2

Returns all members of the class aveytense.Tense. Result is the same for both class reference and class instance.

aveytense.Tense.abroadConvect(*values)
→ <abroad object>

≥ 0.3.25

Returns an abroad object depending on arguments passed.
Every value can be an integer, float, complex and sizeable objects. The 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] $f[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, modifier, *, each: ((int) -> T) | None = None)
list[T] | list[int]
aveytense.Tense.abroadEach(value1, /, value2, modifier, *, each = None)
list

≥ 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:

$k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[print]($t[Tense].Each($n[1], $n[7], each$k[lambda] $p[x]: $p[x]x))
# [1, 4, 9, 16, 25, 36]

$t[Tense].$tm[print]($t[Tense].Each($n[100], $n[0], each$k[lambda] $p[x]: $p[x](1/2)))
# [10, sqrt(99), sqrt(98), ..., sqrt(3), sqrt(2), 1]

$t[Tense].$tm[print]($t[Tense].Each($n[6], $n[13], each$k[lambda] $p[x]: $p[x](1/x)))
# [1.0, 1.0, 1.0, 1.0, 1.0, 1.0]

Before 0.3.34, this class method was defined in the aveytense.NennaiAbroads class with the same name.

0.3.26a4: this method is no longer experimental.

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.

0.3.71
aveytense.Tense.abroadInside(value1, /, value2 = None, modifier = None, string = None)
list[str]

≥ 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.

Before 0.3.34, this class method was defined in the aveytense.NennaiAbroads class with the same name.
aveytense.Tense.abroadNegativeFlip(value1, /, value2 = None, modifier = None)
→ <abroad object>

≥ 0.3.24

Variation of abroad() function that 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)
→ <abroad object>

≥ 0.3.24

Variation of abroad() function that 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.abroadPack(*values)
→ <abroad object>

≥ 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)
→ <abroad object>

≥ 0.3.24

Variation of abroad() function that 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)
→ <abroad object>

≥ 0.3.24

Variation of abroad() function that 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)
list[str]

≥ 0.3.25

Variation of abroad() function that 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)
list[int]

≥ 0.3.25

Before 0.3.34, this class method was defined in the aveytense.NennaiAbroads class with the same name.

0.3.71
aveytense.Tense.abroadSufcede(value1, /, value2 = None, modifier = None, suffix = None)
list[str]

≥ 0.3.25

Variation of abroad() function that 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.all(i, /, condition = ...)
bool

≥ 0.3.26rc2

Roughly the same as 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 aveytense.Tense.any() class method.

$k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[print]($t[Tense].$tm[all]([$n[3], $n[9], $n[6], $n[12]], $k[lambda] $p[x]: $p[x] % $n[3] == $n[0])) # True $t[Tense].$tm[print]($t[Tense].$tm[all]([$n[3], $n[9], $n[6], $n[12]], $k[lambda] $p[x]: $p[x] % $n[2] == $n[0])) # 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 = ...)
bool

≥ 0.3.26rc2

Roughly the same as 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 aveytense.Tense.all() class method.

$k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[print]($t[Tense].$tm[any]([$n[3], $n[9], $n[6], $n[12]], $k[lambda] $p[x]: $p[x] % $n[2] == $n[0])) # True $t[Tense].$tm[print]($t[Tense].$tm[any]([$n[3], $n[9], $n[6], $n[12]], $k[lambda] $p[x]: $p[x] % $n[7] == $n[0])) # 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)
list | dict | Generator | AsyncGenerator

≥ 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 aveytense.Tense.extend() class method.

Returned sequence is dependent to the parameter i. If i is any iterable object aside from generator object, asynchronous generator object or mapping object, a new list is returned. If i is a mapping object, a new dictionary is returned (ensure all items from parameter items are 2-item tuples to make it work). If i is a generator object, a new generator is returned - new items are added to the end of the input generator. The last sentence also applies to asynchronous generator objects. For any kind of generators, no error is probable to be thrown, unlike in aveytense.Tense.extend().

0.3.34: Added support for any iterable objects.

0.3.39 0.3.46: Added support for mapping objects. In order as 2-item tuples appear in parameter items, these and the mapping object 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

0.3.55a1: Added support for asynchronous generator objects, and if first argument was a generator, then a generator is returned (earlier, generators returned a list).
aveytense.Tense.architecture(executable = sys.executable, bits = "", linkage = "")
str

≥ 0.3.26rc2

Equivalent to platform.architecture().

This class method does not feature the linkage, bits only, that's why string is returned instead of 2-item string tuple.
aveytense.Tense.asyncGenerator(i: Iterable[T], /, condition: ((T) -> bool) = ...)
AsyncGenerator[T, Any]
aveytense.Tense.asyncGenerator(i, /, condition = ...)
AsyncGenerator

≥ 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.bin(i: SequenceLike[int | Indexable], /)
list[str]
aveytense.Tense.bin(i, /)
list[str]

≥ 0.3.71

Returns a list of strings, with results of the bin() function invocations taken on all items from the sequence-like object. Roughly equivalent to [bin(x) for x in i].

  • i (Required positional-only) - A sequence-like object with integers or with objects that have the __index__() method defined.

Exceptions

  • TypeError - When the parameter isn't a sequence-like object.
  • ValueError - When at least one of the items isn't an integer and doesn't have the __index__() method defined, or when the sequence-like object is empty.
aveytense.Tense.cast(v: Any, t: type[T], /)
→ T
aveytense.Tense.cast(v, t, /)
Any

≥ 0.3.36

Equivalent to typing.cast(), with parameters being in inverted places. Returned value has designated type from parameter t, however, keeps its actual type and value.

  • v (Required positional-only) - Any value that will be returned with a given type via parameter t. t (Required positional-only) - Any type.

No exceptions raised
aveytense.Tense.chr(o: SequenceLike[int | Indexable], /)
str
aveytense.Tense.chr(o, /)
str

≥ 0.3.71

Returns a string that consists of the results of the chr() function invocations taken on all items (ordinals) from the sequence-like object. Roughly equivalent to "".join([chr(x) for x in o]).

  • o (Required positional-only) - A sequence-like object with integers or with objects that have the __index__() method defined (ordinals).

Exceptions

  • TypeError - When the parameter isn't a sequence-like object.
  • ValueError - When at least one of the items isn't an integer and doesn't have the __index__() method defined, or when the sequence-like object is empty. Also thrown whether either of values does not comply with range ⟨0; sys.maxunicode
aveytense.Tense.clear(*v)
None

≥ 0.3.27a4

Allows to clear an arbitrary amount of values. Returns nothing (None)

  • v (Optional positional-only) - An arbitrary amount of strings, mutable mapping-like, mutable sequence-like, mutable set-like objects, and instances of aveytense.Color, aveytense.util.MutableString and types.FrameType. This list also includes file objects returned from the open() function, and instances of classes that implement the clear() method.

Exceptions

  • TypeError - When one of the values isn't an object of a supported class/type.

See changes for type support. Originally, this class method operated on mutable sequences.

0.3.27b1: Added primal support for strings, until 0.3.40 these actually weren't cleared.

0.3.36: Added support for mutable sets

0.3.37: Added support for mutable mappings and instances of aveytense.Color

0.3.40: Added support for instances of types.FrameType

0.3.42: Added support for aveytense.MutableString and instances of classes implementing the clear() method with no arguments

0.3.50: Added support for file objects (see the open() function)
aveytense.Tense.constants

≥ 0.3.39

Equivalent to module aveytense.constants.
aveytense.Tense.copy(x)

≥ 0.3.34

Equivalent to copy.copy().

There were thoughts for this method to return a new aveytense.Tense class instance, but this idea was wiped out eventually. In the future this class method might be marked deprecated and removed in favor of copy.copy().
aveytense.Tense.deepcopy(x, memo = None, _nil = [])

≥ 0.3.34

Equivalent to copy.deepcopy().

In the future this class method might be marked deprecated and removed in favor of copy.deepcopy().
aveytense.Tense.difference(v1, v2, /, invert = False, value_check = True)

≥ 0.3.32

(Description to be written soon.)
aveytense.Tense.disassemble(x = None, /, file = None, depth = None, showCaches = False, adaptive = False, showOffsets = False)

≥ 0.3.34

Equivalent to dis.dis().

In the future this class method might be marked deprecated and removed in favor of dis.dis().
aveytense.Tense.endsWith(target, suffix, /, start = ..., end = ...)
bool

≥ 0.3.42

Mix of methods str.endswith(), bytes.endswith() and bytearray.endswith().
aveytense.Tense.equal(*v)
bool

≥ 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.exceptions

≥ 0.3.44

Equivalent to module aveytense.exceptions.
aveytense.Tense.exclude(i, /, *items)
list | dict

≥ 0.3.34

Inversion of aveytense.Tense.append(); this pure class method returns a new list without items specified in items. First parameter can be any iterable object. The type of every element is ignored - code just hints type from the iterable object's type. $k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[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. $t[Tense].$tm[exclude]({ $n[12]: $n[78], $n[15]: $n[23], $n[12]: $n[23] }, 12, $p[filter] = "keys") # {15: 23} $t[Tense].$tm[exclude]({ $n[12]: $n[78], $n[15]: $n[23], $n[12]: $n[23] }, 23, $p[filter] = "values") # {12: 78}
aveytense.Tense.expect(i, m = ">= 1", /, condition = ...) aveytense.Tense.expect(i: Iterable[T], m: str | AbroadInitializer | SequenceLike[int] = ">= 1", /, condition: ((T) -> bool) = ...) bool

≥ 0.3.40

A class method working similarly as aveytense.Tense.any() and aveytense.Tense.all(), however, it is possible to enforce amount of items to satisfy condition in order to return True.

  • i (Required positional-only) - Any iterable object that will have its content checked.
  • m (Optional positional-only) - Either a special string literal or an integer sequence-like object. The default value is ">= 1".
  • condition (Optional) - An one-parameter filtering function. The default value is ellipsis.

If m is a string, 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 a shorthand keyword allowing to get the iterable object size. This string determines about how many item matches need to be done to return True. Below table with example values for m (~ = aveytense.Tense):
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
Examples:

$k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[expect]([$n[76], $n[66], $n[56], $n[46]], ">= 3", $k[lambda] $p[x]: $c[Math].$f[isComposite]($p[x])) # True; 4 matches satisfy ≥ 3 $t[Tense].$tm[expect]([$n[76], $n[66], $n[56], $n[46]], "< 2", lambda x: $c[Math].$f[isComposite](x)) # False; 4 matches don't satisfy < 2 $t[Tense].$tm[expect]([$n[76], $n[66], $n[56], $n[46]], " > 3", $k[lambda] $p[x]: $c[Math].$f[isComposite]($p[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 $t[Tense].$tm[expect]([$n[76], $n[66], $n[56], $n[46]], "> 7", $k[lambda] $p[x]: $c[Math].$f[isComposite]($p[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: # < 0.3.45 $t[Tense].$tm[expect]([$n[76], $n[66], $n[56], $n[46]], "<= {}".$f[format]($c[int](2e+12)), $k[lambda] $p[x]: $c[Math].$f[isComposite]($p[x])) $t[Tense].$tm[expect]([$n[76], $n[66], $n[56], $n[46]], "<= " + $c[str]($c[int](2e+12)), $k[lambda] $p[x]: $c[Math].$f[isComposite]($p[x]))

# ≥ 0.3.45; < 0.3.66 $t[Tense].$tm[expect]([$n[76], $n[66], $n[56], $n[46]], {$c[int](2e+12)}, $k[lambda] $p[x]: $c[Math].$f[isComposite]($p[x])) $t[Tense].$tm[expect]([$n[76], $n[66], $n[56], $n[46]], {$n[2] * $n[10] ** $n[12]}, $k[lambda] $p[x]: $c[Math].$f[isComposite]($p[x]))

# ≥ 0.3.66 $t[Tense].$tm[expect]([$n[76], $n[66], $n[56], $n[46]], [$c[int](2e+12)], $k[lambda] $p[x]: $c[Math].$f[isComposite]($p[x])) $t[Tense].$tm[expect]([$n[76], $n[66], $n[56], $n[46]], [$n[2] * $n[10] ** $n[12]], $k[lambda] $p[x]: $c[Math].$f[isComposite]($p[x])) # see update notes below within the aveytense.Tense.expect() documentation
The len keyword allows to create aveytense.Tense.all() method using the following signature:

$t[Tense].$tm[expect]($p[i], "== len", $p[condition]) # same as aveytense.Tense.all()

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

$t[Tense].$tm[expect]($p[i], ">= 1", $p[condition]) # same as aveytense.Tense.any()

If m is a string, it is worth to notice that the case for the len keyword is sensitive, what means 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. The support was predicted for version 0.3.48.

0.3.66: Replaced support for integer set and range objects with more excessive support. Parameter m may now be any integer iterable object, except for mapping objects.

0.3.73: Integer iterable objects support has been replaced to integer sequence-like objects support in parameter m.
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.34

0.3.51: renamed parameter no_empty to noEmpty.
aveytense.Tense.extend(i, /, *iters)
list | dict | Generator | AsyncGenerator

≥ 0.3.27a4

A pure and paired class method with aveytense.Tense.append() class method that merges arbitrary amount of iterable objects into a new list, dictionary, generator or asynchronous generator object.

  • i (Required positional-only) - Any iterable object.
  • iters (Optional) - An arbitrary amount of iterable objects.

Exceptions

  • TypeError - Either of the values in both parameters do not follow any of the following patterns:

i value iters values Return value
mapping object mapping objects dict
generator object universal iterable objects Generator
asynchronous generator object universal iterable objects AsyncGenerator
iterable object universal iterable objects list

All these patterns in the code are interpreted and type hinted in order as these patterns are shown in this table.

The first and the last pattern from the table can throw OverflowError if entire length of the resulted list or dictionary object is greater than sys.maxsize. Since this exception is universally thrown by Python, not by the internal code of this class method, OverflowError exception wasn't documented here. Example with iterable object not being a mapping object:

$k[from] $m[aveytense] $k[import] $t[Tense] $f[print]($t[Tense].$tm[extend]([$s[e]], {$s[f], $s[g]}, ($s[h],))) # ['e', 'f', 'g', 'h']

Example on mapping object:

$f[print]($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}

Relation with aveytense.Tense.append():

$k[assert] $t[Tense].$tm[extend]([$s[e]], {$s[f], $s[g]}, ($s[h],)) == $t[Tense].$tm[append]([$s[e]], $s[f], $s[g], $s[h]) $k[assert] $t[Tense].$tm[extend]({$n[1]: $n[87]}, {$n[2]: $n[70], $n[3]: $n[112]}, {$n[1]: $n[96]}) == $t[Tense].$tm[append]({$n[1]: $n[87]}, ($n[2], $n[70]), ($n[3], $n[112]), ($n[1], $n[96]))

0.3.27a4

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

0.3.39 0.3.46: added support for mapping objects. 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 (see example of it happening with the pair with 1 as the key value).

0.3.55a2: Added support for asynchronous generator objects, and if first argument was a generator, then a generator is returned (earlier, generators returned a list).

0.3.74: Redesigned the most lines of the code to restrict conversion to the list object. The OverflowError exception is likely to be patched for generator objects and asynchronous generator objects.
aveytense.Tense.extensions

≥ 0.3.42

Equivalent to module aveytense.extensions.
aveytense.Tense.extract(i, /, condition = ...)
list | dict

≥ 0.3.52

Similar to how aveytense.Tense.expect() works, just returns a new list or dict object. That object consists of items that satisfy given condition (callable 1-2 parameter object returning a boolean value). If condition is not given, a new list or dict object is returned with the same items.

A dict object is returned when the first parameter is a mapping object, and a list object is returned for any other iterable objects. For mapping objects it is possible to use a callable object with 1-2 parameters in parameter condition (the first parameter is key, and value is the second), while for any other iterable objects callable object with only one parameter is required.

Example (extract integers divisible by 3):

$k[from] $m[aveytense] $k[import] $t[Tense] $f[print]($t[Tense].$tm[extract]([$n[62], $n[72], $n[82], $n[92]], $k[lambda] $p[x]: $p[x] % $n[3] == $n[0])) # [72]

Relation with aveytense.Tense.expect():

$v[a] = $f[len]($t[Tense].$tm[extract]([$n[62], $n[72], $n[82], $n[92]], $k[lambda] $p[x]: $p[x] % $n[3] == $n[0])) >= $n[1] $v[b] = $t[Tense].$tm[expect]([$n[62], $n[72], $n[82], $n[92]], ">= 1", $k[lambda] $p[x]: $p[x] % $n[3] == $n[0]) $k[assert] $v[a] == $v[b]

Class method aveytense.Tense.extract() is pure.
aveytense.Tense.first(seq, /, condition = None, default = None)
dict

≥ 0.3.26rc2

2 overloads

Returns first item from a set-like or list-like object, which satisfies condition or default, if none satisfied condition or if condition equals None. This class method is paired with aveytense.Tense.last() class method.

0.3.26rc2

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.49 0.3.50: generator is returned instead of a list (list 0.3.49 exclusive).
aveytense.Tense.generator(i: Iterable[T] | AsyncIterable[T], /, condition: ((T) -> bool) = ...) -> Generator[T, Any, None] aveytense.Tense.generator(i, /, condition = ...)

≥ 0.3.50

A pure class method returning a generator object using any iterable object.

  • o (Required positional-only) - An iterable object. This iterable object can be asynchronous
  • condition (Optional) - A special one-parameter function that filters values in an iterable object. The default value is None

$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>

0.3.50

0.3.53: generator expression is no longer used to return the generator object.

0.3.55: asynchronous iterable objects are now supported.
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]] + [$s[64]]) # (<class 'int'>, <class 'str'>) # NOT (<class 'int'>, <class 'int'>, <class 'str'>)

0.3.51

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.getAttr(o: object, names: str | SequenceLike[str], default: T = None, /)
Any | T
aveytense.Tense.getAttr(o, names, default = None, /)
Any

≥ 0.3.58

More developed version of inbuilt function getattr().

  • o (Required positional-only) - An object that will have its attribute(s) checked.
  • names (Required positional-only) - A sequence-like object containing strings, or a string.
  • default (Optional positional-only) - Any value that will be returned in case none of the attributes given exist in the given object.
Roughly equivalent to:

$k[def] $f[getAttr]($p[o], $p[names], $p[default] = None):   $k[if] $f[isinstance]($p[names], $c[str]):     $v[seq] $o[=] $p[names].$f[strip]().$f[split](" ")   $k[else]:     $v[seq] $o[=] $c[list]($p[names])   $v[seq] $o[=] $c[list]($c[filter]($k[lambda] $p[x]: $f[len]($p[x]) > $n[0], $v[seq]))   $k[for] $v[attr] $k[in] $v[names]:     $k[if] $f[hasattr]($p[o], $v[attr]):       $k[return] getattr($p[o], $v[attr])   $k[return] $p[default]

Returned value does not inform the user which attribute value was returned (in case one of the attributes was found).

The leftmost of all given attributes is inspected first, then the code goes up to the rightmost one or until one of the attributes is defined in the object. If no attribute was found in the object, then instead of throwing AttributeError (normally thrown by getattr()), value from the default parameter is returned.

For example, all 3 mapping views have property mapping since Python 3.10, so what we can do is this:

$k[from] $m[aveytense] $k[import] $c[Tense] $v[d] = {$n[6]: "a"} $f[print]($c[Tense].$tm[getAttr]($v[d].$f[items](), "mapping")) # Python 3.10+: {6: "a"} # Python <3.10: None

So far we provided only one attribute name, but we can go with more names:

$f[print]($c[Tense].$tm[getAttr]($v[d].$f[items](), ["mapping", "__reversed__"])) # Python 3.10+: {6: "a"} # Python <3.10: <built-in method __reversed__ of dict_items object at ...>

If you don't want to use str.split(), then you can also go with the following:

$f[print]($c[Tense].$tm[getAttr]($v[d].$f[items](), "mapping __reversed__"))

This gives the same result as in the previous scrap of code, what means both are equally correct:

$k[assert] $c[Tense].$tm[getAttr]($v[d].$f[items](), ["mapping", "__reversed__"]) == $c[Tense].$tm[getAttr]($v[d].$f[items](), "mapping __reversed__") # no AssertionError

For backward-compatibility, it is recommended to use str.split().

0.3.59: added support for multiple names in a string separated by spaces in parameter names, empty strings are also excluded.

0.3.67

0.3.73: Any sequence-like object is now supported. Previously, objects of classes inheriting from Sequence or AbstractSet were supported.
aveytense.Tense.getFlags(v, /)
int

≥ 0.3.53

Returns flags of an object or -1 if it is not possible. It all depends on the passed object.

  • For types, their __flags__ property value is returned (see aveytense.util.TypeFlags).
  • For coroutine objects, their cr_code property is used, then co_flags is returned.
  • For traceback objects, their tb_frame property is used, then frame object's f_code property is used and then co_flags is returned.
  • For frame objects, pattern is the same as for the traceback objects, except beginning is from f_code property, not tb_frame.
  • For callable objects, their __code__ read-only attribute is used, then co_flags is returned.

Instances of the memoryview inbuilt class are also supported, but this feature is still experimental. Expect behavior to change sooner or later.
aveytense.Tense.getGeneric(v, /, tupleEllipsis = False) aveytense.Tense.getGeneric(v: typing.Any, /, tupleEllipsis: bool = False) 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[extensions] $k[import] $o[*] $k[assert] $t[Tense].$tm[getGeneric]([$n[72]]) $o[==] $c[AVT_List][$c[int]] $k[assert] $t[Tense].$tm[getGeneric]({$n[72]}) $o[==] $c[AVT_Set][$c[int]] $k[assert] $t[Tense].$tm[getGeneric]([$n[72], $s[78]]) $o[==] $c[AVT_List][$c[Union][$c[int], $c[str]]] $k[assert] $t[Tense].$tm[getGeneric]({$n[72]: $s[78]}) $o[==] $c[AVT_Dict][$c[int], $c[str]]

About types starting with prefix AVT visit this page. These are shown in the example to accord every Python version (since 3.8). For example: list[int] will be invalid in Python versions before 3.9.

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[AVT_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[AVT_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[AVT_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[AVT_Callable][[$c[AVT_Iterable][$tv[_T]], $c[Union][$c[str], $c[AbroadType], $c[AVT_Iterable][$c[int]]], $c[AVT_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[AVT_Iterable][$tv[_T]], $c[Union][$c[str], $c[AbroadType], $c[AVT_Iterable][$c[int]]], $c[AVT_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.52

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.extensions:

  • aveytense.extensions.DictItems
  • aveytense.extensions.DictKeys
  • aveytense.extensions.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[AVT_Iterator][$c[list][$c[Any]]] $k[assert] $t[Tense].$tm[getGeneric]($f[iter]([$n[72]])) $o[==] $c[AVT_Iterator][$c[list][$c[int]]] $k[assert] $t[Tense].$tm[getGeneric]($f[iter]($c[bytes]())) $o[==] $c[AVT_Iterator][$c[bytes]] ### tuples $k[assert] $t[Tense].$tm[getGeneric](($n[72], $n[720])) $o[==] $c[AVT_Tuple][$c[int], $c[int]] $k[assert] $t[Tense].$tm[getGeneric](($n[72], $n[720]), $p[tupleEllipsis] $o[=] $con[True]) $o[==] $c[AVT_Tuple][$c[int], $o[...]] $k[assert] $t[Tense].$tm[getGeneric](($n[72], $s[720])) $o[==] $c[AVT_Tuple][$c[int], $c[str]] $k[assert] $t[Tense].$tm[getGeneric](($n[72], $s[720]), $p[tupleEllipsis] $o[=] $con[True]) $o[==] $c[AVT_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[AVT_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[AVT_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]]

0.3.54: Instances of array.array and memoryview are now supported.

# footnote: 'array.array' can be imported from 'aveytense.extensions' too $k[assert] $t[Tense].$tm[getGeneric]($c[array]($s[i], [$n[72], $n[96]])) $o[==] $c[AVT_Array][$c[int]] $k[assert] $t[Tense].$tm[getGeneric]($c[memoryview]($k[b]$s[63bac])) $o[==] $c[AVT_MemoryView][$c[int]]

If aveytense.Tense.getGeneric() gets an instance of array.array, type parameter value for aveytense.extensions.AVT_Array will hinge on property array.array.typecode. There are 3 distinct results:

  • return AVT_Array[int] for array.array.typecode equal 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q' or 'Q'
  • return AVT_Array[float] for array.array.typecode equal 'f' or 'd'
  • return AVT_Array[str] for array.array.typecode equal 'u' or 'w'

If aveytense.Tense.getGeneric() gets an instance of memoryview, type parameter value for aveytense.extensions.AVT_MemoryView will hinge on property memoryview.format. There are 4 distinct results:

  • return AVT_MemoryView[int] for memoryview.format equal 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q', 'P', '@b', '@B', '@h', '@H', '@i', '@I', '@l', '@L', '@q', '@Q' or '@P'
  • return AVT_MemoryView[float] for memoryview.format equal 'f', 'd', '@f' or '@d'
  • return AVT_MemoryView[bytes] for memoryview.format equal 'c' or '@c'
  • return AVT_MemoryView[bool] for memoryview.format equal '?'

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 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.hasAttr(o, attr, /, mode = "or")
bool

≥ 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 the o parameter must be a tuple of objects to take place. However, class method permits check only one attribute at once.

0.3.61: Revoked update from 0.3.49. Removed the mode parameter and support for multiple objects, instead brought support for attributes specified in a string separated by spaces.
aveytense.Tense.hex(i: SequenceLike[int | Indexable], /)
list[str]
aveytense.Tense.hex(i, /)
list[str]

≥ 0.3.71

Returns a list of strings, with results of the hex() function invocations taken on all items from the sequence-like object. Roughly equivalent to [hex(x) for x in i].

  • i (Required positional-only) - A sequence-like object with integers or with objects that have the __index__() method defined.

Exceptions

  • TypeError - When the parameter isn't a sequence-like object.
  • ValueError - When at least one of the items isn't an integer and doesn't have the __index__() method defined, or when the sequence-like object is empty.
aveytense.Tense.improvedBogoSort(i, /, key = ...)
tuple[int, list[Any]]

≥ 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.

This class method is unofficial and may be marked deprecated and removed in the future.
aveytense.Tense.inequal(*v)
bool

≥ 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.intersection(...)
Any

≥ 0.3.34

(Description to be written soon.)
aveytense.Tense.invert(...)
Any

≥ 0.3.46

(Description to be written soon.)
aveytense.Tense.isAbroad(v, /, *_, mode = "and")
bool

≥ 0.3.50

Returns True if given value(s) are abroad objects. Can be also used with isinstance() function as all([isinstance(x, aveytense.AbroadType) for x in ((v,) + _)]) or any([isinstance(x, aveytense.AbroadType) for x in ((v,) + _)]) (see aveytense.AbroadType).
aveytense.Tense.isArray(v, /, type = int)
bool

≥ 0.3.37

Returns True if given value is an instance of array.array.

  • v (Required positional-only) - The target object.
  • type (Optional; Since 0.3.60) - Allows to enable additional type checking. Due to restriction of types in class array.array, the only allowed types are: int, float, str. The default value is int. An union type cannot be passed.

To use the signature with the type parameter prior to Python 3.12, consider using the following code:

$k[from] $m[aveytense] $k[import] $t[Tense] $k[import] $m[aveytense].$msu[extensions] $t[Tense].$tm[getGeneric](v) == $m[aveytense].$msu[extensions].$c[AVT_Array][$c[int]] $t[Tense].$tm[getGeneric](v) == $m[aveytense].$msu[extensions].$c[AVT_Array][$c[float]] $t[Tense].$tm[getGeneric](v) == $m[aveytense].$msu[extensions].$c[AVT_Array][$c[str]]

The example code shown there works since AveyTense 0.3.54, see aveytense.extensions.AVT_Array and aveytense.Tense.getGeneric() for more information (update for 0.3.54).

0.3.69: The signature prior to Python 3.12 (isArray(v, /, *_, mode = "and")) is no longer maintained, as the signature since Python 3.12 (isArray(v, /, type = int)) received support for Python 3.8+.

Change from 0.3.69 will cause type hinting to act differently in Python versions prior to 3.12 when array.array is used. The correct type hinting should work when aveytense.extensions.AVT_Array is used. Use bool() constructor if it fails.
aveytense.Tense.isAsyncGenerator(v, /, *_)
bool

≥ 0.3.53

Returns True if given value(s) are asynchronous generator objects.
aveytense.Tense.isAwaitable(v, /, *_)
bool

≥ 0.3.52

Returns True if given value(s) are awaitable objects.
aveytense.Tense.isBinary(v, /, *_, mode = "and")
bool

≥ 0.3.38

(Description to be written soon.)
aveytense.Tense.isBool(v, /, *_)
aveytense.Tense.isBoolean(v, /, *_)
bool

≥ 0.3.26b3 / ≥ 0.3.26rc1

Returns True if given value(s) are bool objects.

0.3.36: Added support for multiple objects to be inspected at once. Previously, only one object was able to be checked per invocation.
aveytense.Tense.isByteArray(v, /, *_)
bool

≥ 0.3.35

Returns True if given value(s) are bytearray objects.

0.3.36: Added support for multiple objects to be inspected at once. Previously, only one object was able to be checked per invocation.
aveytense.Tense.isBytes(v, /, *_)
bool

≥ 0.3.35

Returns True if given value(s) are bytes objects.

0.3.36: Added support for multiple objects to be inspected at once. Previously, only one object was able to be checked per invocation.
aveytense.Tense.isClass(v, /, *_, mode = "and")
bool

≥ 0.3.35

(Description to be written soon.)
aveytense.Tense.isComplex(v, /, *_)
bool

≥ 0.3.26rc3

Returns True if given value(s) are complex objects.

0.3.36: Added support for multiple objects to be inspected at once. Previously, only one object was able to be checked per invocation.
aveytense.Tense.isCoroutine(v, /, *_)
bool

≥ 0.3.52

Returns True if given value(s) are coroutine objects.
aveytense.Tense.isDeprecated(v, /, *_, mode = "and")
bool

≥ 0.3.56

Returns True if given value(s) have the __deprecated__ attribute and it is a string for every value.
aveytense.Tense.isDeque(v, /, type = Any)
bool

≥ 0.3.37a1

(Description to be written soon.)
aveytense.Tense.isDict(v, /, ktype = Any, vtype = Any)
bool

≥ 0.3.31

Returns True if given value is a dict object.

  • v (Required positional-only) - The target object.
  • ktype (Optional; Since 0.3.34) - Allows to enable additional type checking taken on the every key. It can be either a type, a tuple of types (empty deduces Any; since 0.3.35) or since 0.3.36 an union type. Defaults to Any.
  • vtype (Optional; Since 0.3.34) - Allows to enable additional type checking taken on the every value. It can be either a type, a tuple of types (empty deduces Any; since 0.3.35) or since 0.3.36 an union type. Defaults to Any.
Example invocations:

$k[from] $m[aveytense] $k[import] $o[*] $k[from] $m[aveytense].$msu[extensions] $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 type checking on dictionary keys and values, respectively

0.3.35: ktype and vtype now support union types via wrapping the types in a tuple.

0.3.36: The type parameter 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.

Since 0.3.36 there were also experiments on generic aliases (including these in a tuple or union type), however, it remains unreliable. Consider using non-generic types on such inspections instead.

You can wrap the invocation with the bool() constructor if type hinting doesn't work as intended.
aveytense.Tense.isEllipsis(v, /, *_, mode = "and")
bool

≥ 0.3.26

Returns True if given values are Ellipsis (...) objects.

0.3.36: Added support for multiple objects to be inspected at once. Previously, only one object was able to be checked per invocation.
aveytense.Tense.isFinalClass(v, /, *_, mode = "and")
bool

≥ 0.3.41

(Description to be written soon.)
aveytense.Tense.isFinalProperty(v, /, *_, mode = "and")
bool

≥ 0.3.41

(Description to be written soon.)

0.3.71
aveytense.Tense.isFinalVar(v, /, *_, mode = "and")
bool

≥ 0.3.38

(Description to be written soon.)

0.3.69
aveytense.Tense.isFloat(v, /, *_, mode = "and")
bool

≥ 0.3.26b3

Returns True if given values are float objects.

0.3.36: Added support for multiple objects to be inspected at once. Previously, only one object was able to be checked per invocation.
aveytense.Tense.isFrozenSet(v, /, type = Any)
bool

≥ 0.3.35

Determine whether the passed object is a frozenset object.

  • v (Required positional-only) - The target object.
  • type (Optional) - Allows to enable additional type checking taken on all elements. It can be either a type, a tuple of types (empty deduces Any) or since 0.3.36 an union type. Defaults to Any. Since 0.3.69 the types can now be within any sequence-like object.

    Example values:
    • () and Any are the same as isFrozenSet(v), meaning all items can represent any type
    • int requires all items being integers
    • (int, str) and since 0.3.36 Union[int, str] tell the program that all items must be instances of either int or str

0.3.36: The type parameter 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.

0.3.69: Types in the type parameter can now be within any sequence-like object aside tuples.

Since 0.3.36 there were also experiments on generic aliases (including these in a tuple or union type), however, it remains unreliable. Consider using non-generic types on such inspections instead.

You can wrap the invocation with the bool() constructor if type hinting doesn't work as intended.
aveytense.Tense.isFunction(v, /, *_, mode = "and")
bool

≥ 0.3.35

Equivalent to inspect.isfunction(), except it supports an arbitrary amount of values.
aveytense.Tense.isGenExpr(v, /, *_, mode = "and")
bool

≥ 0.3.52

Returns True if given values are generator objects created from generator expression.
aveytense.Tense.isGenerator(v, /, *_, mode = "and")
bool

≥ 0.3.52

(Description to be written soon.)
aveytense.Tense.isGeneric(v, /, *_, mode = "and")
bool

≥ 0.3.53

Returns True if given values (types actually) are generic aliases.

Value True is returned whether given values are (at least condition from the following satisfied):
  • instances of typing._GenericAlias private class (Python 3.8 exclusive)
  • subclasses of typing.Generic
  • have the __class_getitem__() method (see types.GenericAlias)
aveytense.Tense.isHexadecimal(v, /, *_, mode = "and")
bool

≥ 0.3.38

(Description to be written soon.)
aveytense.Tense.isIn(seq, *values)
bool

≥ 0.3.62

Returns True if seq is a sequence-like object and at least one of the given values are in it. If values has no values, False is returned. Because on empty iterable objects any() returns False, this is the likely same as any([(x in values) for x in seq]).

  • seq (Required) - A target sequence-like object. For all other objects False is returned (no exception raised).
  • values (Optional) - An arbitrary amount of values that should (at least one) appear in the target object.

$k[from] $m[aveytense] $k[import] $t[Tense] $t[Tense].$tm[isIn](($n[1], $n[2], $n[3]), $n[2], $n[3]) # True $t[Tense].$tm[isIn](($n[1], $n[2], $n[3]), $n[2]) # True $t[Tense].$tm[isIn](($n[1], $n[2], $n[3]), $n[4]) # False
aveytense.Tense.isInt(v, /, *_)
aveytense.Tense.isInteger(v, /, *_)
bool

≥ 0.3.26b3 / ≥ 0.3.26rc1

Returns True if all values are int objects.

0.3.36: Added support for multiple objects to be inspected at once. Previously, only one object was able to be checked per invocation.
aveytense.Tense.isIterable(v, /, *_)
bool

≥ 0.3.52

Returns True if value or more values are iterable objects.
aveytense.Tense.isIterator(v, /, *_)
bool

≥ 0.3.52

Returns True if value or more values are iterator objects.
aveytense.Tense.isLambda(v, /, *_)
bool

≥ 0.3.52

Returns True if value or more values are anonymous functions (lambda expressions).
aveytense.Tense.isList(v, /, type = Any)
bool

≥ 0.3.26rc1

Returns True if the given value is a list object.

  • v (Required positional-only) - The target object.
  • type (Optional) - Allows to enable additional type checking taken on all elements. It can be either a type, a tuple of types (empty deduces Any) or since 0.3.36 an union type. Defaults to Any. Since 0.3.69 any sequence-like object featuring types is allowed.

    Example values:
    • () and Any are the same as isList(v), meaning all items can represent any type
    • int requires all items being integers
    • (int, str) and since 0.3.36 Union[int, str] tell the program that all items must be instances of either int or str

$k[from] $m[aveytense] $k[import] $o[*] $k[from] $m[aveytense].$msu[extensions] $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: The type parameter now supports multiple types placed in a tuple.

0.3.36: The type parameter 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.

Since 0.3.36 there were also experiments on generic aliases (including these in a tuple or union type), however, it remains unreliable. Consider using non-generic types on such inspections instead.

0.3.69: Types in the type parameter can now be within any sequence-like object aside tuples.

You can wrap the invocation with the bool() constructor if type hinting doesn't work as intended.
aveytense.Tense.isMemoryView(v, /, type = int)
bool

≥ 0.3.35

Returns True if given value is an instance of memoryview.

  • v (Required positional-only) - The target object.
  • type (Optional; Since 0.3.60) - Allows to enable additional type checking. Due to restriction of types in class memoryview, the only allowed types are: int, float, bool, bytes. The default value is int. An union type cannot be passed.

To use the signature with the type parameter prior to Python 3.14, consider using the following code:

$k[from] $m[aveytense] $k[import] $t[Tense] $k[import] $m[aveytense].$msu[extensions] $t[Tense].$tm[getGeneric](v) == $m[aveytense].$msu[extensions].$c[AVT_MemoryView][$c[int]] $t[Tense].$tm[getGeneric](v) == $m[aveytense].$msu[extensions].$c[AVT_MemoryView][$c[float]] $t[Tense].$tm[getGeneric](v) == $m[aveytense].$msu[extensions].$c[AVT_MemoryView][$c[bool]] $t[Tense].$tm[getGeneric](v) == $m[aveytense].$msu[extensions].$c[AVT_MemoryView][$c[bytes]]

0.3.69: The signature prior to Python 3.14 (isMemoryView(v, /, *_, mode = "and")) is no longer maintained, as the signature since Python 3.14 (isMemoryView(v, /, type = int)) received support for Python 3.8+.

The example code shown there works since AveyTense 0.3.54, see aveytense.extensions.AVT_MemoryView and aveytense.Tense.getGeneric() for more information (update for 0.3.54).

Change from 0.3.69 will cause type hinting to act differently in Python versions prior to 3.14 when memoryview is used. The correct type hinting should work when aveytense.extensions.AVT_MemoryView is used. Use bool() constructor if it fails.
aveytense.Tense.isNone(v, /, *_, mode = "and")
bool

≥ 0.3.26b3

(Description to be written soon.)
aveytense.Tense.isNumeric(v, /, *_, mode = "and")
bool

≥ 0.3.41

(Description to be written soon.)
aveytense.Tense.isOctal(v, /, *_, mode = "and")
bool

≥ 0.3.38

(Description to be written soon.)
aveytense.Tense.isProperty(v, /, *_, mode = "and")
bool

≥ 0.3.41

(Description to be written soon.)
aveytense.Tense.isSet(v, /, type = Any)
bool

≥ 0.3.35

Determine whether passed object is a set object.

  • v (Required positional-only) - The target object.
  • type (Optional) - Allows to enable additional type checking taken on all elements. It can be either a type, a tuple of types (empty deduces Any) or since 0.3.36 an union type. Defaults to Any. Since 0.3.69 any sequence-like object featuring types is allowed.

    Example values:
    • () and Any are the same as isSet(v), meaning all items can represent any type
    • int requires all items being integers
    • (int, str) and since 0.3.36 Union[int, str] tell the program that all items must be instances of either int or str
$k[from] $m[aveytense] $k[import] $o[*] $k[from] $m[aveytense].$msu[extensions] $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: The type parameter 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.

0.3.69: Types in the type parameter can now be within any sequence-like object aside tuples.

Since 0.3.36 there were also experiments on generic aliases (including these in a tuple or union type), however, it remains unreliable. Consider using non-generic types on such inspections instead.

You can wrap the invocation with the bool() constructor if type hinting doesn't work as intended.
aveytense.Tense.isSlice(v, /, startType = None, stopType = None, stepType = None)
bool

≥ 0.3.41

Determine whether passed object is a slice object.

0.3.69: The previous signature ((v, /, *_, mode = "and")) is no longer existent in favor of the current signature, with improved type checking of start, stop and step slice object properties.

It is advised to use aveytense.extensions.AVT_Slice over slice to have correct type hinting.
aveytense.Tense.isSpecialForm(v, /, *_, mode = "and")
bool

≥ 0.3.53

(Description to be written soon.)
aveytense.Tense.isStr(v, /, *_, mode = "and")
aveytense.Tense.isString(v, /, *_, mode = "and")
bool

≥ 0.3.26b3 / ≥ 0.3.26rc1

(Description to be written soon.)
aveytense.Tense.isTuple(v: Any, /, type: type = Any) aveytense.Tense.isTuple(v, /, type = Any)
bool

≥ 0.3.26rc1

Determine whether passed object is a tuple object.

  • v (Required positional-only) - The target object.
  • type (Optional) - Allows to enable additional type checking taken on all elements. It can be either a type, a tuple of types (empty deduces Any) or since 0.3.36 an union type. Defaults to Any. Since 0.3.69 any sequence-like object featuring types is allowed.

    Example values:
    • () and Any are the same as isTuple(v), meaning all items can represent any type
    • int requires all items being integers
    • (int, str) and since 0.3.36 Union[int, str] tell the program that all items must be instances of either int or str

$k[from] $m[aveytense] $k[import] $o[*] $k[from] $m[aveytense].$msu[extensions] $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 list type checking.

0.3.35: The type parameter now supports multiple types placed in a tuple.

0.3.36: The type parameter 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.

Since 0.3.36 there were also experiments on generic aliases (including these in a tuple or union type), however, it remains unreliable. Consider using non-generic types on such inspections instead.

0.3.69: Types in the type parameter can now be within any sequence-like object aside tuples.

You can wrap the invocation with the bool() constructor if type hinting doesn't work as intended.
aveytense.Tense.isTuple2(v1: tuple, v2: Sequence[type] | Set[type] | ValuesView[type], /) aveytense.Tense.isTuple2(v1, v2, /) bool

≥ 0.3.43

Extension of aveytense.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 aveytense.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 (since 0.3.69 v2 can be any sequence-like object); in case of v2 a tuple of types only. Value assignment in v2 parameter is similar to type parameter in aveytense.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

0.3.69: Types in the v2 parameter can now be within any sequence-like object aside tuples.

Since 0.3.36 there were also experiments on generic aliases (including these in a tuple or union type), however, it remains unreliable. Consider using non-generic types on such inspections instead.

Another thing to notice is change from 0.3.69. When sequence-like object not being a tuple is passed, type hinting will actually lose type order of the items (e.g.: hint tuple[int | str, ...] instead of tuple[int, str]) wrapping every type in an union. While it may be misleading, order of the types in parameter v2 is actually considered. When a tuple is passed, for correct type hinting every item must be a type or union type (not types inside another sequence-like object). Otherwise, for instance, tuple[list[int, str], ...] can be type hinted what isn't definitely intentional, and also not supported (we are talking about nested sequence-like object inspection from there!).

You can wrap the invocation with the bool() constructor if type hinting doesn't work as intended.
aveytense.Tense.isType(v, t, /)
bool

≥ 0.3.59

Returns True if given value equals a type or more types (put in a tuple or since 0.3.69 in a sequence-like object) in parameter t.

The isinstance() function is used on the t parameter only. This means the value's __instancecheck__() method implementation has no influence on the returned boolean value.

Upon inspection failure (exception has been raised), False is returned.

0.3.69: The t parameter now supports sequence-like objects holding types aside tuples; added support for union types.
aveytense.Tense.isUnbound(v, /, *_, mode = "and")
bool

≥ 0.3.44

(Description to be written soon.)

0.3.69
aveytense.Tense.isUnion(v, /, *_, mode = "and")
bool

≥ 0.3.62

(Description to be written soon.)
aveytense.Tense.last(seq, /, condition = None, default = None)
Any

≥ 0.3.26rc2

Returns the last item from a set-like or list-like object, which satisfies condition or default, if none satisfied condition or if condition equals None. This class method is paired with aveytense.Tense.first() class method.

0.3.26rc2

0.3.27a4: removed parameter default.

0.3.34: restored parameter default.

0.3.39
aveytense.Tense.license()
→ None

≥ 0.3.54

Prints the license information.
final-property aveytense.Tense.none
None

≥ 0.3.32

This final property is shell-specific as it allows to end and execute given code in the shell. Since 0.3.43 and before 0.3.45, this final property was actually an attribute.

It should be used only in case of instances of the aveytense.Tense class.
aveytense.Tense.occurrences(...)
int

≥ 0.3.32

(Description to be written soon.)
aveytense.Tense.oct(i: SequenceLike[int | Indexable], /)
list[str]
aveytense.Tense.oct(i, /)
list[str]

≥ 0.3.71

Returns a list of strings, with results of the oct() function invocations taken on all items from the sequence-like object. Roughly equivalent to [oct(x) for x in i].

  • i (Required positional-only) - A sequence-like object with integers or with objects that have the __index__() method defined.

Exceptions

  • TypeError - When the parameter isn't a sequence-like object.
  • ValueError - When at least one of the items isn't an integer and doesn't have the __index__() method defined, or when the sequence-like object is empty.
aveytense.Tense.operators

≥ 0.3.42

Equivalent to module aveytense.operators.
aveytense.Tense.ord(v: str | bytes | bytearray, /)
list[int]
aveytense.Tense.ord(v, /)
list[int]

≥ 0.3.71

Returns an integer list of ordinals for given sequence of characters. Roughly equivalent to [ord(x) for x in v] (see ord() function).

  • v (Required positional-only) - A string or instance of bytes or bytearray

Exceptions

aveytense.Tense.pick(i: Sequence[T] | AbstractSet[T] | Mapping[T, Any] | ValuesView[T], /)
→ T
aveytense.Tense.pick(i, /)
Any

≥ 0.3.8

Returns a random item from a sequence or mapping object. This class method is more developed version of random.choice().

Before 0.3.24, this class method was defined as tense08.Tense08.pick() (see aveytense.Tense08), and primarily operated on list and tuple objects.

0.3.9

0.3.34: Added support for mapping object and a new parameter secure to generate cryptographically safe result. From mapping objects, a random value from a pair is returned. 0.3.51: Removed parameter secure (see note below). 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.64: Added support for abroad objects; from these a random integer is returned.

0.3.66: Added support for ValuesView instances.

Support for ItemsView and KeysView is already provided, because both ABCs are subclasses of AbstractSet; instances of that ABC are already supported. Without knowing this fact, the documentation string for the class method was falsely interpreted (it said the instances of KeysView need to be used as an argument for list inbuilt class) and it was corrected in 0.3.66, granting support for objects of ValuesView ABC.

Instances of ItemsView return 2-item tuple (random key-value pair), what is interesting, and KeysView - a random key, just like when passing mere mapping-like object.
aveytense.Tense.print(*values: object, separator: str | None = " ", ending: str | None = "\n", file: Writable[str] | Flushable | None = None, flush: bool = False, reprFirst: bool = False)
Self
aveytense.Tense.print(*values, separator = " ", ending = "\n", file = None, flush = False, reprFirst = False)
Self

≥ 0.3.25

Equivalent to print(); only difference is the existence of the reprFirst parameter, indicating whether repr() for all objects in values should be invoked if possible, otherwise str() will be used on objects that don't have proper __repr__() method implementation.
aveytense.Tense.probability(*vf: T | Sequence[T | int | EllipsisType] | AbstractSet[T | int | EllipsisType] | Mapping[T, int | EllipsisType])
→ T
aveytense.Tense.probability(*vf)
Any

≥ 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 a list, to be used for aveytense.Tense.pick() class method.

Before 0.3.24, this class method was defined as tense08.Tense08.complexity() (see aveytense.Tense08); do not mistaken with tense08.Tense08.probability() because this class method was the ancestor of the current class method aveytense.Tense.probability2().

This class method bases on the math probability defintion.

  • vf (Required) - Must follow the following pattern (<> - 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 aveytense.Tense.pick(), however, this class method invokes aveytense.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. Such code also forced to catch unexpected errors.

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.

It is discouraged to use ellipsis as a role of the number 1 and sooner or later this support may cease to exist.

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)%

0.3.9

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 aveytense.TenseOptions.disableProbability2LengthLimit to bypass sys.maxsize. 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.

The value None is no longer supported, however, the version when it happened remains questionable.
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)
Any

≥ 0.3.8; < 0.3.24; ≥ 0.3.25

Simplier implementation of math probability; operates on 2 values.

Before 0.3.24, this class method was defined as tense08.Tense08.probability() (see aveytense.Tense08).

  • x (Optional) - The first value. The default value is 1.
  • y (Optional) - The second value. The default value is 0.
  • frequency (Optional) - The numerator for fraction returned from P(x). The value must be an integer equal zero or greater. If the value equals 0, y is always returned. If the value equals or is greater than value of length, x is always returned. Perhaps the last sentence is illegal in math probability notation, no error is thrown. The default value is 1.
  • length (Optional) - The denominator for fraction returned from P(x) (and also P(y)). The value must be a positive integer. The default value is 10000.

When values of frequency and length parameters aren't changed, the x parameter value has 1/10000 (0.01%) chance of dropping, and the rest goes to the value of the parameter y, with chance of 9999/10000 (99.99%).

In math, the notation would be the following:
  • P(x) = frequency / length
  • P(y) = 1 - P(x) = 1 - (frequency / length)

Return x when frequency / length ≥ 1 (occurs when frequency ≥ length), and return y when frequency = 0.

This method is invoked whether aveytense.Tense.probability() gets 2 values.

Basically P(y) equals P(x') (see complementary event). In opposite of aveytense.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 the coin flip example from aveytense.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])) 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 during the project's renovation.

0.3.25

0.3.25

0.3.25: 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 aveytense.TenseOptions.disableProbability2LengthLimit to bypass sys.maxsize.

Before version 0.3.46, to disqualify limit imposed by sys.maxsize attribute, there was a special attribute aveytense.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 aveytense.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 aveytense.TenseOptions.disableProbability2LengthLimit. 0.3.51: provided TypeError exception catching when comparing x with y using == operator. See warning note below.

Because type accordance faded away in 0.3.46, x == y can throw an error easier due to type mismatch. On 0.3.51 provided TypeError catching statement to prevent this. Today it catches any error springing from Exception class itself.

0.3.69: When x == y, either of these will be returned randomly. Previously, y was returned.
aveytense.Tense.probability3(vf: Mapping[T, int | EllipsisType], /)
→ T
aveytense.Tense.probability3(vf, /)
Any

≥ 0.3.46

Abridged version of aveytense.Tense.probability() class method. It operates on many values, however, difference is that vf parameter only accepts a mapping object 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).

It is discouraged to use ellipsis as a role of the number 1 and sooner or later this support may cease to exist. 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 aveytense.Tense.probability(), and its internal code is shorter, aveytense.Tense.probability3() is circa 3 times faster than aveytense.Tense.probability().

0.3.68
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.randomString(...)
→ ?

≥ 0.3.9; < 0.3.24; ≥ 0.3.25

(Description to be written soon.)
aveytense.Tense.removePrefix(...)
→ ?

≥ 0.3.53

(Description to be written soon.)
aveytense.Tense.removeSuffix(...)
→ ?

≥ 0.3.53

(Description to be written soon.)
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.7; < 0.3.24; ≥ 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 aveytense.Tense.shuffle() class method.

Before 0.3.24, this class method was defined as tense08.Tense08.reverse() (see aveytense.Tense08) back in 0.3.7 and originally operated on str and list objects.

$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.24 due to the project's renovation.

0.3.26rc2

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

0.3.68
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.9; < 0.3.24; ≥ 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 aveytense.Tense.reverse() class method.

Before 0.3.24, this class method was defined as tense08.Tense08Leapers.shuffle() (see aveytense.Tense08Leapers) back in 0.3.9 and originally operated on str and list objects. $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.24 due to the project's renovation.

0.3.26rc2

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

0.3.68
aveytense.Tense.sleep(seconds: float, /) aveytense.Tense.sleep(seconds, /) Self

≥ 0.3.25

Equivalent to time.sleep(), just returns reference to aveytense.Tense instead of None.
aveytense.Tense.splitGeneric(v, /)
tuple[type, tuple[Any, ...]] | None

≥ 0.3.55b1

Roughly equivalent to invocation of the following code: (typing.get_origin(v), typing.get_args(v)) .

None is returned whether the value is not a generic alias.
aveytense.Tense.splitUnion(v, /)
tuple[type, ...] | None

≥ 0.3.65

Returns all types in the union type object in a tuple. Equivalent to using typing.get_args() with the v parameter.

None is returned whether the value is not an union type object.
aveytense.Tense.startsWith(target, prefix, /, start = ..., end = ...)
bool

≥ 0.3.42

Mix of methods str.startswith(), bytes.startswith() and bytearray.startswith().
aveytense.Tense.test(target, pattern, flags = 0)
bool

≥ 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, /) aveytense.Tense.timeit(statement, /)
float

≥ 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.toList(v, /)
→ ?

≥ 0.3.26rc3

(Description to be written soon.)
aveytense.Tense.tryOrPass(f, /, exc = Exception)
→ ?

≥ 0.3.58

(Description to be written soon.)
aveytense.Tense.tryOrReturn(f, r = None, /, exc = Exception)
→ ?

≥ 0.3.58

(Description to be written soon.)
aveytense.Tense.union(v, /, *_)
Any

≥ 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)
Self

≥ 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.util

≥ 0.3.42

Equivalent to module aveytense.util.
aveytense.Tense.version
str

≥ 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.versionInfo
→ <version info object>

≥ 0.3.26?

Equivalent to removed constant aveytense.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. aveytense.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):

  • aveytense.Tense.versionInfo.major returns major version component; there 0
  • aveytense.Tense.versionInfo.minor returns minor version component; there 3
  • aveytense.Tense.versionInfo.micro returns micro version component; there 48
  • aveytense.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
class aveytense.CMYK

≥ 0.3.28

Creates a new instance of the class aveytense.RGB, with inverted color values.
class aveytense.ChangeVar

≥ 0.3.26rc1

(Description to be written soon.)
class aveytense.Color
type-alias aveytense.Colour

≥ 0.3.26rc1 / ≥ 0.3.37

This class allows to colorize and apply styles to the output. It bases on the ANSI escape code syntax.

Before 0.3.26rc1 it was in the module aveytense.extensions under the name ANSIColor.
aveytense.Color.__init__(text, /, bits = 8, foregroundColor = None, backgroundColor = None, ituFormat = False)

≥ 0.3.26rc1

Creates a new aveytense.Color class instance.

  • text (Required positional-only) - A string or object of class aveytense.util.MutableString.
  • bits (Optional) - An integer from the following values: 3, 4, 8, 24. These base on this article. The default value is 8.

    When using value 24, colored text will take a little longer to be printed in the output.
  • foregroundColor (Optional) - An integer or integer string representing the ID for the text color. Allowed values are dependent to the given bits value. The default value is None that deduces 0.

    In the table below n represents value on the parameter.

    Value of bits Allowed values Interpretation
    3 n ∈ ⟨0; 7⟩ n + 30
    4 n ∈ ⟨0; 15⟩ n + 30 if n ∈ ⟨0; 7⟩
    n + 82 if n ∈ ⟨8; 15⟩
    8 n ∈ ⟨0; 255⟩ n
    24 n ∈ ⟨0; 16777215⟩

    If bits has value 24, then a aveytense.RGB instance can be passed.
  • backgroundColor (Optional) - An integer or integer string representing the ID for the background color. Allowed values are dependent to the given bits value. The default value is None that deduces 0.

    In the table below n represents value on the parameter.

    Value of bits Allowed values Interpretation
    3 n ∈ ⟨0; 7⟩ n + 40
    4 n ∈ ⟨0; 15⟩ n + 40 if n ∈ ⟨0; 7⟩
    n + 92 if n ∈ ⟨8; 15⟩
    8 n ∈ ⟨0; 255⟩ n
    24 n ∈ ⟨0; 16777215⟩

    If bits has value 24, then a aveytense.RGB instance can be passed.
  • ituFormat (Optional; Since 0.3.58) - A boolean value indicating whether format for ITU T.416 Information technology should be used or not. If this parameter received value True, all semicolons (;) used for ANSI escape code will be replaced with colons (:). The default value is False.
aveytense.Color.__mod__(other)
str

≥ 0.3.26rc1

Allows to include styles to colored text, and returns styled, colored version of text. Equals self % other

  • other - An enumerator object retrieved from one of the following attributes:

Constant Lifetime Description Value
Single styles
NORMAL ≥ 0.3.26rc1 Provides normal text. Nothing changes with this constant 0
BOLD Text becomes bold 1
ITALIC Text becomes oblique 3
UNDERLINE Adds a line under the text 4
SLOW_BLINK Sets blinking to less than 150 times per minute 5
RAPID_BLINK Sets blinking to more than 150 times per minute 6
REVERSE Swap foreground and background colors 7
HIDE Text isn't visible on the output 8
STRIKE Text becomes crossed out 9
DOUBLE_UNDERLINE Adds 2 lines under the text 21
PROPORTIONAL ≥ 0.3.26rc1; < 0.3.26rc2 Proportional spacing, consider using str.rjust() instead 0.3.26rc2 26
FRAME ≥ 0.3.26rc1 ? 51
ENCIRCLE It is probably border encasing entire text. 52
OVERLINE Adds a line over the text 53
SUPERSCRIPT Superscripts the text 73
SUBSCRIPT Subscripts the text 74
Advanced styles
BOLD_ITALIC ≥ 0.3.26rc2 Text becomes bold and oblique 1000
BOLD_UNDERLINE Text becomes bold and underlined 1001
BOLD_STRIKE Text becomes bold and crossed out 1002
BOLD_OVERLINE Text becomes bold and overlined 1003
ITALIC_UNDERLINE Text becomes oblique and underlined 1004
ITALIC_STRIKE Text becomes oblique and crossed out 1005
ITALIC_OVERLINE Text becomes oblique and overlined 1006
UNDERLINE_STRIKE Text becomes underlined and crossed out 1007
UOLINE Adds lines under and over the text 1008
STRIKE_OVERLINE Text becomes crossed out and overlined 1009
BOLD_ITALIC_UNDERLINE Text becomes bold, oblique and underlined 1100
BOLD_ITALIC_STRIKE Text becomes bold, oblique and crossed out 1101
BOLD_ITALIC_OVERLINE Text becomes bold, oblique and overlined 1102
BOLD_UNDERLINE_STRIKE Text becomes bold, underlined and crossed out 1103
BOLD_UOLINE Text becomes bold, underlined and overlined 1104
ITALIC_UNDERLINE_STRIKE Text becomes italic, underlined and crossed out 1105
ITALIC_UOLINE Text becomes italic, underlined and overlined 1106
ITALIC_STRIKE_OVERLINE Text becomes bold, crossed out and overlined 1107
STRIKE_UOLINE Text becomes crossed out, underlined and overlined 1108
The values of the enumerator objects returned from the attributes that support single styles directly base on this article. 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 $m[aveytense] import $t[Tense] $t[Tense].$tm[print]($c[Color]("I will be blue and italic", 8, 69) % Color.ITALIC)
aveytense.Color.__str__()
str

≥ 0.3.34

Returns the text with ANSI escape code. If there is no use of the % operator, this method must be invoked to print the text in the terminal output. Equals str(self).

In different form since 0.3.26rc1 this method existed as 3 methods returning the same result: aveytense.Color.__pos__(), aveytense.Color.__neg__() and aveytense.Color.__invert__(), all them removed in 0.3.48.
static aveytense.Color.mix(text, /, bits, colorIds, style = None, ituFormat = False, reverse = True)
str

≥ 0.3.58

Generates a gradient with given colors in iterable object in colorIds parameter.

  • text (Required positional-only) - A string or object of class aveytense.util.MutableString.
  • bits (Required) - An integer from the following values: 3, 4, 8, 24. These base on this article.
  • colorIds (Required) - An iterable object (sequence-like object preferred) containing integers or instances of aveytense.RGB. These determine about color IDs for every next character in the text. Refer to foregroundColor parameter documentation in the aveytense.Color.__init__() method for value restrictions. If length of colorIds is least than character length in the given text, the pattern from it will be repeated as much times until the end of the text is reached.

    Refrain from using instances of aveytense.RGB if the bits value isn't equal 24.
  • style (Optional) - Any completely uppercased enumerator from class aveytense.Color that can be accepted in the aveytense.Color.__mod__() method. The default value is None that tells the program to not apply any style.
  • ituFormat (Optional) - A boolean value indicating whether format for ITU T.416 Information technology should be used or not. If this parameter received value True, all semicolons (;) used for ANSI escape code will be replaced with colons (:). The default value is False.
  • reverse (Optional) - A boolean value indicating whether the next pattern to reverse whether it is exhausted due to higher amount of characters than length of colorIds (otherwise it would have no effect). For example: the colorIds parameter has tuple value (196, 160, 124, 88, 52, 16), then the next pattern is (52, 88, 124, 160) (endpoints excluded), meaning the entire pattern is (196, 160, 124, 88, 52, 16, 52, 88, 124, 160) and applied for every character aside whitespaces. The default value is True. If the parameter had value False, the pattern would be (196, 160, 124, 88, 52, 16).
class aveytense.Colors
type-alias aveytense.Colours

≥ 0.3.41

(Description to be written soon.)
class aveytense.Math

≥ 0.3.25

(Description to be written soon.)
class aveytense.RGB

≥ 0.3.28

(Description to be written soon.)
class aveytense.RGBA

≥ 0.3.37

(Description to be written soon.)
class aveytense.Time

≥ 0.3.25

(Description to be written soon.)
class aveytense.abroad(value1, /, value2 = ..., modifier = ...)
→ <abroad object>

≥ 0.3.9

(Description to be written soon.)

0.3.10
class aveytense.aveytenseVersion(asString = True)
tuple | str

≥ 0.3.25

(Description to be written soon.)

0.3.67
class aveytense.reckon(*countables)
int

≥ 0.3.7

(Description to be written soon.)

0.3.7
class aveytense.reckonGreatest(*countables)
int

≥ 0.3.25

(Description to be written soon.)

0.3.25
class aveytense.reckonIsGreater(countable1, countable2, /)
bool

≥ 0.3.25

(Description to be written soon.)

0.3.25
class aveytense.reckonIsGreater(countable1, countable2, /)
bool

≥ 0.3.25

(Description to be written soon.)

0.3.25
class aveytense.reckonGreatest(*countables)
int

≥ 0.3.25

(Description to be written soon.)

0.3.25
aveytense.constants module
aveytense.exceptions module
aveytense.extensions module

To make the type parameter interpretation easier, there is the following formula:
type-alias aveytense.extensions.ABC

≥ 0.3.44

Type alias that equals abc.ABC
type-alias aveytense.extensions.ABCMeta

≥ 0.3.44

Type alias that equals abc.ABCMeta
type-alias aveytense.extensions.AST

≥ 0.3.54

Type alias that equals ast.AST
class aveytense.extensions.AVT_Accumulate[T]

≥ 0.3.55a2

A generic version of itertools.accumulate to be used in non-stub files.

Use aveytense.extensions.accumulate to inspect objects with the isinstance() function.
type-alias|class aveytense.extensions.AVT_Array[T]

≥ 0.3.54

A generic version of array.array. If there is necessity checking type of an object with this type alias, aveytense.extensions.array should be used instead, unless Python 3.12 or higher is used.

The T type parameter (_A in-code) accepts int, float and str types only. These are specified as constraints.

Type alias details
Referred class/type Python versions
array.array ≥ 3.12
Defined as a class < 3.12

As a class for Python 3.11 and least, the class is generic and inherits from array.array.

This type alias/class should be used over array.array so the aveytense.Tense.isArray() class method can type hint properly when using Python version prior to 3.12.
type-alias aveytense.extensions.AVT_AsyncContextManager[T_Covariant, Async_Exit_Covariant = bool | None]

≥ 0.3.53

A generic version of contextlib.AbstractAsyncContextManager. If there is necessity checking type of an object with this type alias, aveytense.extensions.AsyncContextManager should be used instead, unless Python 3.9 or higher is used.

The Async_Exit_Covariant type parameter exists since Python 3.13.

Type alias details
Referred class/type Python versions
contextlib.AbstractAsyncContextManager ≥ 3.9
typing.AsyncContextManager < 3.9
type-alias aveytense.extensions.AVT_AsyncGenerator[Yield_Covariant, Send_Covariant]

≥ 0.3.52

A generic version of collections.abc.AsyncGenerator. If there is necessity checking type of an object with this type alias, aveytense.extensions.AsyncGenerator should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.AsyncGenerator ≥ 3.9
typing.AsyncGenerator < 3.9
type-alias aveytense.extensions.AVT_AsyncIterable[T_Covariant]

≥ 0.3.52

A generic version of collections.abc.AsyncIterable. If there is necessity checking type of an object with this type alias, aveytense.extensions.AsyncIterable should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.AsyncIterable ≥ 3.9
typing.AsyncIterable < 3.9
type-alias aveytense.extensions.AVT_AsyncIterator[T_Covariant]

≥ 0.3.52

A generic version of collections.abc.AsyncIterator. If there is necessity checking type of an object with this type alias, aveytense.extensions.AsyncIterator should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.AsyncIterator ≥ 3.9
typing.AsyncIterator < 3.9
type-alias aveytense.extensions.AVT_Awaitable[T_Covariant]

≥ 0.3.52

A generic version of collections.abc.Awaitable. If there is necessity checking type of an object with this type alias, aveytense.extensions.Awaitable should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.Awaitable ≥ 3.9
typing.Awaitable < 3.9
class aveytense.extensions.AVT_Batched[T_Covariant]

≥ 0.3.55a2

A generic version of itertools.batched.

itertools.batched exists since Python 3.12, use aveytense.extensions.batched to use it for Python 3.8+.
type-alias aveytense.extensions.AVT_Callable

≥ 0.3.52

A generic version of collections.abc.Callable. For inspection callable() (objects) and aveytense.extensions.TypingCallableType (types) should be used instead.

Type alias details
Referred class/type Python versions
collections.abc.Callable ≥ 3.9
typing.Callable < 3.9
class aveytense.extensions.AVT_Chain[T]

≥ 0.3.55a2

A generic version of itertools.chain.
class aveytense.extensions.AVT_ChainMap[Key, Value]

≥ 0.3.52

A generic version of collections.ChainMap. If there is necessity checking type of an object with this type alias, aveytense.extensions.ChainMap should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.ChainMap ≥ 3.9
typing.ChainMap < 3.9
type-alias aveytense.extensions.AVT_Collection[T_Covariant]

≥ 0.3.52

A generic version of collections.abc.Collection. If there is necessity checking type of an object with this type alias, aveytense.extensions.Collection should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.Collection ≥ 3.9
typing.Collection < 3.9
class aveytense.extensions.AVT_Combinations[T_Covariant]

≥ 0.3.55a2

A generic version of itertools.combinations.
class aveytense.extensions.AVT_CombinationsReplacement[T_Covariant]

≥ 0.3.55a2

A generic version of itertools.combinations_with_replacement.
class aveytense.extensions.AVT_Compress[T]

≥ 0.3.55a2

A generic version of itertools.compress.
type-alias aveytense.extensions.AVT_Container[T_Covariant]

≥ 0.3.52

A generic version of collections.abc.Container. If there is necessity checking type of an object with this type alias, aveytense.extensions.Container should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.Container ≥ 3.9
typing.Container < 3.9
type-alias aveytense.extensions.AVT_ContextManager[T_Covariant, Exit_Covariant = bool | None]

≥ 0.3.53

A generic version of contextlib.AbstractContextManager. If there is necessity checking type of an object with this type alias, aveytense.extensions.ContextManager should be used instead, unless Python 3.9 or higher is used.

The Exit_Covariant type parameter exists since Python 3.13.

Type alias details
Referred class/type Python versions
contextlib.AbstractContextManager ≥ 3.9
typing.ContextManager < 3.9
type-alias aveytense.extensions.AVT_Coroutine[Yield_Covariant, Send_Contravariant, Throw_Covariant]

≥ 0.3.52

A generic version of collections.abc.Coroutine. If there is necessity checking type of an object with this type alias, aveytense.extensions.Coroutine should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.Coroutine ≥ 3.9
typing.Coroutine < 3.9
class aveytense.extensions.AVT_Count[T]

≥ 0.3.55a2

A generic version of itertools.count.

The T type parameter (_N in-code) accepts int, float and classes implementing any of the following methods: __int__(), __float__(), __complex__(), __index__(). These are specified as constraints, what means T cannot receive an union type of any of these.
type-alias aveytense.extensions.AVT_Counter[T]

≥ 0.3.52

A generic version of collections.Counter. If there is necessity checking type of an object with this type alias, aveytense.extensions.Counter should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.Counter ≥ 3.9
typing.Counter < 3.9
class aveytense.extensions.AVT_Cycle[T]

≥ 0.3.55a2

A generic version of itertools.cycle.
type-alias aveytense.extensions.AVT_DefaultDict[Key, Value]

≥ 0.3.52

A generic version of collections.defaultdict. If there is necessity checking type of an object with this type alias, aveytense.extensions.defaultdict should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.defaultdict ≥ 3.9
typing.DefaultDict < 3.9
type-alias aveytense.extensions.AVT_Deque[T]

≥ 0.3.52

A generic version of collections.deque. If there is necessity checking type of an object with this type alias, aveytense.extensions.deque should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.deque ≥ 3.9
typing.Deque < 3.9
type-alias aveytense.extensions.AVT_Dict[Key, Value]

≥ 0.3.52

A generic version of dict. If there is necessity checking type of an object with this type alias, dict should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
dict ≥ 3.9
typing.Dict < 3.9
class aveytense.extensions.AVT_DropWhile[T]

≥ 0.3.55a2

A generic version of itertools.dropwhile.
type-alias|class aveytense.extensions.AVT_Enumerate[T]

≥ 0.3.55a2

A generic version of enumerate. If there is necessity checking type of an object with this type alias, enumerate should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
enumerate ≥ 3.9
Defined as a class < 3.9

As a class for Python 3.8, the class is generic and inherits from enumerate.
class aveytense.extensions.AVT_Filter[T]

≥ 0.3.55b1

A generic version of filter.
class aveytense.extensions.AVT_FilterFalse[T]

≥ 0.3.55a2

A generic version of itertools.filterfalse.
type-alias aveytense.extensions.AVT_FrozenSet[T_Covariant]

≥ 0.3.52

A generic version of frozenset. If there is necessity checking type of an object with this type alias, frozenset should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
frozenset ≥ 3.9
typing.FrozenSet < 3.9
class aveytense.extensions.AVT_Generator[Yield_Covariant, Send_Contravariant = None, Throw_Covariant = None]

≥ 0.3.52

A generic version of collections.abc.Generator. If there is necessity checking type of an object with this type alias, aveytense.extensions.Generator should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.Generator ≥ 3.9
typing.Generator < 3.9
type-alias aveytense.extensions.AVT_GenericAlias

≥ 0.3.55a1

A backported version of types.GenericAlias.

Type alias details
Referred class/type Python versions
types.GenericAlias ≥ 3.9
aveytense.extensions.TypingGenericType < 3.9
class aveytense.extensions.AVT_GroupBy[T1_Covariant, T2_Covariant]

≥ 0.3.55a2

A generic version of itertools.groupby.
class aveytense.extensions.AVT_Islice[T]

≥ 0.3.55a2

A generic version of itertools.islice.
type-alias aveytense.extensions.AVT_ItemsView[Key_Covariant, Value_Covariant]

≥ 0.3.52

A generic version of collections.abc.ItemsView. If there is necessity checking type of an object with this type alias, aveytense.extensions.ItemsView should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.ItemsView ≥ 3.9
typing.ItemsView < 3.9
type-alias aveytense.extensions.AVT_Iterable[T_Covariant]

≥ 0.3.52

A generic version of collections.abc.Iterable. If there is necessity checking type of an object with this type alias, aveytense.extensions.Iterable should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.Iterable ≥ 3.9
typing.Iterable < 3.9
type-alias aveytense.extensions.AVT_Iterator[T_Covariant]

≥ 0.3.52

A generic version of collections.abc.Iterator. If there is necessity checking type of an object with this type alias, aveytense.extensions.Iterator should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.Iterator ≥ 3.9
typing.Iterator < 3.9
type-alias aveytense.extensions.AVT_KeysView[Key_Covariant]

≥ 0.3.52

A generic version of collections.abc.KeysView. If there is necessity checking type of an object with this type alias, aveytense.extensions.KeysView should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.KeysView ≥ 3.9
typing.KeysView < 3.9
type-alias aveytense.extensions.AVT_List[T]

≥ 0.3.52

A generic version of list. If there is necessity checking type of an object with this type alias, list should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
list ≥ 3.9
typing.List < 3.9
class aveytense.extensions.AVT_Map[T]

≥ 0.3.55b1

A generic version of map.
type-alias aveytense.extensions.AVT_Mapping[Key, Value_Covariant]

≥ 0.3.52

A generic version of collections.abc.Mapping. If there is necessity checking type of an object with this type alias, aveytense.extensions.Mapping should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.Mapping ≥ 3.9
typing.Mapping < 3.9
type-alias aveytense.extensions.AVT_MappingView[T_Covariant]

≥ 0.3.52

A seemingly generic version of collections.abc.MappingView. If there is necessity checking type of an object with this type alias, aveytense.extensions.MappingView should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.MappingView ≥ 3.9
typing.MappingView < 3.9

Not in all versions of Python this class is generic.
type-alias aveytense.extensions.AVT_Match[AnyStr]

≥ 0.3.52

A generic version of re.Match. If there is necessity checking type of an object with this type alias, aveytense.extensions.Match should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
re.Match ≥ 3.9
typing.Match < 3.9
type-alias|class aveytense.extensions.AVT_MemoryView[T = int]

≥ 0.3.54

A generic version of memoryview. If there is necessity checking type of an object with this type alias, memoryview should be used instead, unless Python 3.14 or higher is used.

Type alias details
Referred class/type Python versions
memoryview ≥ 3.14
Defined as a class < 3.14

As a class for Python 3.13 and least, the class is seemingly inheriting memoryview, however, memoryview cannot be subclassed. That means if instance of aveytense.extensions.AVT_MemoryView was created, it is actually an instance of memoryview (mimicking by type hinting). At first this seems to be an undesired approach, but aveytense.extensions.AVT_MemoryView, as a class, attempts to mimic memoryview with type hinting, since subclassing memoryview is forbidden, to make type hinting flow nicely without anomalies. Otherwise it has no affection on the user's code.

To make the understanding easier, there is an example code:

$k[from] $m[aveytense].$msu[extensions] $k[import] $c[AVT_MemoryView] $v[a] = $c[AVT_MemoryView]($k[b]"abc") # seemingly AVT_MemoryView[int], that's memoryview[int] actually

Type hinting for the constructor of aveytense.extensions.AVT_MemoryView has been actually corrected only on 0.3.72.

This type alias/class should be used over memoryview so the aveytense.Tense.isMemoryView() class method can type hint properly when using Python version prior to 3.14.
class aveytense.extensions.AVT_MutableMapping[Key, Value]

≥ 0.3.52

A generic version of collections.abc.MutableMapping. If there is necessity checking type of an object with this type alias, aveytense.extensions.MutableMapping should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.MutableMapping ≥ 3.9
typing.MutableMapping < 3.9
class aveytense.extensions.AVT_MutableSequence[T]

≥ 0.3.52

A generic version of collections.abc.MutableSequence. If there is necessity checking type of an object with this type alias, aveytense.extensions.MutableSequence should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.MutableSequence ≥ 3.9
typing.MutableSequence < 3.9
class aveytense.extensions.AVT_MutableUniqual[T]

≥ 0.3.52

A generic version of collections.abc.MutableSet. If there is necessity checking type of an object with this type alias, aveytense.extensions.MutableSet should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.MutableSet ≥ 3.9
typing.MutableSet < 3.9
class aveytense.extensions.AVT_OrderedDict[Key, Value]

≥ 0.3.52

A generic version of collections.OrderedDict. If there is necessity checking type of an object with this type alias, aveytense.extensions.OrderedDict should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.OrderedDict ≥ 3.9
typing.OrderedDict < 3.9
class aveytense.extensions.AVT_Pairwise[T_Covariant]

≥ 0.3.55a2

A generic version of itertools.pairwise.

itertools.pairwise exists since Python 3.10, use aveytense.extensions.pairwise to use it for Python 3.8+.
type-alias|class aveytense.extensions.AVT_PathLike[AnyStr_Covariant]

≥ 0.3.54

A backported generic version of os.PathLike. If there is necessity checking type of an object with this type alias, aveytense.extensions.PathLike should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
os.PathLike ≥ 3.9
Defined as a class < 3.9

As a class for Python 3.8, the class is a runtime protocol class and with the __fspath__() method.
type-alias aveytense.extensions.AVT_Pattern[AnyStr]

≥ 0.3.52

A generic version of re.Pattern. If there is necessity checking type of an object with this type alias, aveytense.extensions.Pattern should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
re.Pattern ≥ 3.9
typing.Pattern < 3.9
class aveytense.extensions.AVT_Permutations[T_Covariant]

≥ 0.3.55a2

A generic version of itertools.permutations.
class aveytense.extensions.AVT_Product[T]

≥ 0.3.55a2

A generic version of itertools.product.
class aveytense.extensions.AVT_Repeat[T_Covariant]

≥ 0.3.55a2

A generic version of itertools.repeat.
class aveytense.extensions.AVT_Reversed[T]

≥ 0.3.52

A generic version of reversed.
type-alias aveytense.extensions.AVT_Reversible[T_Covariant]

≥ 0.3.52

A generic version of collections.abc.Reversible. If there is necessity checking type of an object with this type alias, aveytense.extensions.Reversible should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.Reversible ≥ 3.9
typing.Reversible < 3.9
type-alias aveytense.extensions.AVT_Sequence[T_Covariant]

≥ 0.3.52

A generic version of collections.abc.Sequence. If there is necessity checking type of an object with this type alias, aveytense.extensions.Sequence should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.Sequence ≥ 3.9
typing.Sequence < 3.9
type-alias aveytense.extensions.AVT_Set[T_Covariant]

≥ 0.3.52

A generic version of set. If there is necessity checking type of an object with this type alias, set should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
set ≥ 3.9
typing.Set < 3.9
class aveytense.extensions.AVT_Slice[Start_Covariant?, Stop_Covariant?, Step_Covariant?]

≥ 0.3.55b1

A generic version of slice.

Once the class is constructed, it returns an instance of slice, and from this moment the object cannot use the subscription notation.

This type alias/class should be used over slice so the aveytense.Tense.isSlice() class method can type hint properly.
class aveytense.extensions.AVT_StarMap[T_Covariant]

≥ 0.3.55a2

A generic version of itertools.starmap.
class aveytense.extensions.AVT_TakeWhile[T]

≥ 0.3.55a2

A generic version of itertools.takewhile.
type-alias aveytense.extensions.AVT_Tuple[...]

≥ 0.3.52

A generic version of tuple. If there is necessity checking type of an object with this type alias, tuple should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
tuple ≥ 3.9
typing.Tuple < 3.9
type-alias aveytense.extensions.AVT_Type[T]

≥ 0.3.52

A generic version of type. If there is necessity checking type of an object with this type alias, type should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
type ≥ 3.9
typing.Type < 3.9
type-alias aveytense.extensions.AVT_TypeIs[T]

≥ 0.3.56

A backported version of typing.TypeIs (defined in Python 3.13) for Python 3.8+. This will work only if the user have installed the typing_extensions PyPi project version 4.10.0+.

There is actually a secret hidden in its code. For Python versions older than 3.8 (if the project was even backported further), this is a type alias for typing.TypeGuard.
type-alias aveytense.extensions.AVT_UnionType

≥ 0.3.55a1

A backported version of types.UnionType.

Type alias details
Referred class/type Python versions
types.UnionType ≥ 3.10
aveytense.extensions.TypingUnionType < 3.10
type-alias aveytense.extensions.AVT_Uniqual[T]

≥ 0.3.52

A generic version of collections.abc.Set. If there is necessity checking type of an object with this type alias, aveytense.extensions.Uniqual should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.Set ≥ 3.9
typing.AbstractSet < 3.9
type-alias aveytense.extensions.AVT_ValuesView[T]

≥ 0.3.52

A generic version of collections.abc.ValuesView. If there is necessity checking type of an object with this type alias, aveytense.extensions.ValuesView should be used instead, unless Python 3.9 or higher is used.

Type alias details
Referred class/type Python versions
collections.abc.ValuesView ≥ 3.9
typing.ValuesView < 3.9
class aveytense.extensions.AVT_Zip[T_Covariant]

≥ 0.3.55a2

A generic version of zip.
class aveytense.extensions.AVT_ZipLongest[T_Covariant]

≥ 0.3.55a2

A generic version of itertools.zip_longest.
class aveytense.extensions.Absolute[T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __abs__() method. It is invoked as abs(self) (see abs() function).

The type parameter indicates the return type for the __abs__() method.
class aveytense.extensions.AdditionOperable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __add__() method. It is invoked as self + other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __add__() method.
class aveytense.extensions.AdditionReassignable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __iadd__() method. It is invoked as self += other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __iadd__() method.
class aveytense.extensions.Allocator

≥ 0.3.27b3

This class gives access to the __alloc__() method that returns an amount of bits allocated in an instance of bytearray.

Despite this method isn't documented much, this class will become a runtime protocol class in the future.
type-alias aveytense.extensions.AnnotateFunc
→ (Format) -> dict[str, AnnotationForm]

≥ 0.3.57

A backported type alias from stub module _typeshed to be used also in non-stub Python files. Equivalent to _typeshed.AnnotateFunc (Python 3.14+).
type-alias aveytense.extensions.Annotated

≥ 0.3.26rc1

A backported special form typing.Annotated (Python 3.9+).
type-alias aveytense.extensions.AnnotationForm
Any

≥ 0.3.48

A backported type alias from stub module _typeshed to be used also in non-stub files. Equivalent to _typeshed.AnnotationForm (Python 3.14+).
type-alias aveytense.extensions.Any

≥ 0.3.26rc1

A backported special type typing.Any.
type-alias aveytense.extensions.AnyCallable
→ (...) -> Any

≥ 0.3.26rc3

class aveytense.extensions.AnyMeta
→ ?

≥ 0.3.52

Metaclass of typing.Any. Should be used in type inspection only.
type-parameter aveytense.extensions.AnyStr

≥ ?

A non-deprecated version of currently deprecated type parameter typing.AnyStr.

Defined as:

$tv[AnyStr] = $c[TypeVar]("AnyStr", $c[str], $c[bytes])
class aveytense.extensions.ArgInfo

≥ 0.3.26rc3

A named tuple from the inspect library. Unofficial and will be removed in the future.
class aveytense.extensions.Arguments

≥ 0.3.26rc3

A named tuple from the inspect library. Unofficial and will be removed in the future.
class aveytense.extensions.ArithmeticCollection

≥ 0.3.26rc1

A runtime protocol class for classes supporting every arithmetic operation: +, -, *, @, /, //, %, **, divmod(), +=, -=, *=, @=, /=, //=, %=, **=.

Methods included: __add__(), __radd__(), __sub__(), __rsub__(), __mul__(), __rmul__(), __matmul__(), __rmatmul__(), __truediv__(), __rtruediv__(), __floordiv__(), __rfloordiv__(), __mod__(), __rmod__(), __pow__(), __rpow__(), __divmod__(), __rdivmod__(), __iadd__(), __isub__(), __imul__(), __imatmul__(), __itruediv__(), __ifloordiv__(), __imod__(), __ipow__()
class aveytense.extensions.ArithmeticOperable

≥ 0.3.26rc1

A runtime protocol class for classes supporting every arithmetic operation aside re-assignment: +, -, *, @, /, //, %, **, divmod().

Methods included: __add__(), __radd__(), __sub__(), __rsub__(), __mul__(), __rmul__(), __matmul__(), __rmatmul__(), __truediv__(), __rtruediv__(), __floordiv__(), __rfloordiv__(), __mod__(), __rmod__(), __pow__(), __rpow__(), __divmod__(), __rdivmod__()
class aveytense.extensions.ArithmeticReassignable

≥ 0.3.26rc1

A runtime protocol class for classes supporting every re-assignment arithmetic operation: +=, -=, *=, @=, /=, //=, %=, **=.

Methods included: __iadd__(), __isub__(), __imul__(), __imatmul__(), __itruediv__(), __ifloordiv__(), __imod__(), __ipow__()
type-alias aveytense.extensions.ArrayFloatTypecodes
Literal["f", "d"]

≥ 0.3.60

type-alias aveytense.extensions.ArrayIntegerTypecodes
Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]

≥ 0.3.60

type-alias aveytense.extensions.ArrayType
array

≥ 0.3.37

Equivalent to array.array.
type-alias aveytense.extensions.ArrayTypecodes
Literal[...]

≥ 0.3.60

The type value is Literal["b", "B", "d", "f", "h", "H", "i", "I", "l", "L", "q", "Q", <string literals from aveytense.extensions.ArrayUnicodeTypecodes>], the same as union: aveytense.extensions.ArrayFloatTypecodes | aveytense.extensions.ArrayIntegerTypecodes | aveytense.extensions.ArrayUnicodeTypecodes
type-alias aveytense.extensions.ArrayUnicodeTypecodes
Literal[...]

≥ 0.3.60

The exact value of this type alias is addicted to the used Python version:
  • Python 3.16+: Literal["w"]
  • Python 3.13+: Literal["u", "w"]
  • Python <3.13: Literal["u"]
type-alias aveytense.extensions.AsyncContextManager

≥ 0.3.53

A non-generic version of, and simultaneously the same as contextlib.AbstractAsyncContextManager.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_AsyncContextManager instead.
class aveytense.extensions.AsyncEnterOperable[T_Covariant]

≥ 0.3.26b3

A runtime protocol class for classes that support the __aenter__() method. It is invoked within the async with block during its initialization.

The covariant type parameter indicates the return type for the __aenter__() method (type parameter for Awaitable as Awaitable[T_Covariant]).
class aveytense.extensions.AsyncExitOperable[T_Covariant]

≥ 0.3.26b3

A runtime protocol class for classes that support the __aexit__() method. It is invoked within the async with block during exit.

The covariant type parameter indicates the return type for the __aexit__() method (type parameter for Awaitable as Awaitable[T_Covariant]).
type-alias aveytense.extensions.AsyncGenerator

≥ <0.3.50

A non-generic version of, and simultaneously the same as collections.abc.AsyncGenerator.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_AsyncGenerator instead.
type-alias aveytense.extensions.AsyncGeneratorType

≥ 0.3.44

Equivalent to types.AsyncGeneratorType (Python 3.6+).
class aveytense.extensions.AsyncIterable

≥ <0.3.50

A non-generic version of, and simultaneously the same as collections.abc.AsyncIterable.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_AsyncIterable instead.
class aveytense.extensions.AsyncIterator

≥ <0.3.50

A non-generic version of, and simultaneously the same as collections.abc.AsyncIterator.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_AsyncIterator instead.
class aveytense.extensions.AsyncNextOperable[T_Covariant]

≥ 0.3.26b3

A runtime protocol class for classes that support the __anext__() method. It is invoked within the async for block.

The covariant type parameter indicates the return type for the __aexit__() method (type parameter for Awaitable as Awaitable[T_Covariant]).
class aveytense.extensions.Attribute

≥ 0.3.26rc3

A named tuple from the inspect library. Unofficial and will be removed in the future.
type-alias aveytense.extensions.Awaitable

≥ <0.3.50

A non-generic version of, and simultaneously the same as collections.abc.Awaitable.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_Awaitable instead.
class aveytense.extensions.AwaitableGenerator[Yield_Covariant, Send_Contravariant, Return_Covariant, T]

≥ 0.3.58

A generic abstract base class from stub module _typeshed._type_checker, used in the source code of the typing library.
type-alias aveytense.extensions.BinaryIO

≥ 0.3.26rc3

Equivalent to typing.BinaryIO.
class aveytense.extensions.BinaryRepresentable

≥ 0.3.26rc1

A runtime protocol class for classes that support the __bin__() method. While it has unofficial position in Python, the __bin__() has to equal bin(self) (see bin() function).

There will be plans to support the method via the class method aveytense.Tense.bin(), or completely new function/method.

The __bin__() method should return a numeric string in binary notation.
class aveytense.extensions.BitwiseAndOperable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __and__() method. It is invoked as self & other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __and__() method.
class aveytense.extensions.BitwiseAndReassignable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __iand__() method. It is invoked as self &= other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __iand__() method.
class aveytense.extensions.BitwiseCollection

≥ 0.3.26rc1

A runtime protocol class for classes supporting every bitwise operation: &, |, ^, <<, >>, &=, |=, ^=, <<=, >>=.

Methods included: __and__(), __or__(), __xor__(), __lshift__(), __rshift__(), __iand__(), __ior__(), __ixor__(), __ilshift__(), __irshift__()

0.3.72: Added missing methods: __rand__(), __ror__(), __rxor__()
class aveytense.extensions.BitwiseLeftOperable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __lshift__() method. It is invoked as self << other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __lshift__() method.
class aveytense.extensions.BitwiseLeftReassignable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __ilshift__() method. It is invoked as self <<= other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __ilshift__() method.
class aveytense.extensions.BitwiseOperable

≥ 0.3.26rc1

A runtime protocol class for classes supporting every bitwise operation aside re-assignment: &, |, ^, <<, >>.

Methods included: __and__(), __or__(), __xor__(), __lshift__(), __rshift__()
class aveytense.extensions.BitwiseOrOperable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __or__() method. It is invoked as self | other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __or__() method.
class aveytense.extensions.BitwiseOrReassignable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __ror__() method. It is invoked as self |= other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __ror__() method.
class aveytense.extensions.BitwiseReassignable

≥ 0.3.26rc1

A runtime protocol class for classes supporting every re-assignment bitwise operation: &=, |=, ^=, <<=, >>=.

Methods included: __iand__(), __ior__(), __ixor__(), __ilshift__(), __irshift__()
class aveytense.extensions.BitwiseRightOperable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __rshift__() method. It is invoked as self >> other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __rshift__() method.
class aveytense.extensions.BitwiseRightReassignable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __ilshift__() method. It is invoked as self >>= other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __irshift__() method.
class aveytense.extensions.BitwiseXorOperable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __xor__() method. It is invoked as self ^ other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __xor__() method.
class aveytense.extensions.BitwiseXorReassignable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

A runtime protocol class for classes that support the __ixor__() method. It is invoked as self ^= other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __ixor__() method.
class aveytense.extensions.BlockFinder

≥ 0.3.26rc3

A named tuple from the inspect library. Unofficial and will be removed in the future.
class aveytense.extensions.BooleanConvertible

≥ 0.3.26rc1

A runtime protocol class for classes that support the __bool__() method. It is invoked as bool(self) (see bool class).
type-alias aveytense.extensions.BooleanUnion[T]
→ T | bool

≥ 0.3.26rc3

class aveytense.extensions.BoundArguments

≥ 0.3.26rc3

A named tuple from the inspect library. Unofficial and will be removed in the future.
class aveytense.extensions.Buffer

≥ 0.3.44

A runtime protocol class declared as a backport for collections.abc.Buffer (Python 3.12+). The class is for classes that support the __buffer__() method.
enum aveytense.extensions.BufferFlags

≥ 0.3.26rc2

A backported version of inspect.BufferFlags (Python 3.12+).
type-alias aveytense.extensions.BufferOperable

≥ 0.3.26rc1

For backward-compatibility; equivalent to aveytense.extensions.Buffer.
class aveytense.extensions.BufferProtocol

≥ 0.3.54

A runtime protocol class for classes that support the buffer protocol methods, those are __buffer__() and __release_buffer__()
class aveytense.extensions.BufferReleaser

≥ 0.3.26

A runtime protocol class for classes that support the __release_buffer__() method.
type-alias aveytense.extensions.BuiltinFunctionType

≥ 0.3.51

Equivalent to types.BuiltinFunctionType.
type-alias aveytense.extensions.ByteString
bytes | bytearray | memoryview

≥ 0.3.37

A non-deprecated version of currently deprecated type alias collections.abc.ByteString
class aveytense.extensions.BytearrayConvertible

≥ 0.3.26rc3

A runtime protocol class for classes that support the __bytearray__() method. While it has unofficial position in Python, the __bytearray__() has to equal bytearray(self) (see bytearray class).

There will be plans to support the method via the nonexistent function aveytense.extensions.bytearray().

The __bytearray__() method should return an instance of bytearray.
class aveytense.extensions.BytesConvertible

≥ 0.3.26rc1

A runtime protocol class for classes that support the __bytes__() method. It is invoked as bytes(self) (see bytes class).
type-alias aveytense.extensions.Callable

≥ <0.3.50

A non-generic version of, and simultaneously the same as collections.abc.Callable.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_Callable instead.
type-alias aveytense.extensions.CapsuleType

≥ 0.3.54

A backported equivalent to types.CapsuleType (Python 3.13+).
type-alias aveytense.extensions.CeilOperable

≥ 0.3.26b3

Equivalent to aveytense.extensions.Ceilable.
class aveytense.extensions.Ceilable[T_Covariant]

≥ 0.3.26b3

A runtime protocol class for classes that support the __ceil__() method. It is invoked as ceil(self) (see ceil() function).

The covariant type parameter indicates the return type for the __ceil__() method.
type-alias aveytense.extensions.CellType

≥ 0.3.54

Equivalent to types.CellType (Python 3.8+).
type-alias aveytense.extensions.ChainMap

≥ 0.3.37

A non-generic version of, and simultaneously the same as collections.ChainMap.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_ChainMap instead.
type-alias aveytense.extensions.ClassInfoType
type | UnionType | tuple[ClassInfoType, ...]

≥ 0.3.60

Equivalent to inaccessible type alias builtins._ClassInfo that is used in both isinstance() and issubclass(). For Python 3.9 and least the type value is type | tuple[ClassInfoType, ...] since types.UnionType was defined in Python 3.10.

There is a fun fact about this type alias. While in non-stub files type aliases cannot refer themselves during the first assignments, like stub type alias builtins._ClassInfo: type | UnionType | tuple[builtins._ClassInfo, ...], the code of aveytense.extensions.ClassInfoType actually tries to make it possible. The tuple type hinting may be just tuple instead of tuple[ClassInfoType, ...], but this will be correct when the type alias is printed in the output.

aveytense.extensions.ClassInfoType can be also secretly retrieved as an empty class via technique ClassInfoType.__args__[2].__args__[0].
class aveytense.extensions.ClassItemGetter

≥ 0.3.26rc3

A runtime protocol class for classes that support the __class_getitem__() method. It is invoked as cls[key].

The __class_getitem__() method should return an instance of types.GenericAlias.

This runtime protocol class is available only for Python 3.9+, for Python 3.8 it won't be defined.
type-alias aveytense.extensions.ClassMethodDescriptorType

≥ 0.3.51

Equivalent to types.ClassMethodDescriptorType (Python 3.7+).
type-alias aveytense.extensions.ClassVar

≥ 0.3.26b3

Equivalent to typing.ClassVar (Python 3.5.3+).
type-alias aveytense.extensions.ClosureVars

≥ 0.3.26rc3

A named tuple from the inspect library. Unofficial and will be removed in the future.
type-alias aveytense.extensions.CodeType

≥ 0.3.26rc3

Equivalent to types.CodeType.
type-alias aveytense.extensions.Collection

≥ <0.3.50

A non-generic version of, and simultaneously the same as collections.abc.Collection.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_Collection instead.
type-alias aveytense.extensions.ColorType
int | str | None

≥ 0.3.25

Used in aveytense.Color as a list of types supported in the class (excluding aveytense.RGB).
type-alias aveytense.extensions.ColourType

≥ 0.3.26b3

Equivalent to aveytense.extensions.ColorType.
class aveytense.extensions.Comparable

≥ 0.3.26b3

A runtime protocol class for classes supporting every comparison operation: <, >, <=, >=, ==, !=, in.

Methods included: __lt__(), __gt__(), __le__(), __ge__(), __eq__(), __ne__(), __contains__()
class aveytense.extensions.Comparable2

≥ 0.3.27a2

A runtime protocol class almost the same as aveytense.extensions.Comparable, except there is no __contains__() method. That means included methods are: __lt__(), __gt__(), __le__(), __ge__(), __eq__(), __ne__().

To 0.3.72 the class was called aveytense.extensions.ComparableWithoutIn.
class aveytense.extensions.ComplexConvertible

≥ 0.3.26rc1

A runtime protocol class for classes that support the __complex__() method. It is invoked as complex(self) (see complex class).
type-alias aveytense.extensions.ComplexUnion[T]
→ T | complex

≥ 0.3.26rc3

type-alias aveytense.extensions.Concatenate

≥ 0.3.26rc1

A backported special form typing.Concatenate (Python 3.10+).
type-alias aveytense.extensions.CutenessContainer

≥ <0.3.50

Needs no introduction :3 A non-generic version of, and simultaneously the same as collections.abc.Container.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_Container instead.
type-alias aveytense.extensions.ContextManager

≥ 0.3.53

A non-generic version of, and simultaneously the same as contextlib.AbstractContextManager.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_ContextManager instead.
class aveytense.extensions.Copyable

≥ 0.3.34

A runtime protocol class for classes that support the copy() method. For 0.3.43 to 0.3.60 that method was __copy__(), it was delegated to aveytense.extensions.Copyable2 instead.
class aveytense.extensions.Copyable2

≥ 0.3.60

A runtime protocol class for classes that support the __copy__() method. It is invoked with the copy.copy() function.
type-alias aveytense.extensions.Coroutine

≥ <0.3.50

collections.abc.Coroutine.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_Coroutine instead.
type-alias aveytense.extensions.CoroutineType

≥ 0.3.44

Equivalent to types.CoroutineType.
type-alias aveytense.extensions.CoroutineWrapperType

≥ 0.3.53

There is no single Python library that features this one interesting type. Retrieved via type(coroutine.__await__()).
type-alias aveytense.extensions.Counter

≥ <0.3.50

A non-generic version of, and simultaneously the same as collections.Counter.

To include subscription (especially when using Python 3.8), use aveytense.extensions.AVT_Counter instead.
type-alias aveytense.extensions.Decimal

≥ 0.3.60

Equivalent to decimal.Decimal.
type-alias aveytense.extensions.DecimalComparableType
Decimal | float | Rational

≥ 0.3.60

type-alias aveytense.extensions.DecimalNewType
Decimal | float | str | tuple[int, Sequence[int], int]

≥ 0.3.60

type-alias aveytense.extensions.DecimalType
Decimal | int

≥ 0.3.60

class aveytense.extensions.DeepCopyable

≥ 0.3.43

A runtime protocol class for classes that support the deepcopy() method. For 0.3.43 to 0.3.63 that method was __deepcopy__(), it was delegated to aveytense.extensions.DeepCopyable2 instead.
class aveytense.extensions.DeepCopyable2

≥ 0.3.63

A runtime protocol class for classes that support the __deepcopy__() method. It is invoked with the copy.deepcopy() function.
class aveytense.extensions.Deleter

≥ 0.3.44

A runtime protocol class for classes that support the __delete__() method. It is invoked when an attribute was deleted from an instance.
class aveytense.extensions.Descriptor

≥ 0.3.44

A runtime protocol class for classes that support the descriptor methods, those are: __get__(), __set__(), __delete__()
class aveytense.extensions.DictItems[Key_Covariant, Value_Covariant]

≥ 0.3.53

Returned from aveytense.Tense.getGeneric() as a non-stub generic equivalent to sort of inaccessible class dict_items.
class aveytense.extensions.DictKeys[Key_Covariant, Value_Covariant]

≥ 0.3.53

Returned from aveytense.Tense.getGeneric() as a non-stub generic equivalent to sort of inaccessible class dict_keys.
class aveytense.extensions.DictValues[Key_Covariant, Value_Covariant]

≥ 0.3.53

Returned from aveytense.Tense.getGeneric() as a non-stub generic equivalent to sort of inaccessible class dict_values.
class aveytense.extensions.DivmodOperable[T_Contravariant, T_Covariant]

≥ 0.3.26rc1

type-alias aveytense.extensions.Doc

≥ ?

type-alias aveytense.extensions.DynamicClassAttribute

≥ 0.3.43

Equivalent to types.DynamicClassAttribute
type-alias aveytense.extensions.EllipsisType

≥ ?

A backported equivalent to types.EllipsisType (Python 3.10+).
class aveytense.extensions.EnterOperable

≥ 0.3.26b3

type-alias aveytense.extensions.Enum

≥ 0.3.26rc1

type-alias aveytense.extensions.EnumCheck

≥ 0.3.26rc1?

type-alias aveytense.extensions.EnumDict

≥ 0.3.26rc1

type-alias aveytense.extensions.EnumMeta

≥ 0.3.26rc1?

type-alias aveytense.extensions.EnumType

≥ 0.3.26rc1?

class aveytense.extensions.EqualComparable

≥ 0.3.26rc1

A runtime protocol class for classes that support the __eq__() method. It is invoked as self == other. Normally all objects should offer this method.

__eq__() must return a boolean value.
type-alias aveytense.extensions.EvaluateFunc
→ (Format) -> AnnotationForm

≥ 0.3.59

A backported type alias from stub module _typeshed to be used also in non-stub Python files. Equivalent to _typeshed.EvaluateFunc (Python 3.14+).
class aveytense.extensions.ExitOperable

≥ 0.3.26b3

A runtime protocol class for classes that support the __exit__() method. It is invoked within the with block during exit.

__exit__() should return either True or throw an exception.
class aveytense.extensions.ExponentiationOperable

≥ 0.3.26rc1

A runtime protocol class for classes that support the __pow__() method. It is invoked as self ** other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __pow__() method.
class aveytense.extensions.ExponentiationReassignable

≥ 0.3.26rc1

A runtime protocol class for classes that support the __ipow__() method. It is invoked as self **= other.

The contravariant type parameter indicates the type for the other parameter, while the covariant type parameter indicates the return type for the __ipow__() method.
type-alias aveytense.extensions.Expression

≥ 0.3.44

Equivalent to ast.Expression
type-alias aveytense.extensions.FSPathProvider

≥ 0.3.27a3

Equivalent to aveytense.extensions.AVT_PathLike. Unofficial and may be removed in the future.
type-alias aveytense.extensions.FalseUnion[T]
→ T | Literal[False]

≥ 0.3.26rc3

Unofficial, may be removed in the future.
type-alias aveytense.extensions.FileBinaryMode
Literal[...]

≥ 0.3.59

Equivalent to aveytense.extensions.FileBinaryModeReading | aveytense.extensions.FileBinaryModeUpdating | aveytense.extensions.FileBinaryModeWriting
type-alias aveytense.extensions.FileBinaryModeReading
Literal["rb", "br", "rbU", "rUb", "Urb", "brU", "bUr", "Ubr"]

≥ 0.3.59

type-alias aveytense.extensions.FileBinaryModeUpdating
Literal["rb+", "r+b", "+rb", "br+", "b+r", "+br", "wb+", "w+b", "+wb", "bw+", "b+w", "+bw", "ab+", "a+b", "+ab", "ba+", "b+a", "+ba", "xb+", "x+b", "+xb", "bx+", "b+x", "+bx"]

≥ 0.3.59

type-alias aveytense.extensions.FileBinaryModeWriting
Literal["wb", "bw", "ab", "ba", "xb", "bx"]

≥ 0.3.59

type-alias aveytense.extensions.FileGenericPath
AnyStr | PathLike[AnyStr]

≥ 0.3.59

type-alias aveytense.extensions.FilePath
→ ...

≥ 0.3.59

type-alias aveytense.extensions.FileTextMode
Literal[...]

≥ 0.3.59

Equivalent to aveytense.extensions.FileTextModeReading | aveytense.extensions.FileTextModeUpdating | aveytense.extensions.FileTextModeWriting
type-alias aveytense.extensions.FileTextModeReading
→ ...

≥ 0.3.59

type-alias aveytense.extensions.FileTextModeUpdating
→ ...

≥ 0.3.59

type-alias aveytense.extensions.FileTextModeWriting
→ ...

≥ 0.3.59

type-alias aveytense.extensions.FileType
→ ...

≥ 0.3.59

aveytense.extensions.FilenoProvider

aveytense.extensions.Final

aveytense.extensions.FinalDescriptor

aveytense.extensions.Flag

aveytense.extensions.FlagBoundary

aveytense.extensions.FlagsType

aveytense.extensions.FloatConvertible

aveytense.extensions.FloatOrInteger

aveytense.extensions.FloatUnion

aveytense.extensions.FloorDivisionOperable

aveytense.extensions.FloorDivisionReassignable

aveytense.extensions.FloorOperable

aveytense.extensions.Floorable

aveytense.extensions.Flushable

aveytense.extensions.Format

aveytense.extensions.Formattable

aveytense.extensions.ForwardRef

aveytense.extensions.FrameInfo

aveytense.extensions.FrameType

aveytense.extensions.FullArgSpec

aveytense.extensions.FunctionType

aveytense.extensions.GenExprType

aveytense.extensions.Generator

aveytense.extensions.Generic

aveytense.extensions.GenericAlias

aveytense.extensions.Getter

aveytense.extensions.GreaterComparable

aveytense.extensions.GreaterEqualComparable

aveytense.extensions.Hash

aveytense.extensions.Hashable

aveytense.extensions.Hashxof

aveytense.extensions.HaveCodeType

aveytense.extensions.HexadecimalRepresentable

aveytense.extensions.Hmac

aveytense.extensions.IO

aveytense.extensions.InComparable

aveytense.extensions.Incomplete

aveytense.extensions.Indexable

aveytense.extensions.Indexed

aveytense.extensions.InequalComparable

aveytense.extensions.IntegerConvertible

aveytense.extensions.IntegerEnum

aveytense.extensions.IntegerFlag

aveytense.extensions.IntegerFloatUnion

aveytense.extensions.IntegerStringUnion

aveytense.extensions.IntegerUnion

aveytense.extensions.Interactive

aveytense.extensions.Interface

aveytense.extensions.Invertible

aveytense.extensions.ItemDeleter

aveytense.extensions.ItemGetter

aveytense.extensions.ItemManager

aveytense.extensions.ItemSetter

aveytense.extensions.ItemsProvider

aveytense.extensions.ItemsView

aveytense.extensions.Iterable

aveytense.extensions.Iterator

aveytense.extensions.KeysProvider

aveytense.extensions.KeysView

aveytense.extensions.LambdaType

aveytense.extensions.LeastComparable

aveytense.extensions.LeastEqualComparable

aveytense.extensions.LenGetItemOperable

aveytense.extensions.LenOperable

aveytense.extensions.LengthHintProvider

aveytense.extensions.ListConvertible

aveytense.extensions.Literal

aveytense.extensions.LiteralString

aveytense.extensions.Mapping

aveytense.extensions.MappingProxyType

aveytense.extensions.MappingView

aveytense.extensions.Match

aveytense.extensions.MatrixMultiplicationOperable

aveytense.extensions.MatrixMultiplicationReassignable

aveytense.extensions.MaybeNone

aveytense.extensions.MemoryViewBooleanFormats

aveytense.extensions.MemoryViewBytesFormats

aveytense.extensions.MemoryViewFloatFormats

aveytense.extensions.MemoryViewIntegerFormats

aveytense.extensions.MethodDescriptorType

aveytense.extensions.MethodType

aveytense.extensions.MethodWrapperType

aveytense.extensions.Module

aveytense.extensions.ModuleType

aveytense.extensions.ModuloOperable

aveytense.extensions.ModuloReassignable

aveytense.extensions.MultiplicationOperable

aveytense.extensions.MultiplicationReassignable

aveytense.extensions.MutableMapping

aveytense.extensions.MutableSequence

aveytense.extensions.MutableUniqual

aveytense.extensions.NamedTuple

aveytense.extensions.Negative

aveytense.extensions.Never

aveytense.extensions.NewArgumentsGetter

aveytense.extensions.NewType

aveytense.extensions.NextOperable

aveytense.extensions.NoDefault

aveytense.extensions.NoExtraItems

aveytense.extensions.NoReturn

aveytense.extensions.NoneType

aveytense.extensions.NotCallable

aveytense.extensions.NotComparable

aveytense.extensions.NotImplementedType

aveytense.extensions.NotIterable

aveytense.extensions.NotReassignable

aveytense.extensions.NotRequired

aveytense.extensions.NotUnaryOperable

aveytense.extensions.OctalRepresentable

aveytense.extensions.OperatorCollection

aveytense.extensions.Optional

aveytense.extensions.OptionalCallable

aveytense.extensions.OrderedDict

aveytense.extensions.Pack

aveytense.extensions.ParamSpec

aveytense.extensions.ParamSpecArgs

aveytense.extensions.ParamSpecKwargs

aveytense.extensions.Parameter

aveytense.extensions.PathLike

aveytense.extensions.Pattern

aveytense.extensions.PatternType

aveytense.extensions.Positive

aveytense.extensions.Protocol

aveytense.extensions.ReadOnly

aveytense.extensions.ReadOnlyBuffer

aveytense.extensions.Readable

aveytense.extensions.ReadableBuffer

aveytense.extensions.Reader

aveytense.extensions.ReckonOperable

aveytense.extensions.ReflectedAdditionOperable

aveytense.extensions.ReflectedArithmeticOperable

aveytense.extensions.ReflectedDivmodOperable

aveytense.extensions.ReflectedExponentiationOperable

aveytense.extensions.ReflectedFloorDivisionOperable

aveytense.extensions.ReflectedMatrixMultiplicationOperable

aveytense.extensions.ReflectedModuloOperable

aveytense.extensions.ReflectedMultiplicationOperable

aveytense.extensions.ReflectedSubtractionOperable

aveytense.extensions.ReflectedTrueDivisionOperable

aveytense.extensions.RegexFlag

aveytense.extensions.ReprEnum

aveytense.extensions.Representable

aveytense.extensions.Required

aveytense.extensions.Reversible

aveytense.extensions.RichComparable

aveytense.extensions.RoundOperable

aveytense.extensions.Roundable

aveytense.extensions.SafeUUID

aveytense.extensions.Self

aveytense.extensions.Sequence

type-alias aveytense.extensions.SequenceLike[T]
Sequence[T] | AbstractSet[T] | ValuesView[T]

≥ 0.3.54

A generic type alias allowing to hint support for sequence-like objects. Before 0.3.69, this type was called aveytense.extensions.TrueSequence.

Because this type is generic and hence should be used only in type hinting, it shouldn't be used in the isinstance() function invocations.

The intention of this type alias is hinting support for not only objects of classes inheriting from collections.abc.Sequence or collections.abc.AbstractSet ABCs, but also for mapping view objects. Mapping objects aren't considered sequence-like objects due to their structure with pairs, while consecutive integer indexes are preferred in this case (mapping objects do not need to follow index incrementation by 1 per item).

For example, the following inbuilt definitions would satisfy the type requirement: list, tuple, set, str, bytes, bytearray, memoryview, range, filter, map, zip, dict.keys(), dict.values(), dict.items()

Originally, collections.abc.ValuesView wasn't included in this type alias, meaning the value was just restricted to Sequence | AbstractSet.

collections.abc.KeysView and collections.abc.ItemsView aren't included, because both are subclasses of AbstractSet; it was concluded in 0.3.66 with the aveytense.Tense.pick() class method, when mapping view objects were tested on this class method.

There were thoughts to replace collections.abc.ValuesView with collections.abc.Collection, but this ABC is a base class for collections.abc.Mapping, thereupon this idea was rejected.
aveytense.extensions.SetConvertible

aveytense.extensions.Setter

aveytense.extensions.Signature

aveytense.extensions.SimpleNamespace

aveytense.extensions.Sizeable

aveytense.extensions.SizeableItemGetter

aveytense.extensions.Sized

aveytense.extensions.SpecialForm

aveytense.extensions.StringConvertible

aveytense.extensions.StringEnum

aveytense.extensions.StringUnion

aveytense.extensions.SubclassHooker

aveytense.extensions.SubtractionOperable

aveytense.extensions.SubtractionReassignable

aveytense.extensions.TYPE_CHECKING

aveytense.extensions.Text

aveytense.extensions.TextIO

class aveytense.extensions.TimeClockInfo

≥ 0.3.71

A runtime protocol class for classes that support the following attributes (equivalent to stub protocol class time._ClockInfo):

  • adjustable (boolean)
  • implementation (string)
  • monotonic (boolean)
  • resolution (float)

Typically this is a result from time.get_clock_info(). Before 0.3.72, it was called DatetimeClockInfo.
type-alias aveytense.extensions.TimeTable
→ ...

≥ 0.3.70

aveytense.extensions.Traceback

aveytense.extensions.TracebackType

aveytense.extensions.TrueDivisionOperable

aveytense.extensions.TrueDivisionReassingable

aveytense.extensions.TrueUnion

aveytense.extensions.Truncable

aveytense.extensions.TupleConvertible

aveytense.extensions.TypeAlias

aveytense.extensions.TypeAliasType

aveytense.extensions.TypeGuard

aveytense.extensions.TypeIs

aveytense.extensions.TypeVar

aveytense.extensions.TypeVarTuple

aveytense.extensions.TypedDict

aveytense.extensions.TypingAnnotatedType

aveytense.extensions.TypingCallableType

aveytense.extensions.TypingConcatenateType

aveytense.extensions.TypingExtensionsVersionInfo

aveytense.extensions.TypingGenericType

aveytense.extensions.TypingLiteralType

aveytense.extensions.TypingNoDefaultType

aveytense.extensions.TypingSpecialGenericType

aveytense.extensions.TypingTupleType

aveytense.extensions.TypingUnionType

aveytense.extensions.TypingUnpackType

aveytense.extensions.UUID

aveytense.extensions.UnaryOperable

aveytense.extensions.Union

aveytense.extensions.UnionType

aveytense.extensions.Uniqual

aveytense.extensions.Unpack

aveytense.extensions.Unused

aveytense.extensions.UserDict

aveytense.extensions.UserList

aveytense.extensions.UserString

aveytense.extensions.Uuid

aveytense.extensions.VERSION

aveytense.extensions.ValuesView

aveytense.extensions.WrapperDescriptorType

aveytense.extensions.Writable

aveytense.extensions.WriteableBuffer

aveytense.extensions.Writer

aveytense.extensions.abstractmethod

aveytense.extensions.accumulate

aveytense.extensions.aiter

aveytense.extensions.anext

aveytense.extensions.array

aveytense.extensions.assertNever

aveytense.extensions.assertType

aveytense.extensions.assert_never

aveytense.extensions.assert_type

aveytense.extensions.batched

aveytense.extensions.bt_removeprefix

aveytense.extensions.bt_removesuffix

aveytense.extensions.cached_property

aveytense.extensions.cachedproperty

aveytense.extensions.cast

aveytense.extensions.chain

aveytense.extensions.clearOverloads

aveytense.extensions.clear_overloads

aveytense.extensions.combinations

aveytense.extensions.combinations_with_replacement

aveytense.extensions.compress

aveytense.extensions.coroutine

aveytense.extensions.count

aveytense.extensions.cycle

aveytense.extensions.dataclass

aveytense.extensions.dataclassTransform

aveytense.extensions.dataclass_transform

aveytense.extensions.defaultdict

aveytense.extensions.deprecated

aveytense.extensions.deque

aveytense.extensions.disjoint_base

aveytense.extensions.dropwhile

aveytense.extensions.eval

aveytense.extensions.evaluateForwardRef

aveytense.extensions.evaluate_forward_ref

aveytense.extensions.exec

aveytense.extensions.filterfalse

aveytense.extensions.final

aveytense.extensions.getAnnotations

aveytense.extensions.getArgs

aveytense.extensions.getOrigin

aveytense.extensions.getOriginalBases

aveytense.extensions.getOverloads

aveytense.extensions.getProtocolMembers

aveytense.extensions.getTypeHints

aveytense.extensions.get_annotations

aveytense.extensions.get_args

aveytense.extensions.get_origin

aveytense.extensions.get_original_bases

aveytense.extensions.get_overloads

aveytense.extensions.get_protocol_members

aveytense.extensions.get_type_hints

aveytense.extensions.groupby

aveytense.extensions.importModule

aveytense.extensions.import_module

aveytense.extensions.int_bit_count

aveytense.extensions.int_from_bytes

aveytense.extensions.int_to_bytes

aveytense.extensions.isProtocol

aveytense.extensions.isTypedDict

aveytense.extensions.is_protocol

aveytense.extensions.is_typeddict

aveytense.extensions.islice

aveytense.extensions.lruCache

aveytense.extensions.lru_cache

aveytense.extensions.namedtuple

aveytense.extensions.newClass

aveytense.extensions.new_class

aveytense.extensions.noTypeCheck

aveytense.extensions.noTypeCheckDecorator

aveytense.extensions.no_type_check

aveytense.extensions.no_type_check_decorator

aveytense.extensions.overload

aveytense.extensions.override

aveytense.extensions.pairwise

aveytense.extensions.partial

aveytense.extensions.partialmethod

aveytense.extensions.permutations

aveytense.extensions.prepareClass

aveytense.extensions.prepare_class

aveytense.extensions.product

aveytense.extensions.repeat

aveytense.extensions.resolveBases

aveytense.extensions.resolve_bases

aveytense.extensions.revealType

aveytense.extensions.reveal_type

aveytense.extensions.runtime

aveytense.extensions.runtime_checkable

aveytense.extensions.singleDispatch

aveytense.extensions.singledispatch

aveytense.extensions.singledispatchmethod

aveytense.extensions.starmap

aveytense.extensions.str_removeprefix

aveytense.extensions.str_removesuffix

aveytense.extensions.str_replace

aveytense.extensions.takewhile

aveytense.extensions.tee

aveytense.extensions.verify

aveytense.extensions.zip_longest

aveytense.operators module
aveytense.util module

Removed definitions

This section is dedicated for removed definitions. These definitions shouldn't be used further.

Navigation

aveytense module
module aveytense.games

≥ 0.3.31; < 0.3.47

Invention from aveytense.Tense08Leapers, removed in favor of more serious coding of the project.

See also removed definitions of aveytense.games here.

0.3.47
module aveytense.primary

≥ 0.3.27a3; < 0.3.73

It had more definitions than operator library.

0.3.73
module aveytense.primary

≥ 0.3.24; < 0.3.26rc3

The module where abroad() and reckon() functions were defined in early versions of AveyTense after mass rewrite back in versions 0.3.24 and 0.3.25.

Today this module exists as an internal module that shouldn't be imported, and that module not only has abroad() and reckon() functions, but also classes Math and Time. All of these can be simply imported with aveytense module, like aveytense.Math or aveytense.abroad().

0.3.26rc3
module aveytense.tcs

≥ 0.3.25?; < 0.3.26rc3

Container of constants and types (tcs = types and constants), removed after slicing the module into 2 different ones: aveytense.constants and aveytense.types_collection, currently named aveytense.extensions.

0.3.57
module aveytense.types

≥ 0.3.27a4; < 0.3.57

The last ancestor of aveytense.extensions. Previously called aveytense.types_collection (before 0.3.52) after the division of the module aveytense.tcs.

0.3.57
aveytense.Color.__pos__()
aveytense.Color.__neg__()
aveytense.Color.__invert__()
str

≥ 0.3.26rc1; < 0.3.48

Equivalents to the current method aveytense.Color.__str__().

0.3.47

0.3.48
aveytense.Color.setUnderlineColor(color, /)
Self

≥ 0.3.26rc1; < 0.3.27

Had to colorize the underline.

0.3.27
class aveytense.FencordOptions

≥ 0.3.27b1; < 0.3.40

Fencord was Aveyzan's discord.py PyPi project extension, it has been discontinued, but may return someday under separate PyPi project aveytense.fencord or fencord.

The class had only one attribute, initializationMessage (since 0.3.27b1; bool).

0.3.40
class aveytense.NennaiAbroads
class aveytense.NennɅIAbroads
class aveytense.Tense08NennɅIAbroads

≥ 0.3.19; < 0.3.34

The class provided extensions for the aveytense.abroad() function. It was defined as tense08.Tense08NennɅIAbroads, it was likely renamed to tense.NennɅIAbroads in 0.3.24, and renamed to tense.NennaiAbroads in 0.3.26rc3.

The class was removed in 0.3.34, and likely all of the class methods there were moved to aveytense.Tense class instead.

0.3.34
class aveytense.NennaiRandomize
class aveytense.NennɅIRandomize
class aveytense.Tense08NennɅIRandomize

≥ 0.3.19?; < 0.3.34

The class provided class methods for pseudo-random results.

The class was removed in 0.3.34, and likely all of the class methods there were moved to aveytense.Tense class instead.

0.3.34
class aveytense.NennaiStringz
class aveytense.NennɅIStringz
class aveytense.Tense08NennɅIStringz

≥ 0.3.19?; < 0.3.34

?

0.3.34
aveytense.Tense.abroadBinary(value1, /, value2 = None, modifier = None, include_0b = True)
list[str]

≥ 0.3.25; < 0.3.71

Same as [bin(x) for x in abroad(value1, value2, modifier)]. Parameter include_0b (expects boolean value) indicated whether all binary numbers should be returned with the 0b prefix. This allowed easier conversion to integers in this case. It had default value True.

0.3.71: Instead use aveytense.Tense.bin(+abroad(value1, value2, modifier)) (see aveytense.Tense.bin() and aveytense.<abroad_object>.__pos__())
aveytense.Tense.abroadExclude(value1, /, value2 = None, modifier = None, *excludedIntegers)
→ <abroad object>

≥ 0.3.25; < 0.3.71

Variation of abroad() function that excludes desired integers in parameter excludedIntegers.

Before 0.3.34, this class method was defined in the aveytense.NennaiAbroads class with the same name.

0.3.71: Instead use aveytense.Tense.exclude(+abroad(value1, value2, modifier), *excludedIntegers).
aveytense.Tense.abroadFloaty(value1, /, value2 = None, modifier = None, div = 10)
list[float]

≥ 0.3.25; < 0.3.71

Variation of abroad() function, which divides every integer by div.
Roughly equal to aveytense.Tense.abroadEach(value1, value2, modifier, each = lambda x: x / div).

Before 0.3.34, this class method was defined in the aveytense.NennaiAbroads class with the same name.

0.3.71
aveytense.Tense.abroadHex(value1, /, value2 = None, modifier = None, include_0x = ABROAD_HEX_INCLUDE)
list[str]

≥ 0.3.25; < 0.3.71

Variation of abroad() function, which returns every integer in hexadecimal format as strings.

Before 0.3.34, this class method was defined in the aveytense.NennaiAbroads class with the same name.

0.3.71: Instead use aveytense.Tense.hex(+abroad(value1, value2, modifier)).
aveytense.Tense.abroadImmutable(value1, /, value2 = None, modifier = None)
tuple[int, ...]

≥ 0.3.25; < 0.3.34

Equivalent to tuple(abroad(value1, value2, modifier)). This class method was removed in favor of the unary minus notation -abroad(value1, value2, modifier).

0.3.34
aveytense.Tense.abroadLive(*values)
list[int]

≥ 0.3.25; < 0.3.60

Former class method for statistics category; every value passed in parameter values was subsequent endpoint

0.3.50

0.3.60
aveytense.Tense.abroadOctal(value1, /, value2 = None, modifier = None)
→ <abroad object>

≥ 0.3.24; < 0.3.71

Variation of abroad() function, which returns every integer in octal notation.

Before 0.3.34, this class method was defined in the aveytense.NennaiAbroads class with the same name.

0.3.71: Instead of aveytense.Tense.oct(+abroad(value1, value2, modifier)).
aveytense.Tense.abroadVivid(*values)
list[list[int]]

≥ 0.3.25; < 0.3.60

Was used to form multiple abroad objects in a duo-dimensional list. values were supposed to be abroad objects.

0.3.50

0.3.60
aveytense.Tense.bisect(a, x, /, l = 0, h = None, dir = BISECT_RIGHT, *, key = None)
int

≥ 0.3.26rc2; < 0.3.60

Equivalent to bisect.bisect().

0.3.60
aveytense.Tense.count(start = 0, step = 1)
count

≥ 0.3.34; < 0.3.55

Equivalent to itertools.count. Removed in favor of aveytense.extensions.count that is directly imported from itertools library.

0.3.55
aveytense.Tense.cycle(i, /)
cycle

≥ 0.3.34; < 0.3.55

Equivalent to itertools.cycle. Removed in favor of aveytense.extensions.cycle that is directly imported from itertools library.

0.3.55
aveytense.Tense.error(handler, message)
NoReturn

≥ 0.3.24; < 0.3.31

Was used to throw an error

0.3.25

0.3.31
aveytense.Tense.groupby(i, /, key = None)
groupby

≥ 0.3.34; < 0.3.55

Equivalent to itertools.groupby. Removed in favor of aveytense.extensions.groupby that is directly imported from itertools library.

0.3.55
aveytense.Tense.insort(a, x, /, l = 0, h = None, dir = INSORT_RIGHT, *, key = None)
None

≥ 0.3.26rc2; < 0.3.60

Equivalent to bisect.insort().

0.3.60
aveytense.Tense.repeat(v, /, times = None)
repeat

≥ 0.3.25; < 0.3.55

Equivalent to itertools.repeat. Removed in favor of aveytense.extensions.repeat that is directly imported from itertools library.

0.3.55
aveytense.Tense.socket(family = AF_INET, type = SOCK_STREAM, proto = 0, fileno = None)
socket

≥ 0.3.27a2; < 0.3.55

Equivalent to socket.socket.

0.3.55
aveytense.Tense.starmap(i, f, /)
starmap

≥ 0.3.35; < 0.3.55

Equivalent to itertools.starmap. Removed in favor of aveytense.extensions.starmap that is directly imported from itertools library.

0.3.55
aveytense.Tense.upgrade(aveytense = True)
→ None

≥ 0.3.36; < 0.3.48

Roughly equivalent to invoking pip install --upgrade <project>

0.3.46

0.3.48
aveytense.Tense.versionId
int

≥ 0.3.26?; < 0.3.36

This attribute returned integer value being an identifier of current version, counted via length of removed constant aveytense.constants.VERSION_LIST minus 1. This was helper constant along with aveytense.constants.VERSION_INFO; easier to inspect with if statements. For 0.3.34 it returned 70.

More accurate formula was amount of versions in 0.2.x and 0.3.x.

  • 0.2.x contained versions from 0.2.1 to 0.2.16, from all of them being final releases (16)
  • 0.3.x contained versions from 0.3.0 - 0.3.25 from all of them being final releases (26), with 0.3.26 and 0.3.27 both having 10 non-final releases (22), the rest (0.3.28 - 0.3.36) were final (9)

For 0.3.66 this attribute would return 102.

0.3.35

0.3.36
class aveytense.Tense08

≥ 0.2.16/0.3.0; < 0.3.24

The main ancestor of the class aveytense.Tense. It was defined in the module tense08.

The class was renamed in 0.3.24 to Tense, with lots of its attributes and methods removed, during the project's renovation.

0.3.24
class aveytense.Tense08AbroadRadex

≥ 0.3.12; < 0.3.24

The helper class for the aveytense.abroad() function

The class was removed in 0.3.24, during the project's renovation.

0.3.24
class aveytense.Tense08ComplexString

≥ 0.3.9; < 0.3.24

Meant to provide better str.replace() alternative, with methods prefixed with the word sanitize. The class was defined in module tense08, and it was one of the 2 base classes for class aveytense.Tense08.

The class methods with the word sanitize aimed to not use str.replace() method overall, in favor of self-implementation of it. The idea has been abandoned, and the class was removed in 0.3.24, during the project's renovation.

0.3.24
class aveytense.Tense08Leapers

≥ 0.3.9; < 0.3.24

The secondary ancestor of the class aveytense.Tense made for entertainment purposes mainly. It was the class where experiments on the function aveytense.abroad() (it was called pli() first) went since 0.3.9. The class was defined in module tense08, and it was one of the 2 base classes for class aveytense.Tense08.

It is said that the Tense08Leapers class started the gaming bit that existed in the project until 0.3.47 that might be also in operation as aveytense.games separate PyPi project, but there are no reassures. The gaming section of the project is currently an abandoned topic.

The class was removed in 0.3.24, during the project's renovation.

0.3.24
type-alias aveytense.Tense08String
str

≥ 0.3.7; < 0.3.24

Type alias for str

This type alias was removed in 0.3.24, during the project's renovation. Also, this type alias had decreased readability.

0.3.24
type-alias aveytense.Tense08TickTockBoard
list[list[str]]

≥ 0.3.6; < 0.3.24

Type alias for 2-level string list, representing the tic-tac-toe board for the game for version 0.3.6.

This type alias was removed in 0.3.24, during the project's renovation.

0.3.24
type-alias aveytense.Tense08TkAnchor
Literal["nw", "n", "ne", "w", "center", "e", "sw", "s", "se"]

≥ 0.3.7; < 0.3.24

Type alias referred from the tkinter library's anchor parameter..

This type alias was removed in 0.3.24, during the project's renovation and receding from Tkinter technology.

0.3.24
type-alias aveytense.Tense08TkButtonCommand
str | (() -> Any)

≥ 0.3.7; < 0.3.24

Type alias referred from the tkinter library's command parameter.

This type alias was removed in 0.3.24, during the project's renovation and receding from Tkinter technology.

0.3.24
type-alias aveytense.Tense08TkCompound
Literal["top", "left", "center", "right", "bottom", "none"]

≥ 0.3.7; < 0.3.24

Type alias referred from the tkinter library's compound parameter..

This type alias was removed in 0.3.24, during the project's renovation and receding from Tkinter technology.

0.3.24
type-alias aveytense.Tense08TkRelief
Literal["raised", "sunken", "flat", "ridge", "solid", "groove"]

≥ 0.3.7; < 0.3.24

Type alias referred from the tkinter library's relief parameter..

This type alias was removed in 0.3.24, during the project's renovation and receding from Tkinter technology.

0.3.24
type-alias aveytense.Tense08TkTakeFocusCallback
((str) -> bool | None)

≥ 0.3.7; < 0.3.24

Type alias referred from the tkinter library's takefocus parameter (callback type hint).

This type alias was removed in 0.3.24, during the project's renovation and receding from Tkinter technology.

0.3.24
class aveytense.Tense08TypeAndArrayOfType

≥ 0.3.19; < 0.3.24

This class only had the purpose to return an union type of the following form: T | list[T] | tuple[T] (where T is TypeVar instance), with its constructor. However, this didn't work as intended.

This type alias was removed in 0.3.24, during the project's renovation.

0.3.24
class aveytense.TenseOptions

≥ 0.3.26rc1; < 0.3.60

This abstract and final class was a container of attributes that were able to hold boolean values only, allowing to manipulate with certain definitions in class aveytense.Tense.

  • disableProbability2LengthLimit
    > 0.3.31; < 0.3.46

    This attribute was applied to aveytense.Tense.probability2() class method (which was also used by aveytense.Tense.probability() when only 2 values were passed) to ignore the limit of sys.maxsize. On 0.3.46 found the technique to allow higher integer values than sys.maxsize (earlier, it was relying on a list, hence the restriction from sys.maxsize), and this attribute was removed in the result. It had default value False.

    0.3.46

  • initializationMessage
    > 0.3.27a5; < 0.3.40

    This attribute was applied to the constructor of aveytense.Tense, allowing to emit a message in the output that a new class instance has been created. This behavior can be re-created using the aveytense.Color class. It had default value False. The format was based on the discord.py PyPi project output.

    0.3.40

  • insertionMessage
    > 0.3.27b1; < 0.3.60

    This attribute was applied to aveytense.Tense.print() class method in order to modify the output with theme similar to discord.py PyPi project. Primarily used to override the invokeAs parameter before it was removed from the method in 0.3.41. This attribute was removed along with its parent class; this behavior can be re-created using the aveytense.Color class. It had default value False.

    0.3.50

    0.3.60

  • probabilityExtendedLength
    in code since 0.3.27rc1 to 0.3.60

    This attribute had to apply to aveytense.Tense.probability() class method as an attempt to bypass sys.maxsize limit with a nested list. Marked unrealized due to change in probability class methods in aveytense.Tense class in 0.3.46.

0.3.50

0.3.60
class aveytense.TenseVar

≥ 0.3.25; < 0.3.25?

0.3.25 (likely, unconfirmed)
aveytense.extensions module
class aveytense.extensions.ANSIColor

≥ 0.3.24; < 0.3.26rc1

Ancestor of the current class aveytense.Color.

0.3.26rc1
type-alias aveytense.extensions.DatetimeStructTime
→ datetime.struct_time

≥ 0.3.70; < 0.3.72

0.3.72
aveytense.games module
aveytense.games.owoify(s, /)
aveytense.games.uwuify(s, /)
str

≥ 0.3.9; < 0.3.24; ≥ 0.3.25; < 0.3.47 / ≥ 0.3.27b2; < 0.3.47

(Shush >:3 This property doesn't belong to you!! I swear if someone was able to ask HOW MANY REGULAR EXPRESSIONS WERE USED HERE!!! AHHH! Oh, look! You can use this function actually!! Of course I am lying because... welp... silliness. NO MORE COMMENTARY, ENJOY BROWSING!! :3 falls asleep)

A joke function, which translated a string into a furry talk. It based on the FurryTalk translator.

0.3.47: To be used in separate project aveytense.furrylands (primarily aveytense_games).
aveytense.util module
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(aveytense.util.Abstract, enum.Enum): ... will not work as intended - it will cause subclass conflict. Instead consider using enum.Enum.

0.3.50

outdated article below

aveytense.constants
≥ 0.3.26rc3

aveytense.exceptions
≥ 0.3.44

Provides custom exception classes. Previously, this module was private (aveytense._exceptions), since 0.3.44 it is public.
aveytense.extensions
≥ 0.3.24; < 0.3.26rc1; ≥ 0.3.57

Extensions of AveyTense. It contains types and other definitions in majority adjusted for every Python version supported by the project. Also, the code of this module inspects currently used version of PyPi project typing_extensions, so there won't be any import errors impacting the project.

It was the module where tests on ANSIColor occurred, before class aveytense.Color replaced that class utterly on 0.3.26rc1. On 0.3.57, module has been reinstated by renaming from aveytense.types.

Definitions derive mostly from the 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.
aveytense.games
≥ 0.3.31; < 0.3.47

Module for entertainment. Most declarations were affiliated with class Games that was featured in this submodule. Removed to be in separate, projected PyPi project aveytense_games.
aveytense.operators
≥ 0.3.27a3

Little extension of operator Python standard library, enhancing definitions with CamelCase names.
aveytense.primary
≥ 0.3.24; < 0.3.26rc3

The module where abroad() and reckon() functions were defined in early versions of AveyTense after mass rewrite back in versions 0.3.24 and 0.3.25.

Today this module exists as an internal module that shouldn't be imported, and that module not only has abroad() and reckon() functions, but also classes Math and Time. All of these can be simply imported with aveytense module, like aveytense.Math or aveytense.abroad().
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 (currently as aveytense.extensions).
aveytense.types (≥ 0.3.27a4; < 0.3.57)
See aveytense.extensions

0.3.52: Renamed from aveytense.types_collection to current name.

0.3.57: Renamed to aveytense.extensions.

0.3.57
aveytense.util
≥ 0.3.34

Contains utility classes to create abstract, final and frozen classes, abstract and final methods, as well as final variables. This module also provides class ParamVar for callable objects' signatureintrospection

Available definitions

Constants

Most constants since 0.3.35 are located in submodule aveytense.constants.
aveytense.constants.INT8_MIN
aveytense.constants.INT8_MAX
aveytense.constants.INT16_MIN
aveytense.constants.INT16_MAX
aveytense.constants.INT32_MIN
aveytense.constants.INT32_MAX
aveytense.constants.INT64_MIN
aveytense.constants.INT64_MAX
aveytense.constants.INT128_MIN
aveytense.constants.INT128_MAX
aveytense.constants.INT256_MIN
aveytense.constants.INT256_MAX
aveytense.constants.INT512_MIN
aveytense.constants.INT512_MAX
aveytense.constants.INT1024_MIN
aveytense.constants.INT1024_MAX
aveytense.constants.INT2048_MIN
aveytense.constants.INT2048_MAX
aveytense.constants.INT4096_MIN
aveytense.constants.INT4096_MAX
aveytense.constants.INT8192_MIN
aveytense.constants.INT8192_MAX
aveytense.constants.SSIZE_MAX
int

≥ 0.3.57

aveytense.constants.JS_MAX_SAFE_INTEGER
int

≥ 0.3.26b3; < 0.3.53; ≥ 0.3.57

Returns the greatest safe integer in JavaScript, thats 253 - 1 or 9007199254740991. See also Number.MAX_SAFE_INTEGER. 0.3.50: this constant may occur as ~.Math.JS_MAX_SAFE_INTEGER rather than in current form.

0.3.53: Instead use aveytense.Math.JS_MAX_SAFE_INTEGER

0.3.57: Reinstated this constant in old form before 0.3.53 and removed it from class aveytense.Math.
aveytense.constants.JS_MAX_VALUE
int

≥ 0.3.26b3; < 0.3.53; ≥ 0.3.57

Returns the greatest number value that can be represented in JavaScript without value loss (21024 - 2971). If a numeric value is greater than this number, factual value is lost and coerced to Infinity.

Exact value of 21024 - 2971 is:

179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368

Approximate (10 digit precision): 1.7976931349e+308 (1.7976931349 ∙ 10308).

See also Number.MAX_VALUE. 0.3.50: this constant may occur as ~.Math.JS_MAX_VALUE rather than in current form.

0.3.53: Instead use aveytense.Math.JS_MAX_VALUE

0.3.57: Reinstated this constant in old form before 0.3.53 and removed it from class aveytense.Math.
aveytense.constants.JS_MIN_SAFE_INTEGER
int

≥ 0.3.26b3; < 0.3.53; ≥ 0.3.57

Returns the least safe integer in JavaScript, thats -(253 - 1) or -9007199254740991. See also Number.MIN_SAFE_INTEGER. 0.3.50: this constant may occur as ~.Math.JS_MIN_SAFE_INTEGER rather than in current form.

0.3.53: Instead use aveytense.Math.JS_MIN_SAFE_INTEGER

0.3.57: Reinstated this constant in old form before 0.3.53 and removed it from class aveytense.Math.
aveytense.constants.JS_MIN_VALUE
decimal.Decimal

≥ 0.3.26b3; < 0.3.53; ≥ 0.3.57

Returns the smallest number value that can be represented in JavaScript without value loss (2-1074). If a numeric value is least than this number, factual value is lost and coerced to 0.

Exact value of 2-1074 is:

4.940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625e-324

Approximate (10 digit precision): 4.9406564584e-324 (4.9406564584 ∙ 10-324).

See also Number.MIN_VALUE. JavaScript will start using scientific notation with dozen digit precision when there are at least 6 zeros leading fractional part of the numeric value. Precision starts being truncated when going for 2-1025 or least, ultimately leading to one digit precision.

2-1074 is evaluated to 5e-324 in JavaScript, so will it normally in Python, if this constant wasn't an object of decimal.Decimal.

0.3.50: this constant may occur as ~.Math.JS_MIN_VALUE rather than in current form.

0.3.53: Instead use aveytense.Math.JS_MIN_VALUE

0.3.57: Reinstated this constant in old form before 0.3.53 and removed it from class aveytense.Math, but this time the constant is an instance of decimal.Decimal (instead of float) due to its value rounding to 5e-324, as in JavaScript.
aveytense.constants.MC_DURABILITY
→ <dict-like object>

≥ 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 used in separate project aveytense_games. 0.3.41
aveytense.constants.MC_ENCHANTS
int

≥ 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 used in separate project aveytense_games. 0.3.41
aveytense.constants.MODE_AND
→ <enumerator>

≥ 0.3.36

Equivalent to aveytense.Tense.AND
aveytense.constants.MODE_OR
→ <enumerator>

≥ 0.3.36

Equivalent to aveytense.Tense.OR
aveytense.constants.RGB_MIN
int

≥ 0.3.37

Represents minimal possible value in RGB color picker, there 0
aveytense.constants.RGB_MAX
int

≥ 0.3.37

Represents maximal possible value in RGB color picker, there 224 - 1 or 16777215
aveytense.constants.SMASH_HIT_CHECKPOINTS
int

≥ 0.3.26b3; < 0.3.47

Returns 13 (Smash Hit has 12 checkpoints + 1 endless). 0.3.47: To be used in separate project aveytense_games.
aveytense.constants.STRING_BINARY
str

≥ 0.3.36

Returns 0-1 in a string.
aveytense.constants.STRING_DIGITS
str

≥ 0.3.36

Returns 0-9 in a string.
aveytense.constants.STRING_HEXADECIMAL
str

≥ 0.3.36

Returns 0-9a-fA-F in a string.
aveytense.constants.STRING_LETTERS
str

≥ 0.3.36

Returns a-zA-Z in a string.
aveytense.constants.STRING_LOWER
str

≥ 0.3.36

Returns a-z in a string.
aveytense.constants.STRING_OCTAL
str

≥ 0.3.36

Returns 0-7 in a string.
aveytense.constants.STRING_SPECIAL
str

≥ 0.3.36

Returns all ASCII characters (excluding code ones) not being a letter nor digit, in a string.
aveytense.constants.STRING_UPPER
str

≥ 0.3.36

Returns A-Z in a string.
aveytense.constants.UINT8_MIN
aveytense.constants.UINT8_MAX
aveytense.constants.UINT16_MIN
aveytense.constants.UINT16_MAX
aveytense.constants.UINT32_MIN
aveytense.constants.UINT32_MAX
aveytense.constants.UINT64_MIN
aveytense.constants.UINT64_MAX
aveytense.constants.UINT128_MIN
aveytense.constants.UINT128_MAX
aveytense.constants.UINT256_MIN
aveytense.constants.UINT256_MAX
aveytense.constants.UINT512_MIN
aveytense.constants.UINT512_MAX
aveytense.constants.UINT1024_MIN
aveytense.constants.UINT1024_MAX
aveytense.constants.UINT2048_MIN
aveytense.constants.UINT2048_MAX
aveytense.constants.UINT4096_MIN
aveytense.constants.UINT4096_MAX
aveytense.constants.UINT8192_MIN
aveytense.constants.UINT8192_MAX
aveytense.constants.SIZE_MAX
int

≥ 0.3.57

Unsigned integer constants borrowed from C/C++.

For constants with deducing minimal values 0 is always returned, for maximal - result from formula 2bits - 1. Exception is SIZE_MAX: 232 - 1 for systems with 32-bit architecture and 264 - 1 for systems with 64-bit architecture (same as sys.maxsize)
aveytense.constants.VERSION
str

≥ 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.47: Instead use aveytense.Tense.version.
aveytense.constants.VERSION_ID
int

≥ 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
tuple[str, ...]

≥ 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
→ <version info object>

≥ 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.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.
aveytense.constants.VERSION_INFO_TYPE
= <type(aveytense.constants.VERSION_INFO)

≥ 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)

Content of aveytense.Tense

class aveytense.Tense
≥ 0.3.24

Heart of AveyTense project. Contains many methods, including for math, time, checking types and utility. It was called Tense08 before code reconstruction in 0.3.24.

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).

aveytense.Tense.abroadImmutable(value1, /, value2 = None, modifier = None)
tuple[int, ...]

≥ 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.abroadLive(*values)
→ ?

≥ 0.3.25; < 0.3.60

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

0.3.60
aveytense.Tense.abroadVivid(*values)
list[list[int]]

≥ 0.3.25; < 0.3.60

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

0.3.60
aveytense.Tense.all(i, /, condition = ...)
bool

≥ 0.3.26rc2

Roughly the same as 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 = ...)
bool

≥ 0.3.26rc2

Roughly the same as 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)
list | dict | Generator | AsyncGenerator

≥ 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

0.3.55a1: Added support for asynchronous generators, and if first argument was a generator, then a generator is returned (earlier, generators returned a list).
aveytense.Tense.asyncGenerator(i: Iterable[T], /, condition: ((T) -> bool) = ...)
AsyncGenerator[T, Any]
aveytense.Tense.asyncGenerator(i, /, condition = ...)
AsyncGenerator

≥ 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)
int

≥ 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.61
≥ 0.3.35; < 0.3.61
Invokes bisect.bisect_left().
~.Tense.BISECT_RIGHT /
~.constants.BISECT_RIGHT
≥ 0.3.26rc2; < 0.3.61
≥ 0.3.35; < 0.3.61
Invokes bisect.bisect_right().

0.3.60
aveytense.Tense.cast(v, t, /)
= ("v" of type "t")

≥ 0.3.36

Same as typing.cast(), just parameters being in inverted places.

Passed value remains unchanged; this class method should be used to correct type hints. from import from typing import cast abhello! cast(str, a) .cast(a, str)
aveytense.Tense.clear(*v)
→ None

≥ 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().
aveytense.Tense.count(...)
→ None

≥ 0.3.34; < 0.3.55

Equivalent to itertools.count.

Removed on 0.3.55; consider importing it from aveytense.extensions module instead.
aveytense.Tense.cycle(i, /)
→ None

≥ 0.3.34; < 0.3.55

Equivalent to itertools.cycle.

Removed on 0.3.55; consider importing it from aveytense.extensions module instead.
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 = Tense.OR, start = ..., end = ...)
bool

≥ 0.3.42

Currently experimental more developed mix of str.endswith() and bytes.endswith()
aveytense.Tense.equal(*v)
bool

≥ 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.34

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.27a4

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.26rc2

0.3.27a4: removed parameter default.

0.3.34: restored parameter default.

0.3.39
aveytense.Tense.getAttr(o: object, names: str | Sequence[str] | Set[str], default: T = None )
Any | T
aveytense.Tense.getAttr(o, names, default = None)
Any

≥ 0.3.58

More developed version of inbuilt function getattr(). Allows to use multiple attribute names at once, and returns value of the first accessible one. Roughly equivalent to:

$k[def] $f[getAttr]($p[o], $p[names], $p[default] = None):   $k[if] $f[isinstance]($p[names], $c[str]):     $v[seq] $o[=] $p[names].$f[strip]().$f[split]( ])   $k[else]:     $v[seq] $o[=] $c[list]($p[names])   $v[seq] $o[=] $c[list]($c[filter]($k[lambda] $p[x]: $f[len]($p[x]) > $n[0], $v[seq]))   $k[for] $v[attr] $k[in] $v[names]:     $k[if] $f[hasattr]($p[o], $v[attr]):       $k[return] $f[getattr]($p[o], $v[attr])   $k[return] $p[default]

0.3.58

0.3.59: added support for multiple names in a string separated by spaces in parameter names
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[extensions] $k[import] $o[*] $k[assert] $t[Tense].$tm[getGeneric]([$n[72]]) $o[==] $c[AVT_List][$c[int]] $k[assert] $t[Tense].$tm[getGeneric]({$n[72]}) $o[==] $c[AVT_Set][$c[int]] $k[assert] $t[Tense].$tm[getGeneric]([$n[72], $s[78]]) $o[==] $c[AVT_List][$c[Union][$c[int], $c[str]]] $k[assert] $t[Tense].$tm[getGeneric]({$n[72]: $s[78]}) $o[==] $c[AVT_Dict][$c[int], $c[str]]

About types starting with prefix AVT_ visit this page. These are shown in the example to accord every Python version (since 3.8). For example: list[int] will be invalid in Python versions before 3.9.

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[AVT_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[AVT_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[AVT_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[AVT_Callable][[$c[AVT_Iterable][$tv[_T]], $c[Union][$c[str], $c[range], $c[AbroadType], $c[AVT_Uniqual][$c[int]]], $c[AVT_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[AVT_Iterable][$tv[_T]], $c[Union][$c[str], $c[range], $c[AbroadType], $c[AVT_Uniqual][$c[int]]], $c[AVT_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.52

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[AVT_Iterator][$c[list][$c[Any]]] $k[assert] $t[Tense].$tm[getGeneric]($f[iter]([$n[72]])) $o[==] $c[AVT_Iterator][$c[list][$c[int]]] $k[assert] $t[Tense].$tm[getGeneric]($f[iter]($c[bytes]())) $o[==] $c[AVT_Iterator][$c[bytes]] ### tuples $k[assert] $t[Tense].$tm[getGeneric](($n[72], $n[720])) $o[==] $c[AVT_Tuple][$c[int], $c[int]] $k[assert] $t[Tense].$tm[getGeneric](($n[72], $n[720]), $p[tupleEllipsis] $o[=] $con[True]) $o[==] $c[AVT_Tuple][$c[int], $o[...]] $k[assert] $t[Tense].$tm[getGeneric](($n[72], $s[720])) $o[==] $c[AVT_Tuple][$c[int], $c[str]] $k[assert] $t[Tense].$tm[getGeneric](($n[72], $s[720]), $p[tupleEllipsis] $o[=] $con[True]) $o[==] $c[AVT_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[AVT_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[AVT_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]]

0.3.54: Instances of array.array and memoryview are now supported.

# footnote: 'array.array' can be imported from 'aveytense.extensions' too $k[assert] $t[Tense].$tm[getGeneric]($c[array]($s[i], [$n[72], $n[96]])) $o[==] $c[AVT_Array][$c[int]] $k[assert] $t[Tense].$tm[getGeneric]($c[memoryview]($k[b]$s[63bac])) $o[==] $c[AVT_MemoryView][$c[int]]

If aveytense.Tense.getGeneric() gets an instance of array.array, type parameter value for aveytense.extensions.AVT_Array will hinge on property array.array.typecode. There are 3 distinct results:

  • return AVT_Array[int] for array.array.typecode equal 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q' or 'Q'
  • return AVT_Array[float] for array.array.typecode equal 'f' or 'd'
  • return AVT_Array[str] for array.array.typecode equal 'u' or 'w'

If aveytense.Tense.getGeneric() gets an instance of memoryview, type parameter value for aveytense.extensions.AVT_MemoryView will depend on property memoryview.format. There are 4 distinct results:

  • return AVT_MemoryView[int] for memoryview.format equal 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q', 'P', '@b', '@B', '@h', '@H', '@i', '@I', '@l', '@L', '@q', '@Q' or '@P'
  • return AVT_MemoryView[float] for memoryview.format equal 'f', 'd', '@f' or '@d'
  • return AVT_MemoryView[bytes] for memoryview.format equal 'c' or '@c'
  • return AVT_MemoryView[bool] for memoryview.format equal '?'

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 = ...)
tuple[int, list[Any]]

≥ 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; < 0.3.60

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.61
≥ 0.3.35; < 0.3.61
Invokes bisect.insort_left().
~.Tense.INSORT_RIGHT /
~.constants.INSORT_RIGHT
≥ 0.3.26rc2; < 0.3.61
≥ 0.3.35; < 0.3.61
Invokes bisect.insort_right().

0.3.60
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[extensions] $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.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[extensions] $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[extensions] $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.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
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)
str

≥ 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().
static aveytense.Color.mix(text, /, bits, colorIds, style = None, ituFormat = False, reverse = True)
str

≥ 0.3.58

Generates a gradient with given colors in iterable object in colorIds parameter. The style parameter (defaults to None) must an enumerator - same use as with the % operator. It takes place when the string is about to be returned. The ituFormat parameter indicates whether use : instead of ; in ANSI escape code (defaults to False).

The reverse parameter takes place when colorIds iterable object (in code converted to list builtin) is exhausted and not all characters are colorized. In this case internal code of this static method colorizes every character by duplicating the content of colorIds, and the reverse parameter reverses every even duplicate. Defaults to True. For example: colorIds have tuple value (196, 160, 124, 88, 52, 16). Every even duplicates (second, fourth, sixth etc.) receive version with (52, 88, 124, 160) (reversed and without first and last item), meaning the pattern is (196, 160, 124, 88, 52, 16, 52, 88, 124, 160), followed per 2 duplicates (one normal and one reversed).
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.
abstract-final-class aveytense.TenseOptions
≥ 0.3.27a5; < 0.3.60
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; < 0.3.60 Applies to . 0.3.50

0.3.60
~.probabilityExtendedLength ≥ unavailable (≥ 0.3.27rc1; < 0.3.60 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

0.3.60
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 roughly equivalent (without type hinting) to:

$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