support icon indicating copy to clipboard operation
support copied to clipboard

[Feature] Allow importing/instantiating Python classes

Open laurensvalk opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. We can import functions (and classes) but not instantiate class objects.

This has been requested a few times and could potentially be useful for third party devices.

This would let you setup devices much like motors and sensors, but backed by your own sensor class.

Describe the solution you'd like It is not entirely clear how this should work.

Describe alternatives you've considered Create the instance in Python, or methods operating on that singleton, and import those. But then you can't choose things like the port.

laurensvalk avatar Mar 08 '24 14:03 laurensvalk

See also https://github.com/pybricks/support/issues/1635

laurensvalk avatar Feb 21 '25 11:02 laurensvalk

Instantiating can actually be done. The difficulty is in calling methods.

laurensvalk avatar Feb 21 '25 11:02 laurensvalk