You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across a function in pygsti version 0.9.11.2 that has a mutable default argument. This can lead to nasty bugs, as described here. Once I found the first bug of this kind, I ran some searches and found several more. See below for a list.
Search results
I ran a regex search for strings of the form =[]<characters here>): [1] and found the following hits:
If I search for strings of the form ={}<characters here>): [2], I get
Footnotes
[Footnote 1] <insert characters here> is a placeholder for any character sequence that excludes new lines. The actual regex I used was =\[\].+\):. Note that this doesn't capture all possible cases where we have mutable default arguments, since it will miss cases of multi-line function definitions where the mutable argument isn't on the last line.
[Footnote 2] The actual regex I used was =\{\}.+\):.
You can search for both patterns I checked with =[\{\[][\}\]].+\):.
The text was updated successfully, but these errors were encountered:
I came across a function in pygsti version 0.9.11.2 that has a mutable default argument. This can lead to nasty bugs, as described here. Once I found the first bug of this kind, I ran some searches and found several more. See below for a list.
Search results
I ran a regex search for strings of the form
![image](https://private-user-images.githubusercontent.com/10662932/275594477-12eead34-ed88-4c16-ae16-a32ae0c11643.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NjM2MTcsIm5iZiI6MTczOTY2MzMxNywicGF0aCI6Ii8xMDY2MjkzMi8yNzU1OTQ0NzctMTJlZWFkMzQtZWQ4OC00YzE2LWFlMTYtYTMyYWUwYzExNjQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDIzNDgzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU2YmZlN2NjNGNiNWRhY2I3ZDNkNjA0YjIxZDQzOGEwZmE5MzEyZDk3YjcyNjJmNWM0MDVjYzYxMmZmN2M0OWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JmD7w7QcQ4UGRt5akDw4AyS7SZHrF73CQ2dV1fQ5apE)
=[]<characters here>):
[1] and found the following hits:If I search for strings of the form
![image](https://private-user-images.githubusercontent.com/10662932/275596700-e4115220-526b-43ab-9806-e33d5fa6d97f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NjM2MTcsIm5iZiI6MTczOTY2MzMxNywicGF0aCI6Ii8xMDY2MjkzMi8yNzU1OTY3MDAtZTQxMTUyMjAtNTI2Yi00M2FiLTk4MDYtZTMzZDVmYTZkOTdmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDIzNDgzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIwODgyMDhhMDIzN2ZlOTVlMzBlODBmYzlhZjA2Y2YwMGQyZTFlYzM5ODNmYTkwYWEzMWFjMmM3NWFjNmQzYjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.lVx7zI3OlD6FG44szJSwCJhzezY13CSZdmW1okcKbyE)
={}<characters here>):
[2], I getFootnotes
[Footnote 1]
<insert characters here>
is a placeholder for any character sequence that excludes new lines. The actual regex I used was=\[\].+\):
. Note that this doesn't capture all possible cases where we have mutable default arguments, since it will miss cases of multi-line function definitions where the mutable argument isn't on the last line.[Footnote 2] The actual regex I used was
=\{\}.+\):
.You can search for both patterns I checked with
=[\{\[][\}\]].+\):
.The text was updated successfully, but these errors were encountered: