osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What might cause my sample program to forget that already imported datetime?


On 10/12/20 7:20 AM, Chris Angelico wrote:
> This is yet another reason that "from MODULE import *" is a bad idea.
> Instead, just import the module itself, and take whatever you need.

Or just import the objects that you need;

from datetime import datetime, SYMBOL, etc...

I use Decimal a lot.  I would hate to have to write "decimal.Decimal(str)"
for example.

Whichever method you use the most important thing is to be consistent as
much as possible.

-- 
D'Arcy J.M. Cain
Vybe Networks Inc.
A unit of Excelsior Solutions Corporation - Propelling Business Forward
http://www.VybeNetworks.com/
IM:darcy at VybeNetworks.com VoIP: sip:darcy at VybeNetworks.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20201013/9d80fd3b/attachment.sig>