Skip to content

Commit

Permalink
Merge branch 'modular:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rcghpge authored Feb 4, 2025
2 parents 3ec610f + e064839 commit 7907b3b
Show file tree
Hide file tree
Showing 7 changed files with 571 additions and 586 deletions.
245 changes: 121 additions & 124 deletions examples/life/magic.lock

Large diffs are not rendered by default.

221 changes: 109 additions & 112 deletions examples/magic.lock

Large diffs are not rendered by default.

221 changes: 109 additions & 112 deletions examples/operators/magic.lock

Large diffs are not rendered by default.

221 changes: 109 additions & 112 deletions examples/testing/magic.lock

Large diffs are not rendered by default.

221 changes: 109 additions & 112 deletions magic.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions stdlib/src/python/_bindings.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ fn python_type_object[
# Zeroed item terminator
slots.append(PyType_Slot.null())

var type_spec = PyType_Spec {
var type_spec = PyType_Spec(
# FIXME(MOCO-1306): This should be `T.__name__`.
name: type_name.unsafe_cstr_ptr(),
basicsize: sizeof[PyMojoObject[T]](),
itemsize: 0,
flags: Py_TPFLAGS_DEFAULT,
type_name.unsafe_cstr_ptr(),
sizeof[PyMojoObject[T]](),
0,
Py_TPFLAGS_DEFAULT,
# Note: This pointer is only "read-only" by PyType_FromSpec.
slots: slots.unsafe_ptr(),
}
slots.unsafe_ptr(),
)

# Construct a Python 'type' object from our type spec.
var type_obj = cpython.PyType_FromSpec(UnsafePointer.address_of(type_spec))
Expand Down
14 changes: 7 additions & 7 deletions stdlib/src/python/_cpython.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ struct PyType_Slot:

@staticmethod
fn null() -> Self:
return PyType_Slot {slot: 0, pfunc: OpaquePointer()}
return PyType_Slot(0, OpaquePointer())


@value
Expand Down Expand Up @@ -1055,12 +1055,12 @@ struct CPython:
)

_ = v
return PyKeysValuePair {
key: key,
value: value,
position: position.take_pointee(),
success: result == 1,
}
return PyKeysValuePair(
key,
value,
position.take_pointee(),
result == 1,
)

# ===-------------------------------------------------------------------===#
# Python Module operations
Expand Down

0 comments on commit 7907b3b

Please sign in to comment.