Re: [Python-Dev] Distutils2 scripts

2010-10-09 Thread Gisle Aas
On Oct 9, 2010, at 1:07 , James Y Knight wrote:

> On Oct 8, 2010, at 5:24 PM, Gisle Aas wrote:
> 
>> On Oct 8, 2010, at 9:22 , Jeroen Ruigrok van der Werven wrote:
>> 
>>> +1 from me. I sincerely dislike the Perl-esque -m stuff.
>> 
>> As a Perl/Python guy I have to object to calling the -m stuff Perl-esque.  
>> This is a very Pythonish thing.  In the Perl world we never treat modules as 
>> scripts; they are separate concepts written separately and installed in 
>> separate locations.  There is no feature of perl similar to the Pythonish -m 
>> stuff.
> 
> 
> Yes there is. -m and -M.
> 
> E.g., the widely advertised perl -MCPAN -e install. It's not identical to 
> python's -m, to be sure, but it's *similar*.

It might look similar but it's not.

If it was similar 'python -mfoo' would be a shortcut for 'python -c "import 
foo"' and 'python -Mfoo' would be a shortcut for 'python -c "from foo import 
*".  It would also have to be possible to repeat the -c option.  Then we could 
have written the Perl-esque:

python -Mdistutils2.depgraph -c "main()"

There is no way to do something similar to 'python -mfoo ...' from perl.  The 
closest thing I could think of would be 'perl $(perldoc -l foo) ...', assuming 
a bash-like shell.

Regards,
Gisle

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Pythonmac-SIG] sad state of OS X Python testing...

2010-10-09 Thread Antoine Pitrou

Congratulations Stephen, you are now the owner of our first green OS X
buildbot!

cheers

Antoine.



On Fri, 8 Oct 2010 08:11:13 -0700
Stephen Hansen  wrote:
[snip]
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Another relative imports question

2010-10-09 Thread Martin v. Löwis
Am 09.10.2010 01:35, schrieb Greg Ewing:
> Georg Brandl wrote:
>> The explanation is that everything that comes after "import" is
>> thereafter
>> usable as an identifier (or expression, in the case of dotted names) in
>> code.  ".mymodule" is not a valid expression, so the question would be
>> how
>> to refer to it.
> 
> I think a reasonable answer is that you should be able
> to refer to it simply as 'mymodule'.

I don't think that's reasonable:

import xml.dom

doesn't give you dom, but xml.

So

import .dom

shouldn't give you dom, but . (which is nonsensical, of course).

Regards,
Martin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Another relative imports question

2010-10-09 Thread Ron Adam



On 10/09/2010 12:39 PM, "Martin v. Löwis" wrote:

Am 09.10.2010 01:35, schrieb Greg Ewing:

Georg Brandl wrote:

The explanation is that everything that comes after "import" is
thereafter
usable as an identifier (or expression, in the case of dotted names) in
code.  ".mymodule" is not a valid expression, so the question would be
how
to refer to it.


I think a reasonable answer is that you should be able
to refer to it simply as 'mymodule'.


I don't think that's reasonable:

import xml.dom

doesn't give you dom, but xml.

So

import .dom

shouldn't give you dom, but . (which is nonsensical, of course).



I don't think it would be  "import .dom", but...

from . import dom

It would be another module in xml doing the importing, so xml will have 
already been imported.


Ron


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Build failure in test_cmd_line on OSX-x86

2010-10-09 Thread Nick Coghlan
On Sat, Oct 9, 2010 at 3:28 AM, Antoine Pitrou  wrote:
> You should therefore see what the locale settings of the buildbot are
> (the LANG and LC_* environment variables). Of course, the test is also
> buggy so you should open an issue on the tracker.
>
> (and the fact that the test doesn't print the actual error message of
> the spawned interpreter is unhelpful)

If someone wants to throw an issue my way, I can take a look at
dumping stdout/stderr from the various test_cmd_line tests (I may not
get to it until post-beta1 though).

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com