HaxeFoundation / HaxeFoundation/haxe

[python] AttributeError for a class without constructor

Open
#7,541 2 comments 0 reactions 1 assignee Claimed by @frabbit View on GitHub
bug platform-python
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
class Main {
static function main() {
var c = new Bar();
trace(c.foo());
}
}

class Bar extends Foo {
public function new() {}
}

class Foo {
var v:Int;
public function foo() {
return v == null;
}
}
```

```
Traceback (most recent call last):
File "bin/python/tests.py", line 43, in
Main.main()
File "bin/python/tests.py", line 11, in main
print(str(Bar().foo()))
File "bin/python/tests.py", line 18, in foo
return (self.v is None)
AttributeError: v
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.