Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ca474a

Browse files
committed
PyType Dict and MRO properties to assist debugging
1 parent b0c25c1 commit 5ca474a

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/runtime/pyobject.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ public bool TypeCheck(PyType typeOrClass)
253253
return Runtime.PyObject_TypeCheck(obj, typeOrClass.obj);
254254
}
255255

256+
internal PyType PyType => this.GetPythonType();
257+
256258

257259
/// <summary>
258260
/// HasAttr Method

src/runtime/pytype.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ internal TypeFlags Flags
6363
set => Util.WriteCLong(this, TypeOffset.tp_flags, (long)value);
6464
}
6565

66+
internal PyDict Dict => new(Util.ReadRef(this, TypeOffset.tp_dict));
67+
68+
internal PyTuple MRO => new(GetMRO(this));
69+
6670
/// <summary>Checks if specified object is a Python type.</summary>
6771
public static bool IsType(PyObject value)
6872
{

0 commit comments

Comments
 (0)