Replies: 4 comments 3 replies
-
Your "expansion axial" example there feels like it should be caught by our unit tests. We run the same tests in Python 3.9 - 3.12, you'd think we would have noticed this. Perhaps we need to add a test? |
Beta Was this translation helpful? Give feedback.
-
Wait, is someone calling the private |
Beta Was this translation helpful? Give feedback.
-
@jakehader shared this, which might explain it But @john-science was writing a unit test and found the ordering is not guaranteed in py39. So the I would argue the |
Beta Was this translation helpful? Give feedback.
-
We just found out that I don't like that, so I'll just fix it to be alphabetical. Consistency is better than randomness. |
Beta Was this translation helpful? Give feedback.
-
Converting unordered flags to a string may or may not be dangerous. A downstream repo certainly is using it in a dangerous way. Here's the code:
armi/armi/reactor/flags.py
Lines 180 to 188 in 96a5c88
Maybe this is a #wontfix thing and people just need to not do dangerous things. But I wanted to demonstrate how this could be used in a dangerous way.
Say you want to get a parameter,
rxFuelAxialExpansionCoeffPerTemp
. You have the following info:type = "Fuel"
andflags = AXIAL | EXPANSION
.In python 3.9 when you call
flags.toString()
, you get"Axial Expansion"
. You can remove the space and use that to construct your parameter name. In python 3.11, you get"Expansion Axial"
, in which case you need to know ahead of time to flip the flags before moving forward.Beta Was this translation helpful? Give feedback.
All reactions