hasattr()
inbuilt function:
and
keyword, just use the following version:
list.append()
and list.extend()
methods. What if you wanted to append more items or extend the list with variable amount of iterables? Instead of using a loop
to invoke both methods amount of times determined by count of iterables or items, you can use the following solution:
pip
command for AveyTense has been provided on 6th August 2024. In the result, AveyTense project will be
installed, along with typing_extensions
project. AveyTense requires typing_extensions
4.10.0 or higher.
And you're set!
aveytense
! Before 0.3.40, main module was called tense
. For backward compatibility,
consider using the import statement in the following way:
site-packages
Python folder, which hoards installed PyPi projects.
pip install --upgrade aveytense
.
After orientation of publishing next versions of AveyTense to PyPi in version 0.3.30, subsequent updates are no longer available via file ./tense/information/changes.txt
.
Everything new is now provided in this Google document.
Releases | Upload date | End-of-Life | Languages | Status | Zip | 7-Zip |
---|---|---|---|---|---|---|
0.3.50 | PyPI: 12th Jul 2025 | - | Python | - | - | |
0.3.49 | PyPI: 3rd Jul 2025 | - | Python | - | - | |
0.3.48 | PyPI: 24th Jun 2025 | - | Python | - | - | |
0.3.47 | PyPI: 12th Jun 2025 | - | Python | - | - | |
0.3.46 | PyPI: 30th May 2025 | - | Python | - | - | |
0.3.45 | PyPI: 16th May 2025 | - | Python | - | - | |
0.3.44 | PyPI: 3rd May 2025 | - | Python | - | - | |
0.3.43 | PyPI: 18th Apr 2025 | - | Python | - | - | |
0.3.42 | PyPI: 2nd Apr 2025 | - | Python | - | - | |
0.3.41 | PyPI: 14th Mar 2025 | - | Python | - | - | |
0.3.40 | PyPI: 27th Feb 2025 | - | Python | - | - | |
0.3.39 | PyPI: 14th Feb 2025 | - | Python | - | - | |
0.3.38 | PyPI: 11th Feb 2025 | - | Python | - | - | |
0.3.37 | PyPI: 9th Feb 2025 | - | Python | - | - | |
0.3.37a1 | PyPI: 3rd Feb 2025 | - | Python | - | - | |
0.3.36 | PyPI: 2nd Feb 2025 | - | Python | - | - | |
0.3.35 | PyPI: 23rd Jan 2025 | - | Python | - | - | |
0.3.34 | PyPI: 15th Jan 2025 | - | Python | - | - | |
0.3.33 | PyPI: 25th Dec 2024 | - | Python | - | - | |
0.3.32 | PyPI: 16th Dec 2024 | - | Python | - | - | |
0.3.31 | PyPI: 8th Dec 2024 | - | Python | - | - | |
0.3.30 | PyPI: 29th Nov 2024 | - | Python | - | - | |
0.3.29 | 3rd Dec 2024 * (as 0.3.28a2) archive: 27th Nov 2024 PyPI: 27th Nov 2024 |
- | Python | Lend! | Lend! | |
0.3.28 | 23rd Nov 2024 * (as 0.3.28a1) archive: 23rd Nov 2024 PyPI: 23rd Nov 2024 |
- | Python | Lend! | Lend! | |
0.3.27 | 13th Nov 2024 * archive: 11th Nov 2024 PyPI: 22nd Nov 2024 |
- | Python | Lend! | Lend! | |
0.3.27rc2 | 3rd Nov 2024 * archive: 27th Oct 2024 PyPI: 27th Oct 2024 |
- | Python | Lend! | Lend! | |
0.3.27rc1 | 23rd Oct 2024 * archive: 19th Oct 2024 PyPI: 20th Oct 2024 |
- | Python | Lend! | Lend! | |
0.3.27b3 | 13th Oct 2024 * archive: 13th Oct 2024 PyPI: 13th Oct 2024 |
- | Python | Lend! | Lend! | |
0.3.27b2 | 3rd Oct 2024 * archive: 26th Sep 2024 PyPI: 26th Sep 2024 |
- | Python | Lend! | Lend! | |
0.3.27b1 | 23rd Sep 2024 * archive: 23rd Sep 2024 PyPI: 23rd Sep 2024 |
- | Python | Lend! | Lend! | |
0.3.27a5 | archive: 13th Sep 2024 PyPI: 13th Sep 2024 |
- | Python | Lend! | Lend! | |
0.3.27a4 | archive: 9th Sep 2024 PyPI: 9th Sep 2024 |
- | Python | Lend! | Lend! | |
0.3.27a3 | archive: 2nd Sep 2024 PyPI: 3rd Sep 2024 |
- | Python | Lend! | Lend! | |
0.3.27a2 | archive: 28th Aug 2024 PyPI: 29th Aug 2024 |
- | Python | Lend! | Lend! | |
0.3.27a1 | archive: 27th Aug 2024 PyPI: 27th Aug 2024 |
- | Python | Lend! | Lend! | |
0.3.26 | archive: 24th Aug 2024 PyPI: 26th Aug 2024 |
- | Python | Lend! | Lend! | |
0.3.26rc3 | archive: 21st Aug 2024 PyPI: 21st Aug 2024 |
- | Python | Lend! | Lend! | |
0.3.26rc2 | archive: 15th Aug 2024 PyPI: 16th Aug 2024 |
- | Python, Java | Lend! | Lend! | |
0.3.26rc1 | archive: 7th Aug 2024 PyPI: 7th Aug 2024 |
- | Python, Java | Lend! | Lend! | |
0.3.26b3 | 29th Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26b2 | 25th Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26a4 | 24th Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26b1 | 23rd Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26a3 | 22nd Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26a2 | 21st Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26a1 | 20th Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | ||
0.3.25 | 19th Jul 2024 | 29th Jun 2025 | Sass (CSS), TS, JS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.24 | 29th Jun 2024 | 29th Jun 2025 | Sass (CSS), TS, JS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.23 | 18th Mar 2024 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.22 | 28th Jan 2024 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.21 | 10th Dec 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.20 | 16th Nov 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.19 | 21st Oct 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.18 | 27th Sep 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.17 | 13th Sep 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.16 | 2nd Sep 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.15 | 13th Aug 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.14 | 31st Jul 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.13 | 12th Jun 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.12 | 29th May 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.11 | 14th May 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.10 | 10th May 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.9 | 1st May 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.8 | 14th Apr 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.7 | 2nd Apr 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.6 | 26th Mar 2023 | 27th Nov 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.5 | 5th Mar 2023 | 27th Nov 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.4 | 23th Feb 2023 | 20th Jul 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.3 | 14th Feb 2023 | 20th Jul 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.2 | 5th Feb 2023 | 20th Jul 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.1 | 30th Jan 2023 | 20th Jul 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.0 | 18th Jan 2023 | 20th Jul 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.2.16 | 15th Jan 2023 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.15 | 13th Jan 2023 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.14 | 9th Jan 2023 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.13 | 8th Jan 2023 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.12 | 6th Jan 2023 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.11 | 31st Dec 2022 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.10 | 28th Dec 2022 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.9 | 25th Dec 2022 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.8 | 23rd Dec 2022 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.7 | 18th Dec 2022 | 19th Jul 2024 | TypeScript, C#, Java, PHP, Lua | no support | ||
0.2.6 | 13th Dec 2022 | 19th Jul 2024 | TypeScript, C++, Java, PHP, Lua | no support | ||
0.2.5 | 9th Dec 2022 | 19th Jul 2024 | TypeScript, C++, Java, PHP, Lua | no support | ||
0.2.4 | 3rd Dec 2022 | 2nd Sep 2023 | TypeScript, C++, Java, PHP, Lua | no support | ||
0.2.3 | 29th Nov 2022 | 2nd Sep 2023 | TypeScript, C++, Java, PHP, Lua | no support | ||
0.2.2 | 23th Nov 2022 | 2nd Sep 2023 | TypeScript, C++, PHP, Lua | no support | ||
0.2.1 | 19th Nov 2022 | 5th Feb 2023 | TypeScript, C++, PHP | no support |
ANSIColor
occurred,
before class aveytense.Color
replaced that class utterly.Games
, which is featured in this submodule. Removed to be in separate, projected PyPi project aveytense_games
.operator
Python standard library.abroad()
and reckon()
functions were defined; name changed so the submodule will be never imported.
This allows to shorten the import statement (since only aveytense
module import is required).aveytense.constants
and aveytense.types_collection
.typing
and enum
) and abstract classes.aveytense.constants
.
Number.MAX_SAFE_INTEGER
.
~.Math.JS_MAX_SAFE_INTEGER
rather than in current form.
Infinity
,
thats 21024 - 2971 (1.797693... * 10308; exact value).
See also Number.MAX_VALUE
.
~.Math.JS_MAX_VALUE
rather than in current form.
Number.MIN_SAFE_INTEGER
.
~.Math.JS_MIN_SAFE_INTEGER
rather than in current form.
Number.MIN_VALUE
.
~.Math.JS_MIN_VALUE
rather than in current form.
~.games.Minecraft.durability
. aveytense.games
submodule has been revoked in 0.3.47 to be in separate project aveytense_games
.
~.games.Minecraft.enchantments
. aveytense.games
submodule has been revoked in 0.3.47 to be in separate project aveytense_games
.
0-1
in a string.0-9
in a string.0-9a-fA-F
in a string.a-zA-Z
in a string.a-z
in a string.0-7
in a string.A-Z
in a string."0.3.34"
. It is identical value as from PyPi.
aveytense.Tense.version
.
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.
VERSION_INFO
instead.
This constant is weak even, if it based on length of VERSION_LIST
tuple.
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.
"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.
VERSION_TUPLE
to VERSION_INFO
.
aveytense.Tense.versionInfo
.
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.
type(~.constants.VERSION_INFO)
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 JavaScript 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
.
class Test(~.Abstract, abstract = True)
. That notation came from local class typing._Final
,
and it isn't supported now.
aveytense.types_collection
to aveytense.util
submodule.
~.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:
aveytense.types_collection
to aveytense.util
submodule.
aveytense.Color
.
while
.
--
.
Behavior can be changed with method ~.setModifier()
. Method itself doesn't return anything.
++
.
Behavior can be changed with method ~.setModifier()
. Method itself doesn't return anything.
aveytense.extensions.ANSIColor
. This class allows to modify style for output.
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 aveytense.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.
To 0.3.27 signature was the following: __init__(text, /, bits = 8, foregroundColor = None, backgroundColor = None, underlineColor = None)
.
underlineColor
was responsible to colorize underline (accepted values same as in foregroundColor
and backgroundColor
). Nothing
really happened during these experiments (expected underline to be factually colored as desired), hence this feature has
been excluded.
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
|
~.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 |
~.Color.BOLD
it is I will be blue and italic
colored blue and oblique:
+
and -
, binary inversion ~
operators, and invocation of str()
. All of these return colored text.
__pos__()
, __neg__()
and __invert__()
are deprecated and will be removed in 0.3.48.
Use str(self)
instead.
__pos__()
, __neg__()
and __invert__()
have been removed.
repr()
, and returns more representative version about object.
None
.~.Tense.clear()
.
~.RGB
.
All names are from this page.
Attributes prefixed with mode256_
refer to 8-bit colors table from ANSI escape code article.
typing._Final
, because it doesn't use the _root
passed in inheritance section.
Example how to create a final class:
aveytense.types_collection
to aveytense.util
submodule.
typing.Final
class, since it doesn't work as intended.
aveytense.types_collection
to aveytense.util
submodule.
aveytense.Tense.isFinalVar()
.
aveytense.util.FinalVar
; used in aveytense.Tense.isFinalVar()
for type hinting.aveytense.util.FinalVar
, what means example expressionFinalVar(2) == FinalVarType(2)
returns True
.
aveytense.Tense
.
Comparing to math
module in Python, this class features polygonal number counting,Constant | Approximate value / Value without fraction |
Lifetime |
---|---|---|
~.Math.CENTILLION |
- / 10303 | ≥ 0.3.25 (19th July 2024) |
~.Math.E |
2.71828 / 3 | ≥ 0.3.25 (4th July 2024) |
~.Math.INF |
- / - | ≥ 0.3.25 (5th July 2024) |
~.Math.NAN |
- / - | ≥ 0.3.25 (5th July 2024) |
~.Math.PI |
3.14159 / 3 | ≥ 0.3.25 (4th July 2024) |
~.Math.SQRT2 |
1.41421 / 1 | ≥ 0.3.25 (5th July 2024) |
~.Math.TAU |
6.28318 / 6 | ≥ 0.3.25 (5th July 2024) |
Normal | ||||
---|---|---|---|---|
Class method name | Equivalent to | Lifetime | Domain | Possible values |
~.Math.sin(x, /) |
- | ≥ 0.3.25 (4th July 2024) | ||
~.Math.cos(x, /) |
- | ≥ 0.3.25 (4th July 2024) | ||
~.Math.tan(x, /) |
≥ 0.3.25 (4th July 2024) | (where |
||
~.Math.cot(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.sec(x, /) |
≥ 0.3.25 (4th July 2024) | (where |
||
~.Math.cosec(x, /) |
≥ 0.3.25 (4th July 2024) |
Extended | ||||
---|---|---|---|---|
Class method name | Equivalent to | Lifetime | Domain | Possible values |
~.Math.versin(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.vercos(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.coversin(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.covercos(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.haversin(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.havercos(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.hacoversin(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.hacovercos(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.exsec(x, /) |
≥ 0.3.25 (5th July 2024) | (where |
||
~.Math.excosec(x, /) |
≥ 0.3.25 (5th July 2024) |
Hyperbolic | ||||
---|---|---|---|---|
Class method name | Equivalent to | Lifetime | Domain | Possible values |
~.Math.sinh(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.cosh(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.tanh(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.coth(x, /) |
≥ 0.3.46 (23rd May 2025) | |||
~.Math.sech(x, /) |
≥ 0.3.46 (23rd May 2025) | |||
~.Math.cosech(x, /) |
≥ 0.3.46 (23rd May 2025) |
Inverse | ||||
---|---|---|---|---|
Class method name | Equivalent to | Lifetime | Domain | Possible values |
~.Math.asin(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.acos(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.atan(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.acot(x, /) |
≥ 0.3.46 (23rd May 2025) | |||
~.Math.asec(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.acosec(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.aversin(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.avercos(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.acoversin(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.acovercos(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.ahaversin(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.ahavercos(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.ahacoversin(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.ahacovercos(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.aexsec(x, /) |
≥ 0.3.25 (5th July 2024) | |||
~.Math.aexcosec(x, /) |
≥ 0.3.25 (5th July 2024) |
Tense08
class.
It is believed that it was defined when Tense08
class was defined (0.2.16) or between 0.3.6 - 0.3.8. There was lacking docstring
in this class method. Currently, Aveyzan has archives since version 0.2.6 (up to 0.3.29; last version with zip archive version).
TypeError
, integer, floating-point number or object of class implementing __abs__()
method
must be passed. In the last one, method __abs__()
must return either integer or floating-point number. Unfortunately, for negative numbers it doesn't
seem logical, when using the inbuilt function abs()
:
from aveytense import
class r :
def __abs__ (self ):
return -76
.print (abs (r ())) -76
.print (Math .abs (r ())) 76
__abs__()
can return anything, so its also seen in function abs()
, as self.__abs__()
methodabs(self)
.
x
.
x
.
x
.
x
. Equals ~.asin(x - 1)
.
~.acovercosin()
; improved domain and type checking
x
. Equals ~.asin(1 - x)
.x
. Equals ~.acosec(x + 1)
.aveytense.Math.aexcsc()
; improved domain and type checking
x
. Equals ~.asec(x + 1)
.x
. Equals ~.asin(2x - 1)
.aveytense.Math.ahacovercosin()
; improved domain and type checking
x
. Equals ~.asin(1 - 2x)
.x
. Equals ~.acos(2x - 1)
.~.ahavercosin()
; improved domain and type checking
x
. Equals ~.acos(1 - 2x)
.x
.x
.
x
.
x
.
x
.
x
. Equals ~.acos(x - 1)
.~.avercosin()
; improved domain and type checking
x
. Equals ~.acos(1 - x)
.math.cbrt()
didn't exist to this version).
x
.x
.x
.x
(inverse of tangent).x
. Equals 1 + ~.sin(x)
.~.covercosin()
; improved type checking
x
. Equals 1 - ~.sin(x)
.~.polygonal(n, 10)
. Example results:
x
. Equals ~.cosec(x) - 1
.
~.excsc()
x
. Equals ~.sec(x) - 1
.
n
, given by formula: n
is equal math.factorial()
function,
implementation is since now included.
math.gcd()
function operated on 2 values only.
~.polygonal(n, 7)
. Example results:
~.polygonal(n, 6)
. Example results:
True
, if x
is a sequence of numbers, then all numbers from that sequence must be in range created by False
is returned.
mode
to modify the range. c
means closed and o
means open bracket:
~.isInRange() |
|
---|---|
mode value |
Equivalent to |
"c" |
|
"co" |
|
"o" |
|
"oc" |
not ~.isInRange() |
|
---|---|
mode value |
Equivalent to |
"c" |
|
"co" |
|
"o" |
|
"oc" |
mode
is insensitive.
In case of maths, ranges are also called intervals, as visible in this article.
functools.reduce()
function
used along with math.gcd()
, as the following piece of code:
~.lcm()
class method provides support before Python 3.9.
math.lcm()
wasn't defined yet.
base
).
x
is now positional-only parameter
n
. Multiply operation on certain digits need to have the same result as n
,
and first smallest one will be returned. If there are no digits that multiplied together equal n
, method will return -1.
Examples: for n
.
aveytense.Math.ltp()
(least to product). However, it was never handed over,
mainly due to issue of generating the result too long. It still existed in code, just wasn't available publicly due to if False
statement preceding the method definition as an alternative for inspecting sys.version_info
.
This method was defined back during IT trial mature exams on 22nd November 2024, and since then that method had this issue.
The issue was patched on 12th February 2025.
TypeError
whether there were no integer values passed or not all values are integers.
The type of mean is addicted to parameter mode
:
"a"
- returns arithmetic mean. Formula:
"g"
- returns geometric mean. Formula:
"q"
- returns quadratic mean (root mean square). Formula:
mode
is insenstive.
In case geometric mean is deduced, ValueError
is raised when there is at least one negative integer passed.
aveytense.Math.polygonal(n, 9)
. Example results:
aveytense.Math.polygonal(n, 8)
. Example results:
aveytense.Math.polygonal(n, 5)
. Example results:
k
is ellipsis, returns None
.
s
-gonal number from following formula: s
is amount of sides in a polygon, and it cannot be negative, not even equal x
. Formula is n
is sentinel in a loop, which will never end due to aveytense.Math.polygonal(n, 3)
. Example results:
tkinter
, from which AveyTense project resigned back on 0.3.36.
aveytense_games
.
~.Minesweeper
class object.
height
is amount of rows for the board. Allowed values for 9 to 24.width
is amount of columns for the board. Allowed values for 9 to 30.mines
is amount of mines scattered on the board. Allowed values for 10 to 668.
Variable | Lifetime | Tuple content | Usage |
---|---|---|---|
~.Minesweeper.ADVANCED |
≥ 0.3.41; < 0.3.47 | (16, 30, 99) |
~.Minesweeper(~[0], ~[1], ~[2]) |
~.Minesweeper.BEGINNER |
≥ 0.3.41; < 0.3.47 | (9, 9, 10) |
|
~.Minesweeper.INTERMEDIATE |
≥ 0.3.41; < 0.3.47 | (16, 16, 40) |
aveytense_games
.
"0"
to "8"
, or "X"
, which is a mine indicator.
It is also possible to occur as parameter-less ~.getBoard()
method.
aveytense_games
.
colorize
is set to True
, board will be colored, but it will take longer to print.
It usually takes 2-3 seconds.
aveytense_games
.
~.getHeight()
method.
aveytense_games
.
~.getMines()
method.
aveytense_games
.
~.getWidth()
method.
aveytense_games
.
inspect.getfullargspec()
. 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.
f
must be a callable object, meanwhile parameter i
points to a specific overload, if provided callable object
in parameter f
has overloads. May be only in range f
is an instance
method accessed via reference, then first parameter (usually named self
) is excluded. f
can be an instance of
functools.partial
class too.
len(~.all)
.
dict
.
len(~.allDefaults)
.
len(~.allNoDefaults)
.
len(~.annotated)
.
dict
.
len(~.annotatedDefaults)
.
RGB
class instance. Parameters represent colors as in mere RGB color picker.
~.RGB
class instance to binary via bin()
, because this inbuilt function can only accept integer values or instances of classes implementing
the __index__()
method, which should return int
. Both members return binary number with 0b
preceding, as a string.
True
.
bytes
object.
~.RGB
class instance to hexadecimal via hex()
, because this inbuilt function can only accept integer values or instances of classes implementing
the __index__()
method, which should return int
. Both members return hexadecimal number with 0x
preceding, as a string.
~.cssHex
returns the string with prefix #
instead of 0x
to be used in CSS.
from import
.print (RGB (0 , 0 , 85 ).__hex__ ()) 0x000055
.print (RGB (0 , 0 , 85 ).hex ) 0x000055
.print (RGB (0 , 0 , 85 ).cssHex ) #000055
int
object. Formula: RGB(r, g, b) = #rrggbb => int(#rrggbb)
.
from import
.print (int (RGB (0 , 0 , 85 ))) 85
RGB
class instances.
from aveytense import
.print (RGB (0 , 0 , 85 )RGB (0 , 0 , 102 )) True
.print (RGB (0 , 0 , 85 )RGB (0 , 0 , 102 )) False
.print (RGB (0 , 0 , 85 )RGB (0 , 0 , 102 )) True
.print (RGB (0 , 0 , 85 )RGB (0 , 0 , 102 )) False
.print (RGB (0 , 0 , 85 )RGB (0 , 0 , 102 )) False
.print (RGB (0 , 0 , 85 )RGB (0 , 0 , 102 )) True
~.RGB
class instance to octal via oct()
, because this inbuilt function can only accept integer values or instances of classes implementing
the __index__()
method, which should return int
. Both members return hexadecimal number with 0o
preceding, as a string.
from aveytense import
.print ((RGB (0 , 0 , 85 ).__oct__ ())) 0o125
from import
.print (RGB (0 , 0 , 85 )) (0, 0, 85)
.print (RGB (0 , 0 , 85 )) (0, 0, 85)
.print (RGB (0 , 0 , 85 )) (0, 0, 85)
.print (RGB (0 , 0 , 85 ).tuple ) (0, 0, 85)
__pos__()
, __neg__()
and __invert__()
are deprecated and will be removed in 0.3.48.
Use tuple
final property instead.
__pos__()
, __neg__()
and __invert__()
have been removed. Suprisingly these existed
in code for version 0.3.48.
repr(self)
, and returns more representative version about the object.
from import
.print (repr (RGB (0 , 0 , 85 ))) <aveytense.RGB object: RGB(0, 0, 85)>
~.cssRgb
returns the lowercased version of the string to be used in CSS.
from import
.print (RGB (0 , 0 , 85 )) RGB(0, 0, 85)
~.RGB
class object (this static method is alternative constructor for ~.RGB
) using an integer or numeric string in range [0; 224 - 1]. Right side of range equals 16777215.
from aveytense import
.print (RGB .fromValue (85 )) RGB(0, 0, 85)
.print (RGB .fromValue (0o257 )) RGB(0, 0, 175)
.print (RGB .fromValue (0xc0ffee )) RGB(12, 15, 238)
.print (RGB .fromValue (0x1278 )) RGB(0, 18, 120)
aveytense.Color
constructor.
0x
, 0o
and 0b
.
abroad()
function, which converts every integer to their binary equivalents.include_0b
allows to include 0b
prefix in every returned binary integer in a string.
NennaiAbroads
, method was moved to Tense
class.
0; n
], if negative, then [n; -1
].
from aveytense import
.print ( .Convect(35 , joyride , 7.2 , 23 12 j , (reckon , abroad )))
35 + 7 + 23 + 12 + 2 = 86 => [0, 1, 2, 3, ..., 83, 84, 85]
NennaiAbroads
, method was moved to Tense
class.
abroad()
function, which can modify iterable via parameter each
before it will be returned.
from aveytense import
.print ( .Each(1 , 7 , each lambda x : x x ))
[1, 4, 9, 16, 25, 36]
.print ( .Each(100 , 0 , each lambda x : x (1/2 )))
[10, sqrt(99), sqrt(98), ..., sqrt(3), sqrt(2), 1]
.print ( .Each(6 , 13 , each lambda x : x (1/x )))
[1, 1, 1, 1, 1, 1]
NennaiAbroads
, method was moved to Tense
class.
each
is keyword-only parameter.
abroad()
function, which excludes desired integers in parameter excludedIntegers
.
NennaiAbroads
, method was moved to Tense
class.
abroad()
function, which divides every integer by div
.aveytense.Tense.abroadEach(value1, value2, modifier, each = lambda x: x / div)
.
NennaiAbroads
, method was moved to Tense
class.
abroad()
function, which returns every integer in hexadecimal format as strings.
NennaiAbroads
, method was moved to Tense
class.
abroad()
function, which returns immutable version of the sequence (in this case tuple). Alias to tuple(abroad())
.
-
: -abroad()
.
abroad()
function, which places every integer in curly brackets in parameter string
.NennaiAbroads
, method was moved to Tense
class.
abroad()
function referring to graph; every next value is next endpoint.
NennaiAbroads
, method was moved to Tense
class.
abroad()
function, which transforms every integer to negative.
NennaiAbroads
, method was moved to Tense
class.
abroad()
function, which transforms every integer to negative, and reverses returned sequence.
NennaiAbroads
, method was moved to Tense
class.
NennaiAbroads
, method was moved to Tense
class.
abroad()
function basing on inbuilt class zip
.
NennaiAbroads
, method was moved to Tense
class.
abroad()
function, which transforms every integer to positive.
NennaiAbroads
, method was moved to Tense
class.
abroad()
function, which transforms every integer to positive, and reverses returned sequence.
NennaiAbroads
, method was moved to Tense
class.
abroad()
function, which returns string sequence with specific string prefix + every integer.
NennaiAbroads
, method was moved to Tense
class.
NennaiAbroads
, method was moved to Tense
class.
abroad()
function, which returns string sequence with every integer + specific string suffix.
NennaiAbroads
, method was moved to Tense
class.
NennaiAbroads
, method was moved to Tense
class.
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 : x 3 0 )) True
.print ( .all ([3 , 9 , 6 , 12 ], lambda x : x 2 0 )) False
default
.
False
.
condition
now has default value ellipsis, support for None
has been excised. Fixed internal code, as it was liable for errors
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 : x 2 0 )) True
.print ( .any ([3 , 9 , 6 , 12 ], lambda x : x 7 0 )) False
default
.
condition
now has default value ellipsis, support for None
has been excised. Fixed internal code, as it was liable for errors
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.
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
bisect.bisect()
/
bisect.bisect_left()
,
just dir
parameter determines, which bisect function to invoke. Possible values:
Constant | Lifetime | Description |
---|---|---|
~.Tense.BISECT_LEFT /~.constants.BISECT_LEFT
|
≥ 0.3.26rc2 ≥ 0.3.35 |
Invokes bisect.bisect_left() . |
~.Tense.BISECT_RIGHT /~.constants.BISECT_RIGHT
|
≥ 0.3.26rc2 ≥ 0.3.35 |
Invokes bisect.bisect_right() . |
typing.cast()
, just parameters being in inverted places.
list.clear()
,
set.clear()
and
dict.clear()
.
~.Color
.
In case of ~.Color
class instances invoked is their instance method ~.Color.clear()
.
types.FrameType
are now allowed. Since this version strings are factually cleared; earlier, it was an unhandled issue despite it is normally supported.
typing.IO
(more specifically, every object returned from function open()
).
collections.abc
: MutableSequence
, MutableSet
or MutableMapping
are allowed, so
not only inbuilt solutions such as lists, sets or dictionaries.
copy.copy()
.itertools.count
(as a method, it may not operate on all overloads because of an error saying this class isn't subscriptable).
itertools.cycle
.copy.deepcopy()
.set.difference()
instance method.invert
is set to True
.
abroad()
function.
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
.
eval()
inbuilt Python function.~.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.
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.
~.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()
.
m
:
m value |
~.expect() |
not ~.expect() |
---|---|---|
">= 3" |
||
"< 19" |
||
"== 14" |
||
"!= 23" |
||
"<= len" |
len
keyword allows to create ~.all()
method using the following signature:
~.any()
method, signature doesn't use len
keyword.
Reason it doesn't is because "<= len"
will be satisfied also for no matches overall.
m
is sensitive, so e.g. LEN
will be invalid and will throw TypeError
.range
objects in parameter m
. Support was predicted for version 0.3.48.
explode()
and
equivalent to inbuilt string method str.split()
.
~.Tense.append()
class method. Typically this class method is extension of inbuilt list
method list.extend()
.
condition
or default
, if none satisfied condition
. This class method is
paired with
~.Tense.last()
class method.
default
.
default
.
itertools.chain.from_iterable()
.
This class method returns a flattened version of a duo-dimensional iterable object.
(item for item in i)
and with specific condition if specified (as in (item for item in i if condition)
).
First parameter has to be an iterable object, and condition
- if given - a callable object with one non-keyword parameter and that returns a boolean value.
yield
keyword in a function can do it too.
~.Tense.generator()
class method, if usage of generator expressions is misunderstandable.
collections.abc.Generator
,
and this class is one of the very few classes from library collections.abc
to have instances gained normally and without type hinting. Almost every class from library
itertools
return a generator object, despite type
hinting somehow camouflages this fact with the itertools.pyi
file.
mode
determines about used logical operators inside and outside provided sequences.-
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"
nor
and nand
, those are actually equal to, respectively: not OR and not AND.
mode
parameter is now insensitive, and added lacking modes: and-nand
, nand-and
, or-nor
and nor-or
.
itertools.groupby
(as a method, it may not operate on all overloads because of an error saying this class isn't subscriptable).hasattr()
, used to detect many attributes at once via parameter attr
.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 ), mode and )) False
o
parameter must be a tuple of objects to take place. However, class method permits check only one attribute at once.
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
.
bisect.insort()
/
bisect.insort_left()
,
just dir
parameter determines, which insort function to invoke. Possible values:
Constant | Lifetime | Description |
---|---|---|
~.Tense.INSORT_LEFT /~.constants.INSORT_LEFT
|
≥ 0.3.26rc2 ≥ 0.3.35 |
Invokes bisect.insort_left() . |
~.Tense.INSORT_RIGHT /~.constants.INSORT_RIGHT
|
≥ 0.3.26rc2 ≥ 0.3.35 |
Invokes bisect.insort_right() . |
v & _[0] & _[1] & ...
).v and _[0] and _[1] and ...
).set(v).intersection(*_)
.
bool
object.
(v, /)
is now an overload.
bytearray
object.
(v, /)
is now an overload.
bytes
object.
(v, /)
is now an overload.
complex
object.
from aveytense import
a 65 72 j
b 68
.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 , mode and )) False
.print ( .isComplex (a , b , mode or )) True
(v, /)
is now an overload.
dict
object. Basically revamped version of isinstance(v, dict)
.
from aveytense import
a {3 : 3 }
.print ( .isDict (a )) True
since 0.3.34, see change note below
.print ( .isDict (a , int )) True
.print ( .isDict (a , int , str )) True
.print ( .isDict (a , str , int )) False
since 0.3.35, see change note below
.print ( .isDict (a , (int , str ), int )) False
.print ( .isDict (a , (int , str ), (int , str ))) True
ktype
and vtype
to enhance dict type checking.ktype
is demanded type for keys and vtype
is demanded type for values.
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
ktype
and vtype
now support 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)
you can freely use int | str
.
In the same version provided initial support for generic types, which may be extended in further versions. They cannot be used in union types though.
typing.Never
is type hinted:
a {78 : 32 } dict[int, int]
if .isDict (a , (int , float ), int ):
a type hints typing.Never, but this statement will be invoked
else :
a type hints dict[int, int], but this statement won't be invoked
bool(Tense.isDict(a, ...))
Ellipsis
).
(v, /)
is now an overload.
True
, if value is a final class.
True
, if value is instance of aveytense.util.finalproperty
class.
aveytense.util.FinalVar
.
float
object.
(v, /)
is now an overload.
frozenset
object.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
)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)
you can freely use int | str
.
In the same version provided initial support for generic types, which may be extended in further versions. They cannot be used in union types though.
int
object.
(v, /)
is now an overload.
list
object.
type
to enhance list type checking.
type
now supports union types. In this case it is required to wrap these in a tuple.
Examples:isList(v, ())
is the same as isList(v)
isList(v, (int, str))
is the same as isList(v, int) or isList(v, str)
(either int
or str
)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)
you can freely use int | str
.
In the same version provided initial support for generic types, which may be extended in further versions. They cannot be used in union types though.
typing.Never
is type hinted:
a [48 ] [45.2 ] list[int | float]
if .isList (a , (int , float , str )):
a type hints typing.Never, but this statement will be invoked
elif .isList (a , int ):
a type hints typing.Never, and this statement won't be invoked
else :
a type hints list[int | float], but this statement won't be invoked
bool(Tense.isList(a, ...))
memoryview
object.
(v, /)
is now an overload.
None
.
(v, /)
is now an overload.
set
object.type
allows to enhance set type checking. For union types, wrap types in a tuple. Examples:
isSet(v, ())
is the same as isSet(v)
isSet(v, (int, str))
is the same as isSet(v, int) or isSet(v, str)
(either int
or str
)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)
you can freely use int | str
.
In the same version provided initial support for generic types, which may be extended in further versions.
typing.Never
is type hinted:
a set ([48 ] [45.2 ]) set[int | float]
if .isSet (a , (int , float , str )):
a type hints typing.Never, but this statement will be invoked
elif .isSet (a , int ):
a type hints typing.Never, and this statement won't be invoked
else :
a type hints set[int | float], but this statement won't be invoked
bool(Tense.isSet(a, ...))
_Mode = Literal["and", "or", MODE_AND, MODE_OR]
)
str
object.
(v, /)
is now an overload.
tuple
object.
type
to enhance tuple type checking.
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
)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)
you can freely use int | str
.
In the same version provided initial support for generic types, which may be extended in further versions.
~.isTuple()
in case of type hinting works seems unclear, it is good to experiment though.
In this case you can use bool(~.isTuple(...))
.
~.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
~.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.
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 ~.isTuple()
class method, however, types themselves must be encased in a tuple, as in examples below.
v1
and v2
. This class method uses the following rules:
v2
tuple has size least than v1
tuple, then v2
tuple last item has to satisfy the remaining items in v1
tuple.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.v2
tuple has size greater than v1
tuple, then TypeError
is thrown.
from import
.print ( .isTuple2 ((), ())) True
.print ( .isTuple2 ((), (util.Any ,))) True
.print ( .isTuple2 ((), (util.Any , util.Any ))) False
.print ( .isTuple2 ((), (util.Any , util.Any , util.Any ))) False
.print ( .isTuple2 ((132 , 432 ), (int ,))) True; same as ~.isTuple((132, 432), int)
.print ( .isTuple2 ((132 , 432 ), (int , int ))) True
.print ( .isTuple2 ((132 , 432 ), (int , int , int ))) throws TypeError
.print ( .isTuple2 ((132 , 432 ), ((int , str ),))) True; same as ~.isTuple((132, 432), (int, str))
.print ( .isTuple2 ((132 , 432 ), (int , str ))) False; NOT same as ~.isTuple((132, 432), (int, str))
.print ( .isTuple2 ((132 , 432 ), (str ,))) False; same as ~.isTuple((132, 432), str)
.print ( .isTuple2 ((132 , 432 ), ((int , str ), int ))) True
.print ( .isTuple2 ((132 , 432 ), ((int , str ), str ))) False
.print ( .isTuple2 ((132 , 432 ), ((int , str ), (int , str )))) True
~.isTuple2()
in case of type hinting works seems unclear, it is good to experiment though.
In this case you can use bool(~.isTuple2(...))
.
condition
or default
, if none satisfied condition
. This class method is
paired with
~.Tense.first()
class method.
default
.
default
.
random.choice()
.
secure
to generate cryptographically safe result.
secure
parameter is actually a reference of re-implemented pseudo-random functions in inbuilt Python module secrets
vf
(alias to values-frequencies).
To faciliate understanding, how this class method works, it is basing on probability defintion: ~.Math
.
In-code syntax would be: length
parameter. It isn't recommended, since it is more liable for errors.
from import
.print ( .probability ([0 , 2 ], [1 , 5999 ], [2 , 5999 ])) 0-2; coinflip, 0 means side
vf
supports single values or these put in a sequence/set/mapping as first item/key and second item/value being either integer, ellipsis or None
.
(*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).
PROBABILITY_COMPUTE
(previous name was PROBABILITY_ALL
)
as default value for parameter length
.
valuesAndFrequencies
to vf
(values-frequencies), added support for sets, frozensets.
Also, added support for default values (normally 1 per each value): None
and ellipsis.
ZeroDivisionError
. It was in case of 2 values (tests from morning 19th July 2024).
sys.maxsize
(earlier there wasn't one).
aveytense.util.FinalVar
.
aveytense.util.FinalVar
and added support for tkinter.IntVar
.
tkinter.IntVar
.
ZeroDivisionError
(modulo operation was the cause).
ZeroDivisionError
; shortened internal code and removed length
parameter. Support for None
will be retracted in the future.
Moreover, removed necessity passing True
to option ~.TenseOptions.disableProbability2LengthLimit
to bypass sys.maxsize
. If there is only one item, it must
be a mapping to prevent throwing an error. Supported types is wider: to objects of classes extending one of following collections.abc
ABCs: Sequence
, AbstractSet
or Mapping
. Returned type is no longer restricted to integer too.
~.probability()
gets 2 values. Probability of returning ~.probability()
, this method accepts all types (so not only int
), but both x
and y
must return the same type.
~.probability()
:
sys.maxsize
was because internal code used an internal list holding values to pick from later, and none of sequences' sizes can go above this number.
It was better to know, which numeric value this variable returns - it all depends on system's architecture. If we are working with 32-bit systems, then value will be 232 - 1, meanwhile
for 64-bit systems that gap is much higher: 264 - 1.
The only way to kill this restriction was knowledge that on Python 3 there is no integer value limit, which was assigned to variable
sys.maxint
.
This solution has been initiated on 0.3.31 with option ~.TenseOptions.disableProbability2LengthLimit
, but only since 0.3.33 it works as intended. Limit has been disqualified in version 0.3.46.
functools.reduce()
,
unless you know what to do. The result may be just unpredictable.
(rareValue = 1, usualValue = 0, frequency, length)
, and renamed method from probability()
to current name.(value = 1, frequency, value)
, and not many things were able to be done due to restricting returned values to 0 and value
.
probability2()
with same parameters, with some denomination changes: rareValue
was renamed to x
,usualValue
was renamed to y
. Default values of both were kept.
length
now can have value -1 to refer to default value 10000.
aveytense.TenseOptions.disableProbability2LengthLimit
to remove the limit related to sys.maxsize
(default value False
).
True
to option ~.TenseOptions.disableProbability2LengthLimit
to bypass sys.maxsize
.
~.probability()
class method. In contrast to ~.probability()
, it also operates on many values, however, difference is
that vf
parameter only accepts a mapping with at least 2 pairs. Value (there 1
).
vf
parameter isn't variable as in ~.probability()
, and its internal code is shorter, ~.probability3()
is circa 3 times faster than ~.probability()
.
y
is x
],x
, y
], depending which one is greater.
value
specified amount of times
and returns a generator[::-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.
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).
~.util.MutableString
instances.
list
(sets are always placed ascendingly)
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.
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
.
~.util.MutableString
instances.
list
(sets are always placed ascendingly)
time.sleep()
.
time.time()
function to an internal variable, and
using the while
loop with statement while time.time() - <var> ≥ seconds: <var> = time.time()
.
itertools.starmap
.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()
.
timeit.timeit()
.
To invoke callable with arguments, use lambda: <func-name>(...)
.
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.
desiredString
, and added string type hint.
tkinter.StringVar
tkinter.IntVar
tkinter.StringVar
aveytense.constants.VERSION
aveytense.constants.VERSION_ID
.
aveytense.constants.VERSION_INFO
.
~.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() .
|
~.initializationMessage |
≥ 0.3.27a5; < 0.3.40 |
It was applied to constructor of ~.Tense .
|
~.insertionMessage |
≥ 0.3.27b1 |
Applies to ~.Tense.print() .
|
~.probabilityExtendedLength |
≥ unavailable (0.3.27rc1 in code) |
Had to apply to ~.Tense.probability() . This variable was bound with usage of nested
list in order to extend number support, bypassing sys.maxsize .
This attribute was marked unrealized in version 0.3.46, according to change occured in class methods ~.Tense.probability2()
and ~.Tense.probability() .
|
range()
function.
range()
and ~.abroad()
functions are:
~.abroad()
function doesn't have overloads~.abroad()
supports complex
objects, iterables and file objects, doesn't support ellipsis thoughmodifier
) in function ~.abroad()
has no sign sensitivity (can be negative or positive, code will always go towards endpoint). This behavior is not preferred to use though~.abroad()
supports floating-point numbersrange()
, but there are benefits:
range(len())
and range(len(file.readlines()))
, no matter in which parameteraveytense_games
.
~.Final
, just used as decorator instead of base class.
@typing.final
.
~.Tense.isFinalProperty()
class method. Usage with
isinstance()
Python function
as isinstance(<class.attribute>, ~.util.finalproperty)
works too.
isinstance()
as isinstance(<class.finalproperty>, property
)
returns False
.
@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.
~.finalproperty
is generic class. Correct type hint was provided in 0.3.43.
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
.
_static_
has value True
, internal code actually creates an object of the class, and in type hinting it isn't visible.@finalproperty
.
aveytense_games
.
aveytense_games
.