如何将 PyObject 转换为 java 布尔类型
我想将 org.python.core.PyObject 转换为 java.lang.Boolean。 类似于:
boolean i = ((Boolean) PyObject).booleanValue();
I would like to cast org.python.core.PyObject to java.lang.Boolean.
Something similar to:
boolean i = ((Boolean) PyObject).booleanValue();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需尝试以下操作:
Just try the following:
你应该使用Python标准对象接口nonzero方法:(
它被称为“nonzero”,因为它在Python有布尔类型之前就已经存在了,而且Guido的方法有时很神秘)
You should use the Python standard object interface nonzero method:
(it's called "nonzero" because it existed before Python had a boolean type and Guido's ways are mysterious sometimes)