-
Notifications
You must be signed in to change notification settings - Fork 50
Closed
Description
Version
OS: Ubuntu 22.04
Python: 3.10.2
Pulsar: pulsar-client==3.2.0
Minimal reproduce step
from pulsar.schema import Record, Array, Integer
class A(Record):
a = Array(Integer(), required=False, default=[])
# Create a first instance of object A
a = A()
a.a # Correctly show empty list
a.a.append(1) # Adding an integer
a.a # Correctly showing list with single element 1 inside
# Instanciating a second object A
b = A()
b.a # Incorrectly show list with single element 1What did you expect to see?
I expected the A class not to re-use the previous reference to the list.
What did you see instead?
As a developer, instantiating a fresh object in Python generally means it's built from scratch. Therefore, no reference to previously built objects should be used.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels