-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
scope:breaking-changeBreaking change, users will need to update their codeBreaking change, users will need to update their codetype:enhancementNew feature or enhancement visitble to usersNew feature or enhancement visitble to users
Milestone
Description
What's needed?
We have a lot of class attributes that are public, so users can mess with them even when it is not safe to do so.
Just as an example, the Anycast channel has:
self.limit: int = maxsize # If changed, the deque is not updated
self.deque: Deque[T] = deque(maxlen=maxsize) # a user could just add or remove stuff without using the condition variable
self.send_cv: Condition = Condition() # users could triggers sends when the deque is full, dropping messages unexpectedly
self.recv_cv: Condition = Condition()
self.closed: bool = False # users could mark the channel as open after it was closed.Proposed solution
Review all class attributes and make them private or read-only as appropriate.
Use cases
No response
Alternatives and workarounds
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
scope:breaking-changeBreaking change, users will need to update their codeBreaking change, users will need to update their codetype:enhancementNew feature or enhancement visitble to usersNew feature or enhancement visitble to users
Type
Projects
Status
Done