Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

PyDictWrapper keys/values broken in Python 3 #160

Open

Description

@devinrsmith

Calling PyDictWrapper#keys or PyDictWrapper#values in the context of Python 3 causes

RuntimeError: java.lang.ClassCastException: Can not convert non-list type to a list!
    at org.jpy.PyObject.asList(PyObject.java:256)
    at org.jpy.PyDictWrapper.keySet(PyDictWrapper.java:112)

Dictionary keys and values are views in Python 3.

https://blog.labix.org/2008/06/27/watch-out-for-listdictkeys-in-python-3

Activity

  1. devinrsmith commented on Jan 16, 2019

    @devinrsmith
    ContributorAuthor

    Also, has_key is no longer a method on dict in Python 3. https://portingguide.readthedocs.io/en/latest/dicts.html

  2. devinrsmith commented on Jan 16, 2019

    @devinrsmith
    ContributorAuthor

    (Will be submitting MR soon)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions