mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
fix: BaseValue now deepcopies the data_type it receives
- avoids weird situations with refs to a type that gets modified
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""File holding classes representing values used by an FHE program."""
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from copy import deepcopy
|
||||
from functools import partial
|
||||
|
||||
from . import base
|
||||
@@ -13,7 +14,7 @@ class BaseValue(ABC):
|
||||
_is_encrypted: bool
|
||||
|
||||
def __init__(self, data_type: base.BaseDataType, is_encrypted: bool) -> None:
|
||||
self.data_type = data_type
|
||||
self.data_type = deepcopy(data_type)
|
||||
self._is_encrypted = is_encrypted
|
||||
|
||||
def __repr__(self) -> str: # pragma: no cover
|
||||
|
||||
Reference in New Issue
Block a user