Re: [Python-Dev] dir() and __all__

2008-02-15 Thread Thomas Wouters
On Sat, Feb 16, 2008 at 4:18 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > [Raymond] > >> Should dir(module) use __all__ when defined? > > [GvR] > > It's not consistent with what dir() of a class or instance does though. > > > > -1. > > Perhaps there is another solution. Have dir() exclude ob

Re: [Python-Dev] dir() and __all__

2008-02-15 Thread Aahz
On Fri, Feb 15, 2008, Raymond Hettinger wrote: > > [Raymond] > >> Should dir(module) use __all__ when defined? > > [GvR] > > It's not consistent with what dir() of a class or instance does though. > > > > -1. > > Perhaps there is another solution. Have dir() exclude objects which > are modules.

Re: [Python-Dev] trunk-math

2008-02-15 Thread Mark Dickinson
Apologies for the bad formatting. Here's a repost with shorter lines. Dear all, I'd like to draw your attention to some of the work that's been going on in the trunk-math branch. Christian Heimes and I have been working on various aspects of Python mathematics, and we're hoping to get at least

Re: [Python-Dev] trunk-math

2008-02-15 Thread Steve Holden
Mark Dickinson wrote: > Dear all, > > I'd like to draw your attention to some of the work that's been going on > in the trunk-math branch. Christian Heimes and I have been working on > various aspects of Python mathematics, and we're hoping to get at least > some of this work into Python 2.6/3

Re: [Python-Dev] dir() and __all__

2008-02-15 Thread Guido van Rossum
I'm not sure which use case you're after here, but I doubt it's what dir() was designed to do. dir() is meant to attempt to give you all attributes for which getattr() will succeed, barring dynamic overrides of __getattr[ibute]__. On Fri, Feb 15, 2008 at 7:18 PM, Raymond Hettinger <[EMAIL PROTECTE

[Python-Dev] trunk-math

2008-02-15 Thread Mark Dickinson
Dear all, I'd like to draw your attention to some of the work that's been going on in the trunk-math branch. Christian Heimes and I have been working on various aspects of Python mathematics, and we're hoping to get at least some of this work into Python 2.6/3.0. Most of the changes are completed

Re: [Python-Dev] dir() and __all__

2008-02-15 Thread Raymond Hettinger
[Raymond] >> Should dir(module) use __all__ when defined? [GvR] > It's not consistent with what dir() of a class or instance does though. > > -1. Perhaps there is another solution. Have dir() exclude objects which are modules. For example, dir(logging) would exclude sys, os, types, time, string

Re: [Python-Dev] dir() and __all__

2008-02-15 Thread Steve Holden
Maybe classes should have __all__ too, then the people who complain about not being able to declare private class attributes could be pointed at that. regards Steve Guido van Rossum wrote: > It's not consistent with what dir() of a class or instance does though. > > -1. > > On Fri, Feb 15,

Re: [Python-Dev] dir() and __all__

2008-02-15 Thread skip
Guido> It's not consistent with what dir() of a class or instance does Guido> though. -1. Agreed. The only official use I'm aware of is to restrict what is imported when you execute from mod import * Raymond> >>> Queue.__all__ Raymond> ['Empty', 'Full', 'Queue', 'PriorityQ

Re: [Python-Dev] dir() and __all__

2008-02-15 Thread Guido van Rossum
It's not consistent with what dir() of a class or instance does though. -1. On Fri, Feb 15, 2008 at 5:30 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > Should dir(module) use __all__ when defined? > > >>> dir(Queue) > ['Empty', 'Full', 'LifoQueue', 'PriorityQueue', 'Queue', '__all__', > '_

[Python-Dev] dir() and __all__

2008-02-15 Thread Raymond Hettinger
Should dir(module) use __all__ when defined? >>> dir(Queue) ['Empty', 'Full', 'LifoQueue', 'PriorityQueue', 'Queue', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_time', 'deque', 'heapq'] >>> Queue.__all__ ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue']

Re: [Python-Dev] Calling a builtin from C code; PEP 3101 format() builtin

2008-02-15 Thread Eric Smith
Eric Smith wrote: > Greg Ewing wrote: >> Eric Smith wrote: >> >>> 1: exposing builtin_format(), probably giving it another name >>> (PyObject_Format?) and moving it somewhere other than bltinmodule.c. >> PyObject_Format sounds more like an API for invoking the >> __format__ lookup mechanism. Maybe

Re: [Python-Dev] Calling a builtin from C code; PEP 3101 format() builtin

2008-02-15 Thread Eric Smith
Greg Ewing wrote: > Eric Smith wrote: > >> 1: exposing builtin_format(), probably giving it another name >> (PyObject_Format?) and moving it somewhere other than bltinmodule.c. > > PyObject_Format sounds more like an API for invoking the > __format__ lookup mechanism. Maybe something like > PyOb

Re: [Python-Dev] Py3k and asyncore/asynchat

2008-02-15 Thread Joel Bender
Bill Janssen wrote: > I think we should just replace the current "loop" with this (and add > the "schedule" function). Then other folks won't have to figure out > how the module works and write their own loop. Having beaten my way down this road of broken glass, I would like args and kwargs if y

Re: [Python-Dev] Py3k and asyncore/asynchat

2008-02-15 Thread Giampaolo Rodola'
On 15 Feb, 21:36, Bill Janssen <[EMAIL PROTECTED]> wrote: > I think we should just replace the current "loop" with this (and add > the "schedule" function).  Then other folks won't have to figure out > how the module works and write their own loop.  I'll be happy to update > the documentation to do

Re: [Python-Dev] Py3k and asyncore/asynchat

2008-02-15 Thread Bill Janssen
I think we should just replace the current "loop" with this (and add the "schedule" function). Then other folks won't have to figure out how the module works and write their own loop. I'll be happy to update the documentation to document it. Bill > Twisted core has been proposed, but I believe

Re: [Python-Dev] Py3k and asyncore/asynchat

2008-02-15 Thread Josiah Carlson
Twisted core has been proposed, but I believe the consensus was that it wasn't desirable, generally. I'm also pretty sure that people learn twisted because everyone learns twisted. It's one of those buzz-words ;). As for task scheduling, I believe it was something like... import asyncore import

Re: [Python-Dev] Py3k and asyncore/asynchat

2008-02-15 Thread Giampaolo Rodola'
On 15 Feb, 03:24, "Josiah Carlson" <[EMAIL PROTECTED]> wrote: > As I stated 2+ and 6+ months ago, the patches I submitted 9+ months > ago work (I've been using them in my own projects without issue). The > only issue with the bugfix/rearrangement that I last heard about with > regards to the 2.x

Re: [Python-Dev] Error in PEP3118?

2008-02-15 Thread Thomas Heller
Travis Oliphant schrieb: > Thomas Heller wrote: >> Travis Oliphant schrieb: >> >>> So, I think the example is correct (and intentional). >> >> Sorry, I do not think so. If you use a 2-d array in the example, you >> must describe it correctly. The difference between this pep and the old > > I d

[Python-Dev] Summary of Tracker Issues

2008-02-15 Thread Tracker
ACTIVITY SUMMARY (02/08/08 - 02/15/08) Tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue number. Do NOT respond to this message. 1720 open (+39) / 12232 closed (+13) / 13952 total (+52) Open issues with patches: 449 Average durati

Re: [Python-Dev] New math functions

2008-02-15 Thread Neal Becker
Mark Dickinson wrote: > On Tue, Feb 12, 2008 at 1:52 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > >> Also, it would be useful to have a new method, float.is_integer(). This >> would be better than the current approach where we make the >> test: if x == floor(x). >> > > How common is this

Re: [Python-Dev] Py3k and asyncore/asynchat

2008-02-15 Thread Jon Ribbens
On Fri, Feb 15, 2008 at 09:24:14AM -0500, A.M. Kuchling wrote: > On Thu, Feb 14, 2008 at 06:24:04PM -0800, Josiah Carlson wrote: > > 1.a. Figure out what the hell is up with OOB data, how to handle it, > > and stop making it use handle_expt(). > > Does OOB data actually need to be supported? For

Re: [Python-Dev] Py3k and asyncore/asynchat

2008-02-15 Thread A.M. Kuchling
On Thu, Feb 14, 2008 at 06:24:04PM -0800, Josiah Carlson wrote: > 1.a. Figure out what the hell is up with OOB data, how to handle it, > and stop making it use handle_expt(). Does OOB data actually need to be supported? For a long time TCP implementations usually had buggy OOB implementations bec

Re: [Python-Dev] New math functions

2008-02-15 Thread Mark Dickinson
On Tue, Feb 12, 2008 at 1:52 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > Also, it would be useful to have a new method, float.is_integer(). This > would be better than the current approach where we make the > test: if x == floor(x). > How common is this test? Given the inexact nature of

Re: [Python-Dev] New math functions

2008-02-15 Thread Christian Heimes
Raymond Hettinger wrote: > Was some thought given to possibly adding these as > float methods instead of as separate functions? > > float.isinf() > float.isnan() > > Also, it would be useful to have a new method, float.is_integer(). This > would be better than the current approach whe