title: Python - an identical line of code using datetime fails in one file but not another
body: <p>I have the following lines of code in project A</p>
  
  <pre><code>#filename : mod_dates
  #Handles date calculations etc
  
  import datetime
  
  class datecalcs:
  
      def __init__(self):
          self.__menuChoice = 0
          self.__datemonth = "not set"
          self.__effectivedate = ""
          self.__year = 0
          self.__month = 0
          return None
  
  #
      def interestcouponpaydates(self,effectivedate,couponday):
          self.__effectivedate = effectivedate
  
  
          year, month, day = map(int,self.__effectivedate.split('-'))
  
          print(year)
          print(month)
  
          return self.__effectivedate
  </code></pre>
  
  <p>When I call them from another file with </p>
  
  <pre><code>import mod_dates
  import datetime
  import modcalinputs
  
  datesclass = mod_dates.datecalcs()
  calcInputs = modcalinputs.calcinputs()
  
  #Get the coupon date
  interestdateeffective = calcInputs.interestdateffective()
  interestdatecoupon = calcInputs.interestdatecoupon()
  
  
  x =     datesclass.interestcouponpaydates(interestdateeffective,interestdatecoupon)
  print(x)
  </code></pre>
  
  <p>However this returns an error on the <code>x = datesclass...</code> line of</p>
  
  <pre><code>year, month, day = map(int,self.__effectivedate.split('-'))
  </code></pre>
  
  <p>raises:</p>
  
  <pre><code>&gt; AttributeError: 'datetime.date' object has no attribute 'split'
  </code></pre>
  
  <p>When I run from a similar project to the same line with the same syntax it works fine. Any ideas on what I am doing wrong?</p>