Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev
Re: [Python-checkins] peps: Added examples.
 

Index | Next | Previous | View Flat


ncoghlan at gmail

May 24, 2012, 5:47 AM


Views: 108
Permalink
Re: [Python-checkins] peps: Added examples.

On Thu, May 24, 2012 at 8:10 PM, eric.smith <python-checkins [at] python> wrote:
> +   Lib/test/namspace_pkgs

Typo: s/namspace/namespace/

> +Here we add the parent directories to ``sys.path``, and show that the
> +portions are correctly found::
> +
> +    >>> import sys
> +    >>> sys.path += ['Lib/test/namespace_pkgs/parent1/parent', 'Lib/test/namespace_pkgs/parent2/parent']

The trailing "/parent" shouldn't be there on either of these paths.
The comments that refer back to these also need the same adjustment.

> +   Lib/test/namspace_pkgs

Same typo as above.

> +    # add the first two parent paths to sys.path
> +    >>> import sys
> +    >>> sys.path += ['Lib/test/namespace_pkgs/parent1/parent', 'Lib/test/namespace_pkgs/parent2/parent']

Again, need to lose the last directory from these paths and the
comments that refer to them.

> +    # now add parent3 to the parent's __path__:
> +    >>> parent.__path__.append('Lib/test/namespace_pkgs/parent3/parent')

This modification is incorrect, it should be:
sys.path.append('Lib/test/namespace_pkgs/parent3')

and both parent.__path__ and parent.child.__path__ should pick up
their extra portions on the next import attempt.

Also, I suggest renaming "parent1", "parent2" and "parent3" to
"project1", "project2" and "project3".

Cheers,
Nick.

--
Nick Coghlan   |   ncoghlan [at] gmail   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Subject User Time
Re: [Python-checkins] peps: Added examples. ncoghlan at gmail May 24, 2012, 5:47 AM
    Re: [Python-checkins] peps: Added examples. ncoghlan at gmail May 24, 2012, 1:13 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.