hasattr()
inbuilt function:
and
keyword, there is version with mode
parameter set to
"and"
or aveytense.Tense.AND
:
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.29 | 3rd Dec 2024 * (as 0.3.28a2) archive: 27th Nov 2024 PyPI: 27th Nov 2024 |
- | Python | Lend! | Lend! | |
0.3.28 | 23rd Nov 2024 * (as 0.3.28a1) archive: 23rd Nov 2024 PyPI: 23rd Nov 2024 |
- | Python | Lend! | Lend! | |
0.3.27 | 13th Nov 2024 * archive: 11th Nov 2024 PyPI: 22nd Nov 2024 |
- | Python | Lend! | Lend! | |
0.3.27rc2 | 3rd Nov 2024 * archive: 27th Oct 2024 PyPI: 27th Oct 2024 |
- | Python | Lend! | Lend! | |
0.3.27rc1 | 23rd Oct 2024 * archive: 19th Oct 2024 PyPI: 20th Oct 2024 |
- | Python | Lend! | Lend! | |
0.3.27b3 | 13th Oct 2024 * archive: 13th Oct 2024 PyPI: 13th Oct 2024 |
- | Python | Lend! | Lend! | |
0.3.27b2 | 3rd Oct 2024 * archive: 26th Sep 2024 PyPI: 26th Sep 2024 |
- | Python | Lend! | Lend! | |
0.3.27b1 | 23rd Sep 2024 * archive: 23rd Sep 2024 PyPI: 23rd Sep 2024 |
- | Python | Lend! | Lend! | |
0.3.27a5 | archive: 13th Sep 2024 PyPI: 13th Sep 2024 |
- | Python | Lend! | Lend! | |
0.3.27a4 | archive: 9th Sep 2024 PyPI: 9th Sep 2024 |
- | Python | Lend! | Lend! | |
0.3.27a3 | archive: 2nd Sep 2024 PyPI: 3rd Sep 2024 |
- | Python | Lend! | Lend! | |
0.3.27a2 | archive: 28th Aug 2024 PyPI: 29th Aug 2024 |
- | Python | Lend! | Lend! | |
0.3.27a1 | archive: 27th Aug 2024 PyPI: 27th Aug 2024 |
- | Python | Lend! | Lend! | |
0.3.26 | archive: 24th Aug 2024 PyPI: 26th Aug 2024 |
- | Python | Lend! | Lend! | |
0.3.26rc3 | archive: 21st Aug 2024 PyPI: 21st Aug 2024 |
- | Python | Lend! | Lend! | |
0.3.26rc2 | archive: 15th Aug 2024 PyPI: 16th Aug 2024 |
- | Python, Java | Lend! | Lend! | |
0.3.26rc1 | archive: 7th Aug 2024 PyPI: 7th Aug 2024 |
- | Python, Java | Lend! | Lend! | |
0.3.26b3 | 29th Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26b2 | 25th Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26a4 | 24th Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26b1 | 23rd Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26a3 | 22nd Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26a2 | 21st Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | Lend! | |
0.3.26a1 | 20th Jul 2024 | 31st Aug 2025 | Python, Java | Lend! | ||
0.3.25 | 19th Jul 2024 | 29th Jun 2025 | Sass (CSS), TS, JS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.24 | 29th Jun 2024 | 29th Jun 2025 | Sass (CSS), TS, JS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.23 | 18th Mar 2024 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.22 | 28th Jan 2024 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.21 | 10th Dec 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.20 | 16th Nov 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.19 | 21st Oct 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.18 | 27th Sep 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.17 | 13th Sep 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.16 | 2nd Sep 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.15 | 13th Aug 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.14 | 31st Jul 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.13 | 12th Jun 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.12 | 29th May 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.11 | 14th May 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.10 | 10th May 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.9 | 1st May 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.8 | 14th Apr 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.7 | 2nd Apr 2023 | 27th Nov 2024 | Sass (CSS), JS + TS, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.6 | 26th Mar 2023 | 27th Nov 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.5 | 5th Mar 2023 | 27th Nov 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.4 | 23th Feb 2023 | 20th Jul 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.3 | 14th Feb 2023 | 20th Jul 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.2 | 5th Feb 2023 | 20th Jul 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.1 | 30th Jan 2023 | 20th Jul 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.3.0 | 18th Jan 2023 | 20th Jul 2024 | Sass, TypeScript, C++, C#, Java, Python, PHP, Lua | no support | ||
0.2.16 | 15th Jan 2023 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.15 | 13th Jan 2023 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.14 | 9th Jan 2023 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.13 | 8th Jan 2023 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.12 | 6th Jan 2023 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.11 | 31st Dec 2022 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.10 | 28th Dec 2022 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.9 | 25th Dec 2022 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.8 | 23rd Dec 2022 | 19th Jul 2024 | Sass, TypeScript, C++, C#, Java, PHP, Lua | no support | ||
0.2.7 | 18th Dec 2022 | 19th Jul 2024 | TypeScript, C#, Java, PHP, Lua | no support | ||
0.2.6 | 13th Dec 2022 | 19th Jul 2024 | TypeScript, C++, Java, PHP, Lua | no support | ||
0.2.5 | 9th Dec 2022 | 19th Jul 2024 | TypeScript, C++, Java, PHP, Lua | no support | ||
0.2.4 | 3rd Dec 2022 | 2nd Sep 2023 | TypeScript, C++, Java, PHP, Lua | no support | ||
0.2.3 | 29th Nov 2022 | 2nd Sep 2023 | TypeScript, C++, Java, PHP, Lua | no support | ||
0.2.2 | 23th Nov 2022 | 2nd Sep 2023 | TypeScript, C++, PHP, Lua | no support | ||
0.2.1 | 19th Nov 2022 | 5th Feb 2023 | TypeScript, C++, PHP | no support |
aveytense
.
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
.AVT_
.
aveytense.types_collection
to current name.
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
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
.
abc.ABC
class with @abc.abstractmethod
decorator instead.
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:
~.Abstract
and ~.Final
classes via
issubclass() function returns False
:
aveytense.types_collection
to aveytense.util
submodule.
aveytense.Color
is much developed now.
aveytense.Color
.
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)
.
--
.
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.
~.RGB
. Upon constructor invocation, returned is new ~.RGB
class instance with inverted colors.
~.RGB
class, this class does not feature any members. To invert a value (not RGB tuple necessarily), it is possible to
use the following:
~.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.
underlineColor
due to no effect (signature __init__(text, /, bits = 8, foregroundColor = None, backgroundColor = None, underlineColor = None)
).
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
, 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:
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()
.
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
<callable_object>.__code__.co_flags & ...
<type>.__flags__ & ...
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 | 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) |
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.asinh(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.acos(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.acosh(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.atan(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.atanh(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.acot(x, /) |
≥ 0.3.46 (23rd May 2025) | |||
~.Math.acoth(x, /) |
≥ 0.3.51 | |||
~.Math.asec(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.asech(x, /) |
≥ 0.3.51 | |||
~.Math.acosec(x, /) |
≥ 0.3.25 (4th July 2024) | |||
~.Math.acosech(x, /) |
≥ 0.3.51 | |||
~.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) |
0
for parameter n
. In ~.Math.polygonal()
change also occurred in parameter s
- it must now comply with Class method name | Equivalent to | Lifetime | Returned value |
---|---|---|---|
Two-parameter functions | |||
~.Math.polygonal(n, s, /) |
≥ 0.3.27a4 | polygonal number at index n with s sides |
|
~.Math.polygonalCentered(n, s, /) |
≥ 0.3.51 | centered polygonal number at index n with s sides |
|
~.Math.pyramidal(n, s, /) |
≥ 0.3.51 | pyramidal number at index n with s sides |
|
One-parameter functions | |||
2-polytopes (polygons) | |||
~.Math.triangular(n, /) |
≥ 0.3.27a4 | triangular number at index n |
|
~.Math.triangularCentered(n, /) |
≥ 0.3.51 | centered triangular number at index n |
|
~.Math.square(n, /) |
≥ 0.3.51 | square number at index n (or |
|
~.Math.squareCentered(n, /) |
≥ 0.3.51 | centered square number at index n |
|
~.Math.pentagonal(n, /) |
≥ 0.3.27a4 | pentagonal number at index n |
|
~.Math.pentagonalCentered(n, /) |
≥ 0.3.51 | centered pentagonal number at index n |
|
~.Math.hexagonal(n, /) |
≥ 0.3.27a4 | hexagonal number at index n |
|
~.Math.hexagonalCentered(n, /) |
≥ 0.3.51 | centered hexagonal number at index n |
|
~.Math.heptagonal(n, /) |
≥ 0.3.27a4 | heptagonal number at index n |
|
~.Math.heptagonalCentered(n, /) |
≥ 0.3.51 | centered heptagonal number at index n |
|
~.Math.octagonal(n, /) |
≥ 0.3.27a4 | octagonal number at index n |
|
~.Math.octagonalCentered(n, /) |
≥ 0.3.51 | centered octagonal number at index n |
|
~.Math.nonagonal(n, /) |
≥ 0.3.27a4 | nonagonal number at index n |
|
~.Math.nonagonalCentered(n, /) |
≥ 0.3.51 | centered nonagonal number at index n |
|
~.Math.decagonal(n, /) |
≥ 0.3.27a4 | decagonal number at index n |
|
~.Math.decagonalCentered(n, /) |
≥ 0.3.51 | centered decagonal number at index n |
|
~.Math.hendecagonal(n, /) |
≥ 0.3.51 | hendecagonal number at index n |
|
~.Math.hendecagonalCentered(n, /) |
≥ 0.3.51 | centered hendecagonal number at index n |
|
~.Math.dodecagonal(n, /) |
≥ 0.3.51 | dodecagonal number at index n |
|
~.Math.dodecagonalCentered(n, /) |
≥ 0.3.51 | centered dodecagonal number at index n |
|
~.Math.tridecagonal(n, /) |
≥ 0.3.51 | tridecagonal number at index n |
|
~.Math.tridecagonalCentered(n, /) |
≥ 0.3.51 | centered tridecagonal number at index n |
|
~.Math.pronic(n, /) |
≥ 0.3.51 | pronic number at index n |
|
~.Math.star(n, /) |
≥ 0.3.51 | star number at index n |
|
3-polytopes (polyhedra) | |||
~.Math.tetrahedral(n, /) |
≥ 0.3.51 | tetrahedral number at index n |
|
~.Math.tetrahedralCentered(n, /) |
≥ 0.3.51 | centered tetrahedral number at index n |
|
~.Math.cube(n, /) |
≥ 0.3.51 | cube number at index n (or |
|
~.Math.cubeCentered(n, /) |
≥ 0.3.51 | centered cube number at index n |
|
~.Math.octahedral(n, /) |
≥ 0.3.51 | octahedral number at index n |
|
~.Math.octahedralCentered(n, /) |
≥ 0.3.51 | centered octahedral number at index n |
|
~.Math.stellaOctangula(n, /) |
≥ 0.3.51 | stella octangula number at index n |
|
~.Math.dodecahedral(n, /) |
≥ 0.3.51 | dodecahedral number at index n |
|
~.Math.dodecahedralCentered(n, /) |
≥ 0.3.51 | centered dodecahedral number at index n |
|
~.Math.icosahedral(n, /) |
≥ 0.3.51 | icosahedral number at index n |
|
~.Math.icosahedralCentered(n, /) |
≥ 0.3.51 | centered icosahedral number at index n |
|
4-polytopes | |||
~.Math.pentatope(n, /) |
≥ 0.3.51 | pentatope number at index n |
Class method name | Equivalent to | Lifetime | Returned value |
---|---|---|---|
~.Math.abs(x, /) |
≥ ? (< 0.3.24) | absolute value of x |
|
~.Math.fact(n, /) |
≥ 0.3.26rc3 | factorial of n |
|
~.Math.factFalling(x, n, /) |
≥ 0.3.51 | falling factorial of x at index n |
|
~.Math.factRising(x, n, /) |
≥ 0.3.51 | rising factorial of x at index n |
|
~.Math.ln(x, /) |
≥ 0.3.25 (5th July 2024) | natural logarithm of x |
|
~.Math.log(x, /, base = ...) |
≥ 0.3.25 (5th July 2024) | logarithm of x with specific base |
|
~.Math.log2(x, /) |
≥ 0.3.25 (5th July 2024) | logarithm of x with base 2 |
|
~.Math.log3(x, /) |
≥ 0.3.25 (5th July 2024) | logarithm of x with base 3 |
|
~.Math.log5(x, /) |
≥ 0.3.25 (5th July 2024) | logarithm of x with base 5 |
|
~.Math.log7(x, /) |
≥ 0.3.25 (5th July 2024) | logarithm of x with base 7 |
|
~.Math.log10(x, /) |
≥ 0.3.25 (5th July 2024) | logarithm of x with base 10 |
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.1 (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
.
str
; represents
a string that can be changed.
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.
~.util.ParamVar.fromType()
.
__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).
AttributeError
exception for accessing undefined attribute __module__
after invocation of function typing.get_overloads()
.
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)
.
~.util.ParamVar
and for types instead of callable objects.
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
.
enum.Enum
.
It was meant to be an abstract enumerator class, however, subclassing as class Test(~.util.Abstract, enum.Enum): ...
will not work as intended - it will
cause subclass conflict. Instead consider using enum.Enum
.
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
].
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()
.
aveytense.Color
.
In case of aveytense.Color
class instances invoked is their instance method aveytense.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
.
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()
.
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()
.
no_empty
to noEmpty
.
~.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.
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.
list
built-in.
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.
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:
__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
):
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.
typing.Any
is used. Every parameter also lose their parameter category
(positional, universal, keyword) and their default values:
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.
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
_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:
aveytense.Tense.getGeneric()
. It is recommended to use their __args__
attribute in this case (value types - __args__[1].__args__
).
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. This variation of mode
parameter
isn't the same as in there.
mode
parameter is now insensitive, and added lacking modes: and-nand
, nand-and
, or-nor
and nor-or
.
iterools.groupby
hasattr()
, used to detect many attributes at once via parameter attr
.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
.
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()
.
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(*_)
.
This class method is paired with
~.Tense.union()
.
(v, /)
is now an overload.
(v, /)
is now an overload.
(v, /)
is now an overload.
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.
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
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.
bool(~.Tense.isDict(...))
if type hinting doesn't work as intended.
(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
.
(v, /)
is now an overload.
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)
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.
bool(~.Tense.isFrozenSet(...))
if type hinting doesn't work as intended.
__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.
(v, /)
is now an overload.
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)
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.
bool(~.Tense.isList(...))
if type hinting doesn't work as intended.
(v, /)
is now an overload.
None
.
(v, /)
is now an overload.
type
allows to enhance set type checking. For union types, wrap types in a tuple. Examples:
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.
bool(~.Tense.isSet(...))
if type hinting doesn't work as intended.
_Mode = Literal["and", "or", MODE_AND, MODE_OR]
)
(v, /)
is now an overload.
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)
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.
bool(~.Tense.isTuple(...))
if type hinting doesn't work as intended.
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.
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.
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.bool(~.Tense.isTuple2(...))
if type hinting doesn't work as intended.
condition
or default
, if none satisfied condition
. This class method is
paired with
~.Tense.first()
class method.
default
.
default
.
str.count()
string method
works, just it applies to de facto every type of sequences.
random.choice()
.
secure
to generate cryptographically safe result.
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.
secure
(see note above).
vf
(alias to values-frequencies) with given chances. Unlike for
random.sample()
,
no item repetition is used as with parameter counts
, and an internal dictionary is created instead of list, to be used for
~.Tense.pick()
class method.
This class method bases on the math probability defintion.
In-code syntax would be (<>
- required, []
- optional):
1
and non-sequence-non-mapping values are passed, the code treats all of the values with the same chance of dropping (~.Tense.pick()
. In reality this class method invokes ~.Tense.probability3()
class method;
before 0.3.46 its internal code was way more complex and also too repetitive in case of statements, what was less efficient.
Ellipsis
.
Since only two-item lists are passed, then 0
and "side"
have the weakest chances to return themselves.
(*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.
~.Tense.probability()
gets 2 values. Probability of returning x
with probability x
with probability ~.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.
~.Tense.probability()
:
x
with y
with y
is returned. Since both of these parameters are equal, there is no matter which one will be returned.
==
operator, which can be manipulated by defining the __eq__()
special dunder method.
If it is not defined wisely (e.g. not boolean value returned), this can lead to unintentional error. Most common is
TypeError
deriving from unsupported types
when using this operator. On 0.3.51 provided TypeError
catching statement to prevent this.
(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
.
sys.maxsize
attribute, there was a
special attribute ~.TenseOptions.disableProbability2LengthLimit, which was defined on 0.3.31 and became operational on 0.3.33. Reason there was such
limit was because internal code used a list that was subsequently used in ~.Tense.pick() class method in order to return the value. And due to play
of the attribute sys.maxsize
there, limit varied due to system's architecture (~.TenseOptions.disableProbability2LengthLimit
.
TypeError
catching when comparing x
with y
using ==
operator. See warning note above.
~.Tense.probability()
class method. In contrast to ~.Tense.probability()
, it also operates on many values, however, difference is
that vf
parameter only accepts a mapping with at least 2 pairs. Value (there 1
).
vf
parameter isn't variable as in ~.Tense.probability()
, and its internal code is shorter, ~.Tense.probability3()
is circa 3 times faster than ~.Tense.probability()
.
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.
value
specified amount of times
and returns a generator. In previous versions this class method can return a list.
[::-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()
, just returns
reference to ~.Tense
instead of None
.
time.time()
function to an internal variable,
and using the while
loop with statement while time.time() - <var> ≥ seconds: <var> = time.time()
.
itertools.starmap
.
str.startwith()
and
bytes.startwith()
that
allows to inspect many values at once.
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()
.
statement
. This class method is simplified version of
timeit.timeit()
function. 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.
aveytense
.
tkinter.StringVar
tkinter.IntVar
tkinter.StringVar
aveytense.constants.VERSION
.
For example: for version 0.3.48 returned is string "0.3.48"
.
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.
~.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() .
|
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:
aveytense.util.uniquelist
class constructor is almost the same (without type hinting) as:
aveytense.Tense.inequal()
with unpacking operator *
as aveytense.Tense.inequal(*aveytense.util.uniquelist(iterable))
.
tuple
object without duplicate items,
as well without order change. In AveyTense code it is the same as tuple(aveytense.util.uniquelist(...))
.
range()
function.
Represents the easiest function to return abroad objects.
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 parametervalue1
(former name: __value1
) - The only mandatory parameter. And this parameter supports abundant gamut of types, including integers, but also floating-point numbers,
complex numbers, sizeable objects, including string, list, tuple, dictionairies etc. These obscure with types supported by reckon()
function; the abroad()
function uses
this function in reality. This parameter is a blend of range()
function parameters __stop
(if it is the only parameter passed) and __start
(if there are more
than one argument passed).
value2
(Optional; former name: __value2
) - First optional parameter. Supports all sizeable objects from parameter value1
, integers, floats, boolean values, the None
type and also ellipsis. Defaults to None
. This parameter is counterpart of range()
function parameter __stop
.
modifier
(Optional; former name: __modifier
) - Second optional parameter. Supports all sizeable objects from parameter value1
, integers, floats, complex numbers, the None
type and also ellipsis. Defaults to None
. This parameter is counterpart of range()
function parameter __step
.
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()
!
range()
function:
list ((6 )) [-6, -5, -4, -3, -2, -1]
list (range (6 )) []
aveytense_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
.