datetime.datetime. or datetime. ?

niklasr niklasro at gmail.com
Sat Oct 10 11:22:03 CEST 2009


On Oct 8, 7:34 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> niklasr schrieb:
>
>
>
> > On Oct 8, 5:25 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> >> NiklasRTZ schrieb:
>
> >>> Hello, my basic question is which recommendation is after slight
> >>> restructuring datetime.datetime to datetime
> >>> Both works but only one should be chosen probably adjust my package to
> >>> comply to dependencies.
> >>> Spec integrated code where datetime.datetime.now() refactored to
> >>> datetime.now()
> >>> set rather
> >>> from datetime import datetime, timedelta
> >>> than
> >>> import datetime
> >>> or no matter and completely flexible (then why gae error that
> >>> datetime.datetime wasn't datetime?)
> >>> Naturally better not to customize external dependencies but seemingly
> >>> impossible to use both for a little xmpp project.
> >>> Thanks with best regards
> >> Some remarks:
>
> >>   - whitespace is significant. In python. And in posting here.
>
> >>   - please show us the exact traceback you get, and a minimal example
> >> that produces it.
>
> >>   - how to import is mostly a matter of taste, as long as you refrain
> >> from using "from datetime import *"e
>
> >> Diez
>
> > type object 'datetime.datetime' has no attribute 'datetime' Traceback
> > (most recent call last):
> > is flexible, both ways worked just that self complying towards more
> > professional projects naturally feels right. Above error log seemingly
> > caused by import datetime instead of from datetime import datetime.
> > Then changed import and cut the first datetime occurance which looks
> > good but breaks next sync with other. The project is the crowdguru
> > xmpp chat test reachable via gae app "classifiedsmarket@
> > {gmail,appspot}" currently importing
> > from datetime import datetime, timedelta
> > instead of
> > import datetime
> > Many thanks for the help and all further recommendation
> > code disponible montao.googlecode.com
>
> I'm sorry, but this gibberish is beyond what I'm willing to decipher.
> Good luck with somebody else doing so & helping you.
>
> Diez
Ok: Naming a class or function the same name the module is,
datetime.datetime is confusing or what?, you won't know module from
class from method. Thank you, at least one can inform what's
deciphered instead of only baptizing it, system spec
"datetime.datetime" or hasty handling description. Deciphering system
text "datetime.datetime...." we won't know module from class or
method.
It's more a question of internal forward compatibility than liking or
disliking output.



More information about the Python-list mailing list