Re: [Python-Dev] rationale for the no-new-features approach

2005-03-11 Thread Skip Montanaro
Bob> try: Bob> set Bob> except NameError: Bob> from sets import Set as set Bob> You don't need the rest. Sure, but then pychecker bitches about a statement that appears to have no effect. ;-) Skip ___ Python-Dev mailing

[Python-Dev] Example workaround classes for using Unicode with csv module...

2005-03-18 Thread Skip Montanaro
I added UnicodeReader and UnicodeWriter example classes to the csv module docs just now. They mention problems with ASCII NUL characters (which I vaguely remember - NUL-terminated strings are used internally, right?). Do NULs still present a problem? I saw nothing in the log messages that menti

Re: [Python-Dev] tree data structure and python

2005-03-26 Thread Skip Montanaro
vivek> I have to implement tree data structure using python. How it can vivek> be done in python. Wrong list. This is about development *of* Python, not development *with* Python. Try python-list@python.org (or its sister Usenet newsgroup, comp.lang.python) instead. -- Skip Mon

[Python-Dev] Re: RELEASED Python 2.4.1 (final)

2005-03-30 Thread Skip Montanaro
Terry> The page http://www.python.org/download/ needs to be added to the Terry> list of things updated with a new release. Terry, I'll let others take care of that list (I don't know where it's kept). In the meantime, I updated the download page to reference 2.4.1. Skip __

Re: python.org/sf URLs aren't working? Re: [Python-Dev] Weekly Python Patch/Bug Summary

2005-03-31 Thread Skip Montanaro
> "Jeff" == Jeff Epler <[EMAIL PROTECTED]> writes: Jeff> I get 500 Internal Server Error messages when I try to access the Jeff> URLs in the recent patch summary. Jeff> Is this happening to anybody else? Yup. I don't have time to look into the problem, however... Here's a trace

Re: [Python-Dev] Mail.python.org

2005-04-05 Thread Skip Montanaro
Grant> Not a big deal, but I noticed that https://mail.python.org/ is Grant> live and shows a generic "Welcome to your new home in Grant> cyberspace!" message. One of the webmasters may want to Grant> automatically redirect to http://mail.python.org. Thanks, I forwarded this alon

RE: [Python-Dev] Developer list update

2005-04-08 Thread Skip Montanaro
Raymond> Does anyone know what has become of ... Raymond> Charles G Waldman I'd scratch Charles from the list. I work at the same company he did. Nobody here has been in touch with him for over a year. Several of us have tried to get ahold of him but to no avail. Skip __

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-09 Thread Skip Montanaro
Martin> Yet, this *still* is a platform dependence. Python makes no Martin> guarantee that 1e1000 is a supported float literal on any Martin> platform, and indeed, on your platform, 1e1000 is not supported Martin> on your platform. Are float("inf") and float("nan") supported every

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-10 Thread Skip Montanaro
Michael> I suppose one could jsut do it unconditionally and wait for one Michael> of the three remaining VAX users[2] to compile Python 2.5 and Michael> then notice. You forgot the two remaining CRAY users. Since their machines are so much more powerful than VAXen, they have much mor

Re: [Python-Dev] anonymous blocks

2005-04-21 Thread Skip Montanaro
Guido> or perhaps even (making "for VAR" optional in the for-loop syntax) Guido> with Guido> in synchronized(the_lock): Guido> BODY This could be a new statement, so the problematic issue of implicit try/finally in every for statement wouldn't be necessary. That comp

Re: [Python-Dev] Re: anonymous blocks

2005-04-25 Thread Skip Montanaro
Guido> At the same time, having to use it as follows: Guido> for f in with_file(filename): Guido> for line in f: Guido> print process(line) Guido> is really ugly, so we need new syntax, which also helps with Guido> keeping 'for' semantically backwa

Re: [Python-Dev] atexit missing an unregister method

2005-04-26 Thread Skip Montanaro
Nick> But while you can mark functions to be called with the 'register' Nick> method, there's no 'unregister' method to remove them from the Nick> stack of functions to be called. Nor is there any way to view Nick> this stack and e.g. call 'del' on a registered function. Nick

[Python-Dev] PEP 340: What is "ret" in block statement semantics?

2005-04-29 Thread Skip Montanaro
PEP 340 describes the block statement translation as: itr = EXPR1 val = arg = None ret = False while True: try: VAR1 = next(itr, arg) except StopIteration: if ret: return val

[Python-Dev] PEP 340: What is "ret" in block statement semantics?

2005-04-29 Thread Skip Montanaro
me> It uses a variable "ret" that is always False. Gaack. Please ignore. Skip ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/arch

Re: [Python-Dev] PEP 340: Else clause for block statements

2005-05-02 Thread Skip Montanaro
Anders> How do I tell try/except that I really only meant to trap Anders> opening('file1'), but opening 'file2' is not supposed to fail so Anders> I want any exception from that propagated? Better if I could Anders> write: Anders> in opening('file1') as f1: Anders>

Re: [Python-Dev] PEP 340: Breaking out.

2005-05-03 Thread Skip Montanaro
> "Pierre" == Pierre Barbier de Reuille <[EMAIL PROTECTED]> writes: Pierre> Tom Rothamel a écrit : >> I have a question/suggestion about PEP 340. >> >> As I read the PEP right now, the code: >> >> while True: >> block synchronized(v1): >> if v1.fie

Re: [Python-Dev] PEP 340: Breaking out.

2005-05-03 Thread Skip Montanaro
>>>>> "Guido" == Guido van Rossum <[EMAIL PROTECTED]> writes: Guido> [Skip Montanaro] >> Yeah, but "block synchronized(v1)" doesn't look like a loop. I think >> this might be a common stumbling block for people using this

Re: [Python-Dev] Pre-PEP: Unifying try-except and try-finally

2005-05-04 Thread Skip Montanaro
Guido> Nice one. Should be a piece of cake to implement. Please talk to Guido> [EMAIL PROTECTED] about getting it checked into the PEP database. Guido> I'm +1 on accepting this now -- anybody against? I'm not against it, but I thought there were ambiguity reasons that this construct

Re: [Python-Dev] Pre-PEP: Unifying try-except and try-finally

2005-05-04 Thread Skip Montanaro
Tim> What about `else` mixed with try/except/finally? Tim> try: Tim> A Tim> except: Tim> B Tim> else: Tim> C Tim> finally: Tim> D Tim> If A executes without exception, does D execute before or after C? According to Guido, execution is A, C

Re: [Python-Dev] Request for dev permissions

2005-05-18 Thread Skip Montanaro
Robert> P.S. Do you have a valid email address, RB? I wasn't able to fix Robert> up your nospam address by hand. That's because it didn't need fixing... Note Reinhold's sig: Reinhold> -- Reinhold> Mail address is perfectly valid! Skip _

Re: [Python-Dev] [Python-checkins] python/dist/src/Lib/test test_site.py, 1.6, 1.7

2005-05-28 Thread Skip Montanaro
mwh> Fix test_site to not call open('...', 'wU'), as that now raises an mwh> error. mwh> Is anyone running the test suite regularly at the moment? Whoops. I obviously failed to run it after applying that change. My apologies. Skip ___ Py

Re: [Python-Dev] Thoughts on stdlib evolvement

2005-06-06 Thread Skip Montanaro
Reinhold> - Flat namespace: Should we tend to a more hierarchic library Reinhold> (e.g. inet.url, inet.http, inet.nntp)? This would increase Reinhold> clarity when searching for a module. We've talked about this before. The main technical challenge seems to be backward compatib

Re: [Python-Dev] Thoughts on stdlib evolvement

2005-06-06 Thread Skip Montanaro
>>>>> "Barry" == Barry Warsaw <[EMAIL PROTECTED]> writes: Barry> On Mon, 2005-06-06 at 14:38, Skip Montanaro wrote: >> import urllib >> from www.urllib import urlopen >> >> the module-level code should only be e

Re: [Python-Dev] Thoughts on stdlib evolvement

2005-06-06 Thread Skip Montanaro
Tim> On 6/6/05, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: >> - Flat namespace: Should we tend to a more hierarchic library (e.g. >> inet.url, inet.http, inet.nntp)? This would increase clarity when >> searching for a module. Tim> -1. I feel the opposite way: when trying

Re: [Python-Dev] [Python-checkins] python/dist/src/Doc/lib libtokenize.tex, 1.5, 1.6

2005-06-10 Thread Skip Montanaro
Raymond> Add untokenize() function to allow full round-trip tokenization. Raymond> Should significantly enhance the utility of the module by Raymond> supporting the creation of tools that modify the token stream Raymond> and writeback the modified result. Raymond, Very interesti

[Python-Dev] Multiple expression eval in compound if statement?

2005-06-12 Thread Skip Montanaro
I'm horsing around with recognizing switch-like if statements like: if x == 1: print 1 elif x == 2: print 2 else: print "unknown" in the compiler and generating O(1) code. "x" can be any expression, but must be precisely the same in each elif clause, the comp

Re: [Python-Dev] Multiple expression eval in compound if statement?

2005-06-13 Thread Skip Montanaro
Raymond> I think it unwise to allow x to be any expression. How do you decide what's "too complex"? Even an apparently simple variable can have side effects, so the semantic change bit is important no matter how complex the expression. (Consider the builtin help object. Type it at the pr

Re: [Python-Dev] Multiple expression eval in compound if statement?

2005-06-13 Thread Skip Montanaro
Michael> ... but if there's some side effect going on here, I don't see Michael> it. What am I missing? Mea culpa. I was thinking of the print as a side efefct. Obviously mistaken. Skip ___ Python-Dev mailing list Python-Dev@python.org http:

Re: [Python-Dev] refcounting vs PyModule_AddObject

2005-06-15 Thread Skip Montanaro
Michael> So I went looking for other instances of the same problem. I Michael> didn't find any (though I don't understand how _csv.c gets away Michael> with line 1579)... Same reason the Py_INCREF of ProfileError isn't necessary I think. PyDict_New() returns a new reference which is

Re: [Python-Dev] refcounting vs PyModule_AddObject

2005-06-15 Thread Skip Montanaro
Michael> ... (though I don't understand how _csv.c gets away Michael> with line 1579)... Michael> Oops; I meant line 1590. Hmmm... Me either. Is it possible it was just never DECREF'd? I checked in the obvious fix on both head and the 2.4 release branch. Skip

Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _csv.c, 1.37, 1.38

2005-06-15 Thread Skip Montanaro
Armin> But it's all quite obscure. If this was comp.lang.python I'd nominate this for QOTW... Skip ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/opt

[Python-Dev] PEP 304 "Controlling Generation of Bytecode Files" - patch updated

2005-06-16 Thread Skip Montanaro
I updated the patch that supports PEP 304, "Controlling Generation of Bytecode Files" to apply cleanly against current CVS. I've tested it on Mac OS X (straight Unix build only). I'd appreciate it if some Linux, Windows and Mac framework folks could apply the patch, rebuild, then run the tests (

Re: [Python-Dev] PEP 304 "Controlling Generation of Bytecode Files" - patch updated

2005-06-17 Thread Skip Montanaro
Skip> http://python.org/sf/677103 Thomas> There's no patch attached. *sigh* Thanks for noticing the problem. Apparently, since I last updated the patch, SF implemented a 250kbyte limit on file uploads. This one is big because it includes a suitably modified configure script that was ge

Re: [Python-Dev] PEP for RFE 46738 (first draft)

2005-06-18 Thread Skip Montanaro
Why this discussion of yet another serialization format? The wire-encoding for XML-RPC is quite stable, handles all the basic Python types proposed in the proto-PEP, and is highly interoperable. If performance is an issue, make sure you have a C-based accelerator module like sgmlop installed. I

Re: [Python-Dev] PEP for RFE 46738 (first draft)

2005-06-18 Thread Skip Montanaro
Simon> XML is simply not suitable for database appplications, real time Simon> data capture and game/entertainment applications. I use XML-RPC as the communications protocol between an Apache web server and a middleware piece that talks to a MySQL database. The web server contains a mixt

Re: [Python-Dev] building with C++

2006-04-12 Thread Skip Montanaro
> > Anthony> I've done a lot of the work to get Python to build with g++ - > > Is this on a branch or available as a patch somewhere? > > It's the trunk. Is there a primer that will get me to where Anthony is? I tried the obvious CC=g++ ./configure --with-cxx=g++ and the build fails t

Re: [Python-Dev] PEP for RFE 46738 (first draft)

2005-06-19 Thread Skip Montanaro
Simon> I hacked things a bit, and instead of sending XML, sent pickles Simon> inside the XML response. I've done the same thing (I think I may have used marshal). It works fine as long as you know both ends are Python. Skip ___ Python-Dev mail

Re: [Python-Dev] Propose to reject PEP 294 -- Type Names in the types Module

2005-06-19 Thread Skip Montanaro
Raymond> Suggest rejecting this PEP and making a note for Py3.0 to Raymond> either sync-up the type names or abandon the types module Raymond> entirely. I thought the types module was already deprecated, at least verbally if not officially. Skip __

Re: [Python-Dev] Recommend accepting PEP 312 -- Simple Implicit Lambda

2005-06-19 Thread Skip Montanaro
>> As I see it, a lambda is an anonymous function. An anonymous function >> is a function without a name. We already have a syntax for a >> function... why not use it. ie: >> >> f = filter(def (a): return a > 1, [1,2,3]) Kay> You mix expressions with statements. You co

Re: [Python-Dev] Decimal floats as default (was: discussion about PEP239 and 240)

2005-06-22 Thread Skip Montanaro
Fredrik> Is there actually much code around that relies on the Fredrik> particular precision of 32- or 64-bit binary floats for Fredrik> arithmetic, and ceases working when higher precision is Fredrik> available? Umm, yeah... The path you take from one or more string literals re

[Python-Dev] PEP 304 - is anyone really interested?

2005-06-22 Thread Skip Montanaro
I wrote PEP 304, "Controlling Generation of Bytecode Files": http://www.python.org/peps/pep-0304.html quite awhile ago. The first version appeared in January 2003 in response to questions from people about controlling/suppressing bytecode generation in certain situations. It sat idle for a

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-26 Thread Skip Montanaro
Phillip> It has many ways to do the same thing, and many of its property Phillip> and method names are confusing because they either do the same Phillip> thing as a standard function, but have a different name (like Phillip> the 'parent' property that is os.path.dirname in disguise)

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-26 Thread Skip Montanaro
Walter> I think ctime, mtime and atime should be (or return) Walter> datetime.datetime objects instead of integer timestamps. +1 Skip ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscri

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-26 Thread Skip Montanaro
Phillip> ... but have a different name (like the 'parent' property that Phillip> is os.path.dirname in disguise) ... Phillip> ... (like the 'listdir()' method that returns full paths rather Phillip> than just filenames). Skip> To the extent that the path module tries to provi

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Skip Montanaro
We're getting enough discussion about various aspects of Jason's path module that perhaps a PEP is warranted. All this discussion on python-dev is just going to get lost. Skip ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mail

Re: [Python-Dev] Linux Python linking with G++?

2005-07-07 Thread Skip Montanaro
>> Configure with --without-cxx to not use g++. Since there is an >> option in configure, I assume it is intentional. Dave> O-kay... any idea what the rationale for this decision might be? I believe it's so that people can link in libraries written in C++ and have them initialized p

Re: [Python-Dev] Linux Python linking with G++?

2005-07-07 Thread Skip Montanaro
>> I believe it's so that people can link in libraries written in C++ >> and have them initialized properly. Dave> Can you give specifics? What do you mean by "link in?" Do you Dave> mean "statically link into the Python interpreter," or something Dave> else? Probably not.

Re: [Python-Dev] checklist for filing a bug

2005-07-08 Thread Skip Montanaro
Brett> #. Gather important information Brett> Info such as Python version, operating system version, etc.; Brett> anything that might have influenced the code that lead to the Brett> bug. I'd change this to something more explicit: # Gather important information

Re: [Python-Dev] Possible context managers in stdlib

2005-07-08 Thread Skip Montanaro
Ummm... What's a "context manager"? Skip ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Possible context managers in stdlib

2005-07-11 Thread Skip Montanaro
>> Ummm... What's a "context manager"? Michael> Something that goes Michael> with ... as var: Michael> ^ here Michael> If you have a better name, feel free to suggest it, but please Michael> catch up on python-dev first (it's been discussed to Michael> unconsc

Re: [Python-Dev] [Python-checkins] python/dist/src/Misc developers.txt, 1.15, 1.16

2005-07-14 Thread Skip Montanaro
raymond> Log Message: raymond> Brett requests that Flovis's permissions be dropped. Not to put too fine a spin on things, but I think it was more like Brett got tired of waiting for Flovis's permissions to be increased and retracted his original request. Skip

Re: [Python-Dev] "and" and "or" operators in Py3.0

2005-09-20 Thread Skip Montanaro
Greg Ewing canterbury.ac.nz> writes: > > Raymond Hettinger wrote: > > I propose that in Py3.0, the "and" and "or" operators be simplified to > > always return a Boolean value instead of returning the last evaluated > > argument. > > But then I would no longer be able to write > >foo = some

Re: [Python-Dev] "and" and "or" operators in Py3.0

2005-09-20 Thread Skip Montanaro
> That leaves error reduction and clarity as the main motivations for > changing 'and' and 'or' to act like '&&' and '||' and for introducing a > conditional operator to handle everyone's favorite use cases. I predict that people who use "and" and "or" correctly today will start confusing "&&" wit

<    1   2   3   4