Scala 2.13.14 test:
scala-cli -j system -S 2.13.14 --dep org.python:jython-standalone:2.7.1b3
scala> val x = new org.python.core.PyList
val x: org.python.core.PyList = []
scala> import scala.jdk.CollectionConverters._
import scala.jdk.CollectionConverters._
scala> x.asScala
val res0: scala.collection.mutable.Buffer[_] = Buffer()
same simple test with Scala 3.3.3:
scala-cli -j system -S 3.3.3 --dep org.python:jython-standalone:2.7.1b3
Welcome to Scala 3.3.3 (21.0.3, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> val x = new org.python.core.PyList
val x: org.python.core.PyList = []
scala> import scala.jdk.CollectionConverters.*
scala> x.asScala
-- [E008] Not Found Error: -----------------------------------------------------
1 |x.asScala
|^^^^^^^^^
|value asScala is not a member of org.python.core.PyList
1 error found
Take into account that PyList
is just a wrapper around java.util.List
:
public class PyList extends PySequenceList implements List {
....
}