We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 75faf25 commit 739dd19Copy full SHA for 739dd19
example/classes.zig
@@ -179,9 +179,8 @@ pub const GetAttr = py.class(struct {
179
_ = self;
180
}
181
182
- pub fn __getattr__(self: *const Self, attr: py.PyObject) !py.PyObject {
183
- const attrName = try py.PyString.checked(attr);
184
- const name = try attrName.asSlice();
+ pub fn __getattr__(self: *const Self, attr: py.String) !py.PyObject {
+ const name = try attr.asSlice();
185
if (std.mem.eql(u8, name, "number")) {
186
return py.create(42);
187
0 commit comments