Principal Software Engineer at Red Hat Working on Ansible
Creator and Maintainer of dynaconf.com
Fellow Member of the Python Software Foundation
Aspiring Rustacean
🇧🇷 🇵🇹
Location
Viana do Castelo, Portugal
Education
Information Systems
Pronouns
he/him
Work
Principal Software Engineer at Red Hat for Ansible
This is considered harmful because you are assigning a mutable object in a method definition, all instances of Block will be mutating the same data reference.
Also timestamp=time() will be evaluated in the time the class is defined, when the program is started, if this is a long running process then you are stuck with a certain time()
Great article :)
This is considered harmful because you are assigning a mutable object in a method definition, all instances of
Block
will be mutating the samedata
reference.Consider changing to
Also
timestamp=time()
will be evaluated in the time the class is defined, when the program is started, if this is a long running process then you are stuck with a certaintime()
Fully agree @rochacbruno
The idea of the code was keeping it exactly the same as the Javascript for learning purposes but your comment is a perfect helper for the post. ♥
I have just changed it as per your comments.
Thank you!