Author stefan.richthofer
Recipients jeff.allen, stefan.richthofer, wymannmi, zyasoft
Date 2017-02-02.15:03:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> On the face of it, 2 sounds masssively confusing for anyone who attempts to debug code that involves it.

Agreed. To be clear: I also don't like this solution very much and I'm concerned about possible consequences. However it still is the best approach I found so far to deal with the platform-detection problem on the whole. I once discussed it also with Jim and he agreed on that solution (at least for JyNI).

> at least the repr should tell you it's not just a str

Sure. And there should be a big fat warning in __doc__ and javadoc about it. (The PyShadowString in JyNI linked above is just a draft.)

One more thing: This only works for
sys.platform == "posix" or so,
not for
"posix" == sys.platform
(too bad, in Python '==' is asymmetric :-/ )
We would have to make PyString aware of PyShadowString (or whatever we would cal it) and have it delegate the check to the PyShadowString if compared to one.
Actually "posix" == sys.platform style is rare, but I stumbled on it e.g. in PyOpenGL. So far I just changed the source; one of the reasons to have JyOpenGL. (If this would go into Jython, it might be possible (together with the advances in #527524) for JyNI to support upstream PyOpenGL)
Date User Action Args
2017-02-02 15:03:05stefan.richthofersetmessageid: <>
2017-02-02 15:03:05stefan.richthofersetrecipients: + stefan.richthofer, zyasoft, jeff.allen, wymannmi
2017-02-02 15:03:05stefan.richthoferlinkissue2521 messages
2017-02-02 15:03:04stefan.richthofercreate