Re: [Python-Dev] apparent ruminations on mutable immutables (was: PEP 351, the freeze protocol)

2005-11-01 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > On 10/31/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > About the users-changing-my-internal-data issue: > ... > > You can have a printout before it dies: > > "I'm crashing your program because s

Re: [Python-Dev] apparent ruminations on mutable immutables (was: PEP 351, the freeze protocol)

2005-11-01 Thread Josiah Carlson
> That's fine. I wish that you read my answer, think about it a little, > and just tell me in a yes or a no if you still consider it dead. I > think that I have answered all your questions, and I hope that at > least others would be convinced by them, and that at the end my > suggestion would be ac

Re: [Python-Dev] a different kind of reduce...

2005-11-01 Thread Josiah Carlson
"Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote: > > Reinhold Birkenfeld wrote: > > > And we have solved the "map, filter and reduce are going away! Let's > > all weep together" problem with one strike! > > I'm not sure if you're wildly enthusiastic, or very sarcastic. > > I'm not sure whic

Re: [Python-Dev] Why should the default hash(x) == id(x)?

2005-11-02 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > > Hello, > > While writing my PEP about unifying mutable and immutable, I came upon this: > > Is there a reason why the default __hash__ method returns the id of the > objects? A quick search in the list archives via google search "site:mail.pytho

Re: [Python-Dev] Should the default equality operator compare values instead of identities?

2005-11-02 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > On 11/2/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > I believe the current behavior of __eq__ is more desireable than > > comparing contents, as this may result in undesireable behavior > > (recursive compares on

Re: [Python-Dev] Proposal: can we have a python-dev-announce mailing list?

2005-11-03 Thread Josiah Carlson
Even when they are on the ball, the summaries generally occur one week after the discussion/execution happens. That's not so much in the 'time-critical' aspect which, I would imagine, is about as important as the 'low-volume' aspect. - Josiah Oleg Broytmann <[EMAIL PROTECTED]> wrote: > > On

Re: [Python-Dev] Should the default equality operator compare values instead of identities?

2005-11-05 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > On 11/3/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > To summarize, I think that value-based equality testing would usually > > > be what you want, and currently implementing it is a bit of a pain. > > > >

Re: [Python-Dev] Should the default equality operator compare values instead of identities?

2005-11-05 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > > On 11/5/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > ... > > > 1. It doesn't add complexity, or a new builtin. > > > > It changes default behavior (which I specified as a portion of my > > stat

Re: [Python-Dev] Why should the default hash(x) == id(x)?

2005-11-05 Thread Josiah Carlson
th an alternative first. > > > The alternative is to drop the __hash__ method of user-defined classes > (as Guido already decided to do), and to make the default __eq__ > method compare the two objects' __dict__ and slot members. > > See the thread about default equalit

Re: [Python-Dev] Should the default equality operator compare values instead of identities?

2005-11-05 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > > On 11/6/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > ... > > > > > > Sorry, I meant complexity to the Python user - it won't require him to > > > learn more in order to write programs in Pyth

Re: [Python-Dev] For Python 3k, drop default/implicit hash, and comparison

2005-11-06 Thread Josiah Carlson
John Williams <[EMAIL PROTECTED]> wrote: > > (This is kind of on a tangent to the original discussion, but I don't > want to create yet another subject line about object comparisons.) > > Lately I've found that virtually all my implementations of __cmp__, > __hash__, etc. can be factored into

Re: [Python-Dev] Unifying decimal numbers.

2005-11-08 Thread Josiah Carlson
winlinchu <[EMAIL PROTECTED]> wrote: > Now, Python unified ints and long ints. > For Python 3k, could be introduced a "Decimal" type > (yes, Decimal, the library module!) in place of the > actual float object. Of course, the Decimal type would > be rewritten in C. There is code which relies on st

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-13 Thread Josiah Carlson
I personally like Edward Loper's idea of just running your own event handler which deals with drawing, suspend/resume, etc... > If, however, Python contains an event loop that takes care of events as > well as Python commands, redrawing won't happen until Python has > executed all plot commands

Re: [Python-Dev] Problems with the Python Memory Manager

2005-11-16 Thread Josiah Carlson
Travis Oliphant <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > >Travis> More to the point, however, these scalar objects were allocated > >Travis> using the standard PyObject_New and PyObject_Del functions which > >Travis> of course use the Python memory manager. One us

Re: [Python-Dev] Problems with the Python Memory Manager

2005-11-16 Thread Josiah Carlson
Robert Kern <[EMAIL PROTECTED]> wrote: > > [1] There *is* an array type for general PyObjects in scipy_core, but > that's not being used in the code that blows up and has nothing to do > with the problem Travis is talking about. I seemed to have misunderstood the discussion. Was the original us

Re: [Python-Dev] Documentation about Python's GC, python-dev list messages referenced in Modules/gcmodule.c not reachable anymore

2005-12-08 Thread Josiah Carlson
Tim Peters <[EMAIL PROTECTED]> wrote: > > ... > > > In a specific program, analysis is much brighter. You *know* what > > variables carry references to huge data structures, and you *know* > > where these variables are assigned to. > > > ... > > Most people work with countless lines of library

Re: [Python-Dev] Documentation about Python's GC, python-dev list messages referenced in Modules/gcmodule.c not reachable anymore

2005-12-08 Thread Josiah Carlson
Tim Peters <[EMAIL PROTECTED]> wrote: > > [Josiah Carlson] > > I believe this particular argument is specious. > > Not at all, but it's not compelling on its own. I like that better. > > Using Python won't change requirements for knowing what is

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-11 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > Ian> Do not use accessor methods, like ``obj.getFoo()`` and > Ian> ``obj.setFoo(v)``, instead just expose a public attribute > Ian> (``obj.foo``). If necessary you can use ``property`` to implement > Ian> the same functionality that accessor methods woul

Re: [Python-Dev] Add timeout to subprocess.py?

2005-12-14 Thread Josiah Carlson
I've got a recipe in the Python cookbook which adds async subprocess support[1], which can be wrapped to support handling IO to/from the subprocess until a time limit occurs. - Josiah [1] - http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 Guido van Rossum <[EMAIL PROTECTED]> wro

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-15 Thread Josiah Carlson
Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: > Ian Bicking wrote: > > Guido van Rossum wrote: > >> It doesn't matter. Many large projects are adopting the camelCase > >> convention, either by choice or by accident. I did a brief review of > >> Zope 3 and Chandler, and while neither is consistent

Re: [Python-Dev] Keep default comparisons - or add a second set?

2005-12-19 Thread Josiah Carlson
Michael Urman <[EMAIL PROTECTED]> wrote: > > On 12/19/05, Greg Ewing <[EMAIL PROTECTED]> wrote: > > That would be my preference. Comparison for canonical > > ordering should be a distinct operation with its > > own spelling. > > Such as sorted(stuff, key=id)? I believe that ideally, canonical o

Re: [Python-Dev] Keep default comparisons - or add a second set?

2005-12-20 Thread Josiah Carlson
Jim Fulton <[EMAIL PROTECTED]> wrote: > > Jim Jewett wrote: > > PEP 3000 now suggests that dropping default comparison has become more > > than an idle what-if. > > > > Unfortunately, one very common use case of comparisons is to get a > > canonical order. If the order is sensible, all the bett

Re: [Python-Dev] status of development documentation

2005-12-21 Thread Josiah Carlson
Steve Holden <[EMAIL PROTECTED]> wrote: > > Fredrik Lundh wrote: > > > > > - is it perhaps time to start investigating using "lighter" tools for the > > core > > documentation ? > > > +1 +1 for using ReST. +0 for sticking with latex. -1 for choosing something not ReST or latex. +10 for any

Re: [Python-Dev] status of development documentation

2005-12-21 Thread Josiah Carlson
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > Josiah Carlson wrote: > > > -1 for choosing something not ReST or latex. > > yeah, because using something that everyone else uses would of course > not be the python way. No, because ReST is significantl

Re: [Python-Dev] status of development documentation

2005-12-21 Thread Josiah Carlson
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > Josiah Carlson wrote: > > > > yeah, because using something that everyone else uses would of course > > > not be the python way. > > > > No, because ReST is significantly easier to learn and

Re: [Python-Dev] status of development documentation

2005-12-21 Thread Josiah Carlson
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > Barry Warsaw wrote: > > > > Sure, and some people hate using whitespace for block structure. > > > > A more proper analogy would be people who hate braces and parentheses. > > You have to type so many more < and > characters (not to mention &s > > a

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-25 Thread Josiah Carlson
Tim Peters <[EMAIL PROTECTED]> wrote: > Like Phillip Eby, I use 2-tuples for this when I feel the need > (usually during a backtracking graph search, to keep track of paths > back to the root in a space-efficient way), and am happy with that. Then there's the whole Python list with append() and p

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-26 Thread Josiah Carlson
root in a space-efficient way), and am happy with that. > > [Josiah Carlson] > >>> Then there's the whole Python list with append() and pop(). It > >>> takes a method resolution and function call, but at least in > >>> Python 2.3, it is a hair

Re: [Python-Dev] When do sets shrink?

2005-12-28 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > > On 12/29/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > What could be done is to add a test for excess dummy entries and trigger > > a periodic resize operation. That would make the memory available for > > other parts of the currently running sc

Re: [Python-Dev] When do sets shrink?

2005-12-29 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > On 12/29/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > Noam Raphael wrote: > > > > > I'm not saying that practically it must be used - I'm just saying that > > > it can't be called a heuristic, and that it doesn't involve any "fancy > > > overkill size

Re: [Python-Dev] When do sets shrink?

2005-12-31 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > > On 12/31/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > [Noam] > > > For example, iteration over a set which once had > > > 1,000,000 members and now has 2 can take 1,000,000 operations every > > > time you traverse all the (2) elements. > > > > D

Re: [Python-Dev] Include ctypes into core Python?

2006-01-10 Thread Josiah Carlson
Thomas Wouters <[EMAIL PROTECTED]> wrote: > centurion:~ > python < . > Segmentation fault > > [...] > >>> sys.setrecursionlimit(1<<30) > >>> f = lambda f:f(f) > >>> f(f) > Segmentation fault > > There's more, all from Python itself. And sure, "well, don't do that then" > is a perfectly valid res

Re: [Python-Dev] Compiler warnings

2006-01-31 Thread Josiah Carlson
Robert Kim Wireless Internet Advisor <[EMAIL PROTECTED]> wrote: > u guys are way over my head :) > bob You seem to be new to the python-dev mailing list. As a heads-up, python-dev is for the development _of_ python. If you are using Python, and want help or want to help others using Python, you

Re: [Python-Dev] Octal literals

2006-02-01 Thread Josiah Carlson
[EMAIL PROTECTED] (Bengt Richter) wrote: > On Wed, 01 Feb 2006 12:33:36 +, "Gustavo J. A. M. Carneiro" <[EMAIL > PROTECTED]> wrote: > [...] > > Hmm.. I'm beginning to think 13r16 or 16r13 look too cryptic to the > >casual observer; perhaps a suffix letter is more readable, since we > >don't

Re: [Python-Dev] Octal literals

2006-02-01 Thread Josiah Carlson
[EMAIL PROTECTED] (Bengt Richter) wrote: > On Wed, 01 Feb 2006 09:47:34 -0800, Josiah Carlson <[EMAIL PROTECTED]> wrote: > >[EMAIL PROTECTED] (Bengt Richter) wrote: > >> On Wed, 01 Feb 2006 12:33:36 +, "Gustavo J. A. M. Carneiro" <[EMAIL > >> P

Re: [Python-Dev] syntactic support for sets

2006-02-03 Thread Josiah Carlson
Donovan Baarda <[EMAIL PROTECTED]> wrote: > > On Wed, 2006-02-01 at 13:55 -0500, Greg Wilson wrote: > > Hi, > > > > I have a student who may be interested in adding syntactic support for > > sets to Python, so that: > > > > x = {1, 2, 3, 4, 5} > > > > and: > > > > y = {z for z in x if

Re: [Python-Dev] syntactic support for sets

2006-02-03 Thread Josiah Carlson
Donovan Baarda <[EMAIL PROTECTED]> wrote: > > On Fri, 2006-02-03 at 09:00 -0800, Josiah Carlson wrote: > [...] > > Sets are tacked on. That's why you need to use 'import sets' to get to > > them, in a similar fashion that you need to use 'i

Re: [Python-Dev] Octal literals

2006-02-05 Thread Josiah Carlson
[EMAIL PROTECTED] (Bengt Richter) wrote: > Martin v. Lowis <[EMAIL PROTECTED]> wrote: > >Bengt Richter wrote: > >>>The typical way of processing incoming ints in C is through > >>>PyArg_ParseTuple, which already has the code to coerce long->int > >>>(which in turn may raise an exception for a rang

Re: [Python-Dev] Octal literals

2006-02-05 Thread Josiah Carlson
[EMAIL PROTECTED] (Bengt Richter) wrote: > Are you just lecturing me personally (in which case off list would be more > appropriate), > or do you include the authors of the 17 files I count under /Lib > that have > isinstance(, int) in them? > Or would you like to rephrase that with suitable qua

Re: [Python-Dev] syntactic support for sets

2006-02-06 Thread Josiah Carlson
Donovan Baarda <[EMAIL PROTECTED]> wrote: > > On Fri, 2006-02-03 at 11:56 -0800, Josiah Carlson wrote: > > Along the lines of "not every x line function should be a builtin", "not > > every builtin should have syntax". I think that sets have particu

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Josiah Carlson
Guido van Rossum <[EMAIL PROTECTED]> wrote: > IMO asynchat and asyncore are braindead. The should really be removed > from the standard library. The code is 10 years old and represents at > least 10-year-old thinking about how to do this. The amount of hackery > in Zope related to asyncore was out

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Josiah Carlson
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > Steve Holden wrote: > > > > What is the reason that people want to use threads when they can have > > > poll/select-style message processing? Why does Zope require threads? > > > IOW, why would anybody *want* a "threadsafe patch for asynchat"? > > >

Re: [Python-Dev] small floating point number problem

2006-02-08 Thread Josiah Carlson
"Smith" <[EMAIL PROTECTED]> wrote: > > I just ran into a curious behavior with small floating points, trying > to find the limits of them on my machine (XP). Does anyone know why the > '0.0' is showing up for one case below but not for the other? According > to my tests, the smallest representabl

Re: [Python-Dev] Let's just *keep* lambda

2006-02-08 Thread Josiah Carlson
Jiwon Seo <[EMAIL PROTECTED]> wrote: > > On 2/8/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On 2/8/06, Patrick Collison <[EMAIL PROTECTED]> wrote: > > > And to think that people thought that keeping "lambda", but changing > > > the name, would avoid all the heated discussion... :-) > > >

Re: [Python-Dev] Let's just *keep* lambda

2006-02-08 Thread Josiah Carlson
Jiwon Seo <[EMAIL PROTECTED]> wrote: > On 2/8/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Closures already exist in Python. > > > > >>> def foo(bar): > > ... return lambda: bar + 1 > > ... > > >>> a = foo(5) > >

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Josiah Carlson
Mark Edgington <[EMAIL PROTECTED]> wrote: > > Martin v. Löwis wrote: > > That patch looks wrong. What does it mean to "run in a thread"? > > All code runs in a thread, all the time: sometime, that thread > > is the main thread. > > > > Furthermore, I can't see any presumed thread-unsafety in

Re: [Python-Dev] [Tutor] nice()

2006-02-12 Thread Josiah Carlson
"Alan Gauld" <[EMAIL PROTECTED]> wrote: > However I do dislike the name nice() - there is already a nice() in the > os module with a fairly well understood function. But I'm sure some > time with a thesaurus can overcome that single mild objection. :-) Presumably it would be located somewhere lik

Re: [Python-Dev] PEP 343: Context managers a superset of decorators?

2006-02-12 Thread Josiah Carlson
Eric Sumner <[EMAIL PROTECTED]> wrote: > Forgive me if someone has already come up with this; I know I am > coming to the party several months late. All of the proposals for > decorators (including the accepted one) seemed a bit kludgey to me, > and I couldn't figure out why. When I read PEP 343

<    1   2   3   4   5   6