Skip to main content

Immutable-Python-type

package for make immutable all types in Python

Support types and replaced by:

  • int = Int_()
  • float = Float_()
  • str = Str_()
  • bool = Bool_()
  • set = Set_()
  • tuple = Tuple_()
  • list = List_()
  • dict = Dict_()

Examples

from immutableType import Bool_, Int_

immutable_bool = Bool_(True) # init immutable boolean
immutable_int = Int_(1) # init immutable integer

immutable_bool.bool_ = 1234 # raise an error
immutable_bool.bool_ = False # good

print(immutable_int == immutable_bool) # print False
"""
Immutable boolean consider True = 1 and False = 0
"""

Int_(integer: int)

from immutableType import Int_

my_int = Int_(1234) # init immutable integer
my_int.int_ # property to get the value in 'int' type

Int_() have methods :

  • __str__ : return string with the integer value
  • __int__ : return the integer value
  • __bool__ : return True if the value == 1 else False
  • __eq__, __and__, __or__, __iand, __ior__ : basic comparaison
  • __add__, __sub__, __iadd__, __isub__, __mul__, __imul__, __truediv__, __itruediv__, __pow__, __ipow__ : basic operation (only int value are accepted for operation. The result of a division is always an integer. Use Float_ class for more precision.)

redaction in progress...

Release files for immutable-Python-Type 1.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for immutable-Python-Type 1.2.3
File Size Uploaded
immutable_python_type-1.2.3.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for immutable-Python-Type 1.2.3
File Interpreter ABI Platform
immutable_python_type-1.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 25.2 kB

Release files / immutable_python_type-1.2.3.tar.gz

Download URL immutable_python_type-1.2.3.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c4836a28fcb5c97a57aa1c28fec87d715f08684e25954f2c9df3bd081ab6f515
BLAKE2b-256 checksum
How to use checksums
5234db0316fae7585f9a54ce6c504b3d2fc95ae42192081b0ffaf6bc4440a948
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release files / immutable_python_type-1.2.3-py3-none-any.whl

Download URL immutable_python_type-1.2.3-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bec90a8b015f0619036dd336073edf26a98a3691d25dd67d4698cf3b1cc41652
BLAKE2b-256 checksum
How to use checksums
1abcaf572b5bde48d9011a35d6e14da6e2d4fe8340f8c1ae52210b1a7b2e17ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.2.3 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page