gromsterus commented on issue #173:
URL: 
https://github.com/apache/pulsar-client-python/issues/173#issuecomment-1851879380

   1. `list` is a mutable data structure in Python. In your example, new 
instances of class `A` reference and modify the same list object in memory. You 
can read more about this 
[here](https://www.geeksforgeeks.org/use-mutable-default-value-as-an-argument-in-python/).
 
   
   2. The `Record` class has quite simple logic for working with `default`. As 
a solution, you could add a `default_factory` implementation, like 
[here](https://docs.python.org/3/library/dataclasses.html#dataclasses.field). 
Or, do not use `default` and instantiate objects of the `Record` class by 
passing arguments manually.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to