Given it is only one enum and given PyQt5/Qt5 has no further development and therefore the enum will never be changed, your approach seems like the simplest and best.
That said, PyQt5 had a long life. Are there any earlier versions of this enum in Qt5 that changed? Maybe eyeball the history of the Qt source file that defines the Qt5 enum on github to see if it ever changed over its life. If not, you should be golden.
Update: It did change very early in Qt 5.0 from the final Qt 4.x series as per:
https://github.com/qt/qtbase/commit/...41ecc95fa976e9
But since that change happened to make Qt 5.0.0 you should be quite safe.
Here is the enum as stated in Qt 5.15.x. You should be good to go.
Code:
enum BoundaryReason {
NotAtBoundary = 0,
BreakOpportunity = 0x1f,
StartOfItem = 0x20,
EndOfItem = 0x40,
MandatoryBreak = 0x80,
SoftHyphen = 0x100
};