Re: [Python.NET] Passing in null as the value for a nullable type.

2014-02-05 Thread John Gill
That's what I thought too... but.. In [82]: System.Nullable[System.DateTime]() --- TypeError Traceback (most recent call last) in () > 1 System.Nullable[System.DateTime]() TypeError: no co

Re: [Python.NET] Passing in null as the value for a nullable type.

2014-02-05 Thread John Gill
Thanks Brad. I think I understand what is happening now. Note that the C# code I posted works fine, you can pass in Null as mydate. DateTime? mydate Gets translated by the C# compiler to System.Nullable mydate. When you pass in null to the method C# sets up a Nullable with the HasValue set

Re: [Python.NET] Passing in null as the value for a nullable type.

2014-02-05 Thread Zane D. Purvis
Try System.Nullable[System.DateTime]() I haven't tested that, but I think that's what you need. On Wed, Feb 5, 2014 at 1:25 PM, John Gill wrote: > Thanks. At least on my system there is no such thing as System.Null > > > > In c# at least, null is just a keyword in the language. > > > > > >

Re: [Python.NET] Passing in null as the value for a nullable type.

2014-02-05 Thread Brad Friedman
DateTime is a struct. You have to pass a value. It should not take null. If you tried to do that in c# it would not allow it either. > On Feb 5, 2014, at 11:46 AM, John Gill wrote: > > I am sure there is a really simple answer to this one… but so far it is > eluding me. > > I have a class

Re: [Python.NET] Passing in null as the value for a nullable type.

2014-02-05 Thread John Gill
Thanks. At least on my system there is no such thing as System.Null In c# at least, null is just a keyword in the language. From: PythonDotNet [mailto:pythondotnet-bounces+jgill=tokiomillennium@python.org] On Behalf Of Tribble, Brett Sent: Wednesday, February 05, 2014 1:45 PM To: A list

Re: [Python.NET] Passing in null as the value for a nullable type.

2014-02-05 Thread Tribble, Brett
I believe you want to import System and pass System.Null. I can't remember if I've done this, but I think so. From: PythonDotNet [mailto:pythondotnet-bounces+btribble=ea@python.org] On Behalf Of John Gill Sent: Wednesday, February 05, 2014 8:47 AM To: pythondotnet@python.org Subject: [Python

[Python.NET] Passing in null as the value for a nullable type.

2014-02-05 Thread John Gill
I am sure there is a really simple answer to this one... but so far it is eluding me. I have a class something like this: public class Foo { ... public int process_date(DateTime? mydate) { ... } } I want to call this from python using pythondotnet. Calling it like this work