Python3 - How do I import a class from another file

Chris Angelico rosuav at gmail.com
Tue Dec 10 07:53:00 EST 2019


On Tue, Dec 10, 2019 at 11:46 PM R.Wieser <address at not.available> wrote:
>
> Chris,
>
> > Well, that's exactly what happens.
>
> So, only the reference count gets lowered.  Yep, thats daft.
>
> ... unless you explain why it can only be done that way.

Okay. What should happen when you do this?

x = 5
del x

Should the integer 5 be deleted?

> > Also, when you scorn something without knowing your facts,
> > you tend to make yourself look like a fool :)
>
> I tend to go with logic.   No logic => it most likely doesn't work that way.
>
> Choosing to go with a delayed action like you say will, as I already
> explained, create problems later on (race conditions everywhere).  And as I
> do not think the designers of the language where that stupid I must
> therefore reject your claim to what you think happens.
>
> But, as you mentioned, I do not know (all) the facts.  Please do present
> them.   Maybe there is a logic in there I do not yet see.
>
> > Check out the 'with' statement.
>
> I'm sorry, but nope.
>
> Rule one: When debugging do *not* throw more stuff at a problem than what is
> neccessary to make it show its ugly head.
> Rule two: When in doubt, see rule One. :-)

So the language designers couldn't possibly have been so stupid as to
do things this way, but you're going to ignore what they did? Cool.
Bye!

ChrisA


More information about the Python-list mailing list