serengil / LightPHE

A Lightweight Partially Homomorphic Encryption Library for Python
https://bit.ly/46vWz9w
MIT License
59 stars 6 forks source link

printing ciphertexts not dumping its value #7

Closed serengil closed 11 months ago

serengil commented 11 months ago

repr method should be added for Ciphertext class as well.

class MyClass:
    def __init__(self, value):
        self.value = value

    def __str__(self):
        return f"MyClass instance with value: {self.value}"

    def __repr__(self):
        return f"MyClass({self.value})"

# Create an instance of MyClass
obj = MyClass(42)

# When you print the object
print(obj)  # Calls __str__

# When you directly run the object
obj  # Calls __repr__
serengil commented 11 months ago

Sorted in 0.0.3