On Tue, 07 Aug 2007 02:45:23 +, rbygscrsepda wrote:
Specifically, in Python 1.5, all of the following generate the error
below:
In Python *1.5*!? I somehow doubt that. ;-)
from . import *
from .sibiling_package import *
from .. import *
from ..cousin_package import *
Marc 'BlackJack' Rintsch wrote:
On Tue, 07 Aug 2007 02:45:23 +, rbygscrsepda wrote:
Specifically, in Python 1.5, all of the following generate the error
below:
In Python *1.5*!? I somehow doubt that. ;-)
from . import *
from .sibiling_package import *
from .. import
[EMAIL PROTECTED] writes:
(In addition, it probably would make the program somewhat slower to
have an internal class inside every module, and performance is
important to me, as I'm planning to use this project in a future
game.
This is known as premature optimisation, and it's harmful. It's
On Aug 6, 12:19 am, Ben Finney [EMAIL PROTECTED]
wrote:
[EMAIL PROTECTED] writes:
(In addition, it probably would make the program somewhat slower to
have an internal class inside every module, and performance is
important to me, as I'm planning to use this project in a future
game.
[EMAIL PROTECTED] wrote:
On Aug 6, 12:19 am, Ben Finney [EMAIL PROTECTED]
wrote:
[EMAIL PROTECTED] writes:
(In addition, it probably would make the program somewhat slower to
have an internal class inside every module, and performance is
important to me, as I'm planning to use this project
On Aug 4, 7:10 am, Ben Finney [EMAIL PROTECTED]
wrote:
[EMAIL PROTECTED] writes:
Yes, I'mimporting* for a reason, a good one, I think.
Reading your description, I must say I don't see a good reason.
I have a set of modules (the number planned to reach about 400) that
would be dynamically
[EMAIL PROTECTED] writes:
Yes, I'm importing * for a reason, a good one, I think.
Reading your description, I must say I don't see a good reason.
I have a set of modules (the number planned to reach about 400) that
would be dynamically loaded by my program as needed, and they're
somewhat
Thanks to everybody for replying. (I apologize for the delayed
response: my connection's been down for a week.)
Yes, I'm importing * for a reason, a good one, I think. I have a set
of modules (the number planned to reach about 400) that would be
dynamically loaded by my program as needed, and
Steven D'Aprano a écrit :
(snip)
I do take your point that importing * has the potential to unexpectedly
clobber names you didn't intend,
Another problem is that it makes harder to know from which module a name
comes from.
and that's a good reason to avoid it
unless you have a good reason
Paul Rubin a écrit :
Steven D'Aprano [EMAIL PROTECTED] writes:
I read from module import * as explicitly saying clobber the current
namespace with whatever names module exports. That's what from does: it
imports names into the current namespace. It isn't some sort of easy to
miss side-effect.
On Sat, 28 Jul 2007 09:05:51 +1000, Ben Finney wrote:
[EMAIL PROTECTED] writes:
from . import *
from .sibiling import *
from .. import *
from ..parent_sibling import *
...and so on. The same error occurs:
SyntaxError: 'import *' not allowed with 'from .'
Steven D'Aprano [EMAIL PROTECTED] writes:
I read from module import * as explicitly saying clobber the current
namespace with whatever names module exports. That's what from does: it
imports names into the current namespace. It isn't some sort of easy to
miss side-effect. If a name already
Paul Rubin http://[EMAIL PROTECTED] writes:
Steven D'Aprano [EMAIL PROTECTED] writes:
I read from module import * as explicitly saying clobber the
current namespace with whatever names module exports. That's what
from does: it imports names into the current namespace. It isn't
some sort
Hi, I'm a newbie at Python. :) Right now it's not letting me import *
from any relative package name--i.e., a name that starts with a dot.
For instance, none of the following work:
from . import *
from .sibiling import *
from .. import *
from ..parent_sibling import *
...and so
[EMAIL PROTECTED] writes:
from . import *
from .sibiling import *
from .. import *
from ..parent_sibling import *
...and so on. The same error occurs:
SyntaxError: 'import *' not allowed with 'from .'
Interesting. I know that 'from foo import *' is frowned on and is
Ben Finney [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:
[EMAIL PROTECTED] writes:
from . import *
from .sibiling import *
from .. import *
from ..parent_sibling import *
...and so on. The same error occurs:
SyntaxError: 'import *' not allowed with 'from .'
16 matches
Mail list logo