File tree Expand file tree Collapse file tree 4 files changed +17
-0
lines changed
Expand file tree Collapse file tree 4 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 4545- Luke Stratman ([ @lstratman ] ( https://github.com/lstratman ) )
4646- Konstantin Posudevskiy ([ @konstantin-posudevskiy ] ( https://github.com/konstantin-posudevskiy ) )
4747- Matthias Dittrich ([ @matthid ] ( https://github.com/matthid ) )
48+ - Meinrad Recheis ([ @henon ] ( https://github.com/henon ) )
4849- Mohamed Koubaa ([ @koubaa ] ( https://github.com/koubaa ) )
4950- Patrick Stewart ([ @patstew ] ( https://github.com/patstew ) )
5051- Raphael Nestler ([ @rnestler ] ( https://github.com/rnestler ) )
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
1414- Added support for Jetson Nano.
1515- Added support for __ len__ for .NET classes that implement ICollection
1616- Added PythonException.Format method to format exceptions the same as traceback.format_exception
17+ - Added Runtime.None to be able to pass None as parameter into Python from .NET
18+ - Added PyObject.IsNone() to check if a Python object is None in .NET.
1719
1820### Changed
1921
Original file line number Diff line number Diff line change @@ -979,6 +979,10 @@ public bool IsTrue()
979979 return Runtime . PyObject_IsTrue ( obj ) != 0 ;
980980 }
981981
982+ /// <summary>
983+ /// Return true if the object is None
984+ /// </summary>
985+ public bool IsNone ( ) => CheckNone ( this ) == null ;
982986
983987 /// <summary>
984988 /// Dir Method
Original file line number Diff line number Diff line change @@ -473,6 +473,16 @@ private static void ResetPyMembers()
473473 internal static IntPtr PyNone ;
474474 internal static IntPtr Error ;
475475
476+ public static PyObject None
477+ {
478+ get
479+ {
480+ var none = Runtime . PyNone ;
481+ Runtime . XIncref ( none ) ;
482+ return new PyObject ( none ) ;
483+ }
484+ }
485+
476486 /// <summary>
477487 /// Check if any Python Exceptions occurred.
478488 /// If any exist throw new PythonException.
You can’t perform that action at this time.
0 commit comments