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 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 works fine:


     mydate = DateTime(0)



But if I try to pass in a null as the date as follows:




I get:


   TypeError: No method matches given arguments


Hoping there is something really obvious I am missing here.



This communication and any attachments contain information which is confidential and may also be legally privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of disclosure, distribution, copying, printing or use of this communication or the information in it or in any attachments is strictly prohibited and may be unlawful. If you have received this communication in error, please return it with the title "received in error" to and then permanently delete the email and any attachments from your system.


E-mail communications cannot be guaranteed to be secure or error free, as information could be intercepted, corrupted, amended, lost, destroyed, arrive late or incomplete, or contain viruses. It is the recipient's responsibility to ensure that e-mail transmissions and any attachments are virus free. We do not accept liability for any damages or other consequences caused by information that is intercepted, corrupted, amended, lost, destroyed, arrives late or incomplete or contains viruses.


Python.NET mailing list -