Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49594

Re: PYTHONPATH and module names

Newsgroups comp.lang.python
Date 2013-07-01 14:38 -0700
References <mailman.4074.1372703671.3114.python-list@python.org> <fa971601-b90f-4d1a-81d2-67b0c76e30d1@googlegroups.com> <G7lAt.13847$J_1.8584@newsfe01.iad>
Message-ID <a61cb2f9-bc12-4b25-aa66-4eb901438481@googlegroups.com> (permalink)
Subject Re: PYTHONPATH and module names
From rusi <rustompmody@gmail.com>

Show all headers | View raw


On Tuesday, July 2, 2013 1:24:30 AM UTC+5:30, Tobiah wrote:
> > Are you familiar with absolute and relative imports:
> > http://docs.python.org/release/2.5/whatsnew/pep-328.html
> 
> Doesn't seem to work:
> Python 2.7.3 (default, May 10 2012, 13:31:18)
> [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> from __future__ import absolute_import
>  >>> import .format
>    File "<stdin>", line 1
>      import .format
>             ^
> SyntaxError: invalid syntax
>  >>>

1. My reading of 
http://www.python.org/dev/peps/pep-0328/
is that this only works for from statements not import statements.
[See the section called Guido's decision]

2. The __future__ is not necessary in python 2.7
[Not necessary or not allowed I not know :-) ]

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PYTHONPATH and module names Tobiah <tshepard@rcsreg.com> - 2013-07-01 11:29 -0700
  Re: PYTHONPATH and module names rusi <rustompmody@gmail.com> - 2013-07-01 11:39 -0700
    Re: PYTHONPATH and module names Tobiah <toby@tobiah.org> - 2013-07-01 12:54 -0700
      Re: PYTHONPATH and module names rusi <rustompmody@gmail.com> - 2013-07-01 14:38 -0700
        Re: PYTHONPATH and module names Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-01 22:05 +0000
          Re: PYTHONPATH and module names Lele Gaifax <lele@metapensiero.it> - 2013-07-02 07:30 +0200
      Re: PYTHONPATH and module names Fábio Santos <fabiosantosart@gmail.com> - 2013-07-01 23:08 +0100
      Re: PYTHONPATH and module names "SpaghettiToastBook ." <spaghettitoastbook@gmail.com> - 2013-07-01 16:40 -0400

csiph-web