deno_python icon indicating copy to clipboard operation
deno_python copied to clipboard

errors when setting properties on a class that extends python class

Open sigmaSd opened this issue 7 months ago • 3 comments

import { python } from "https://deno.land/x/[email protected]/mod.ts";

const gi = python.import("gi");
gi.require_version("Gtk", "4.0");
const Gtk = python.import("gi.repository.Gtk");

class MainWindow extends Gtk.ApplicationWindow {
  constructor() {
    super();
    this.a = 4; // error here
  }
}
console.log(new MainWindow());
error: Uncaught TypeError: 'set' on proxy: trap returned falsish for property 'a'
    this.a = 4;
          ^
    at new MainWindow (file:///home/mrcool/dev/deno/lab/b.ts:10:11)
    at file:///home/mrcool/dev/deno/lab/b.ts:14:13

more info here https://github.com/denosaurs/deno_python/issues/53#issuecomment-1797864483

sigmaSd avatar Nov 08 '23 05:11 sigmaSd