[Python-3000] A few small py3k wishes

Thomas Wouters thomas at python.org
Mon Apr 3 00:30:19 CEST 2006


On 4/2/06, Talin <talin at acm.org> wrote:

> -- The __main__ module should contain a file path like imported
> modules. in other words, every module should know where it
> came from. In fact, I see no reason why the __main__ module
> should have any different attributes than an imported module
> other than the name.


I'm not sure what you're missing. The __main__ module has __file__:

centurion:~ > cat tmp.py
print "__file__:", __file__
import __main__
print "__main__.__file__:", __main__.__file__

centurion:~ > python tmp.py
__file__: tmp.py
__main__.__file__: tmp.py

-- A path-globbing function that supports regex-style
> captures.


Improvements like that happen because someone writes the module and people
end up using it. It isn't part of the language, it's just stdlib evolution.

-- A path-globbing function that supports the
> perforce-style syntax "..." (three dots) to mean "all descendants".
> So for example, "foo/.../*.cpp" matches any cpp files in
> foo or any of its subdirectories.


I prefer ksh's '**' myself. It's trivial to add, see for instance
http://www.python.org/sf/628075
Again, this isn't something for py3k.

--
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20060403/ff6cbefa/attachment.htm 


More information about the Python-3000 mailing list