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
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
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.
>
>
>
>
>
>
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
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
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
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