Search code examples
pythonpyephem

Difference between ephem.date(. . .) and ephem.Date(. . .) in PyEphem


Is there a difference between behaviour of ephem.date(. . .) and ephem.Date(. . .) in PyEphem? As far as I can see, both have the same effect.


Solution

  • The nice thing about python is that you can usually read the source code.

    I found my pyephem installed in /usr/lib64/python2.7/site-packages/ephem/ and in there was the comment:

    # For backwards compatibility, provide lower-case names for our Date
    # and Angle classes, and also allow "Lon" to be spelled "Long".
    date = Date
    angle = Angle
    LongLatCoordinate = LonLatCoordinate
    

    so you are right ephem.date() and ephem.Date() are the same, but Date is preferred.