Rename basicpy_None_type to basicpy_NoneType to match native spelling.

* Also adds Basicpy.py to tests.
pull/1/head
Stella Laurenzo 2020-05-06 19:07:50 -07:00
parent 644d9fb0d3
commit 680e11ae62
3 changed files with 8 additions and 7 deletions

View File

@ -17,25 +17,25 @@ class DialectHelper(_BaseDialectHelper):
>>> h = DialectHelper(c)
Dialect Types:
>>> h.basicpy_None_type
>>> h.basicpy_NoneType
!basicpy.NoneType
>>> h.basicpy_Ellipsis_type
>>> h.basicpy_EllipsisType
!basicpy.EllipsisType
>>> h.basicpy_SlotObject_type(
... "foobar", h.basicpy_None_type, h.basicpy_None_type)
... "foobar", h.basicpy_NoneType, h.basicpy_NoneType)
!basicpy.SlotObject<foobar, !basicpy.NoneType, !basicpy.NoneType>
singleton op:
>>> m = c.new_module()
>>> h.builder.insert_block_start(m.first_block)
>>> _ = h.basicpy_singleton_op(h.basicpy_None_type)
>>> _ = h.basicpy_singleton_op(h.basicpy_NoneType)
>>> m.to_asm().strip()
'module {\n %0 = basicpy.singleton : !basicpy.NoneType\n}'
slot_object ops:
>>> m = c.new_module()
>>> h.builder.insert_block_start(m.first_block)
>>> v0 = h.basicpy_singleton_op(h.basicpy_None_type).result
>>> v0 = h.basicpy_singleton_op(h.basicpy_NoneType).result
>>> slot_object = h.basicpy_slot_object_make_op("foobar", v0, v0).result
>>> _ = h.basicpy_slot_object_get_op(slot_object, 0)
>>> print(m.to_asm().strip())

View File

@ -21,12 +21,12 @@ public:
static void bind(py::module m) {
py::class_<BasicpyDialectHelper, PyDialectHelper>(m, "BasicpyDialectHelper")
.def(py::init<std::shared_ptr<PyContext>>())
.def_property_readonly("basicpy_None_type",
.def_property_readonly("basicpy_NoneType",
[](BasicpyDialectHelper &self) -> PyType {
return Basicpy::NoneType::get(
&self.context->context);
})
.def_property_readonly("basicpy_Ellipsis_type",
.def_property_readonly("basicpy_EllipsisType",
[](BasicpyDialectHelper &self) -> PyType {
return Basicpy::EllipsisType::get(
&self.context->context);

View File

@ -7,6 +7,7 @@ import sys
TEST_MODULES = (
"npcomp.mlir_ir_test",
"npcomp.dialect.Basicpy",
"npcomp.dialect.Numpy",
"npcomp.tracing.context",
"npcomp.tracing.mlir_trace",