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

2005-06-30 Thread Raymond Hettinger
out well too, then there would be some basis for Py3.0 using decimal as the default float. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/opti

Re: [Python-Dev] Inconsistent API for sets.Set and build-in set

2005-06-30 Thread Raymond Hettinger
--> update > I'm willing to Just Fix It, Please don't. All of the differences between set and Set were intentional improvements (i.e. the hash algorithm's are different). Raymond ___ Python-Dev mailing list Python-Dev@pyth

Re: [Python-Dev] List copy and clear (was Re: Inconsistent API for sets.Set and build-in set)

2005-06-30 Thread Raymond Hettinger
: mylist[:] = [] # clear Raymond ___ 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

[Python-Dev] Terminology for PEP 343

2005-06-30 Thread Raymond Hettinger
he glossary. The choice of words will likely have a great effect on learnability and on how people think about the new tool. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] List copy and clear (was Re: Inconsistent API for sets.Set and build-in set)

2005-06-30 Thread Raymond Hettinger
and still feels that way years later. Raymond ___ 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] List copy and clear (was Re: Inconsistent API for sets.Set and build-in set)

2005-06-30 Thread Raymond Hettinger
> Raymond Hettinger wrote: > > Use copy.copy() for generic copying -- it works across a wide range of > > objects. Alternatively, use the constructor as generic way to make > > duplicates: > > > >dup = set(s) > >dup = list(l) > >dup =

Re: [Python-Dev] Decimal rounding doc

2005-07-01 Thread Raymond Hettinger
got it from here. Will update the docs. Raymond ___ 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] Terminology for PEP 343

2005-07-01 Thread Raymond Hettinger
[Brett Cannon] > I say we steal from the C++ and the RAII paradigm and go with RMUW > (Resource Management Using 'with' Or the-keyword-formerly-known-as-do Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.py

Re: [Python-Dev] Money module

2005-07-01 Thread Raymond Hettinger
ksheet, row or column, or specific cell. It is not linked to the context for mathematical operations. While the Money module remains experimental, it should remain a third-party package. Raymond ___ Python-Dev mailing list Python-Dev@pyth

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Raymond Hettinger
[Raymond] > >>Whatever term is selected, it should be well thought-out and added to > >>the glossary. The choice of words will likely have a great effect on > >>learnability and on how people think about the new tool. [Ron Adam] > I tried to bring this up on pyth

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Raymond Hettinger
just > expressing an opinion. So take it for what it's worth. Hmm, that got me to thinking a bit more. Here's another subjective two cents worth. "exit" seems to be a more global concept and "leave" seems more local. For instance, I leave a room but exit a buil

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
[Michael Walter] > How about simply "with block" or "guarded scope" or something like that? How would you use that to describe decimal.Context() objects after Nick adds the __enter__ and __exit__ magic methods? We want something as direct as, "xrange obje

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
[Ron Adam] > The terms __begin__ and __end__, are nearly as general, but they stress > better that there are three parts, a beginning, middle and ending. -1 Those are too generic to communicate anything. You would be better off using beginwith and endwith or somesuch. R

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
t). [Michael Hudson] > This is possible. I just wanted to expand everyone's minds :) Stick by your guns. The mechanism is more general than resource management. Like decorators, the encapsulation of a try/finally wrapper is completely generic and not m

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
> "Guarding a scope with a decimal.Context() object ." Doesn't "guard" suggestion conditional execution? Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/p

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
ning the guard" has a specific meaning with the "guard" part being consistent with the above. One example: http://www.cs.utexas.edu/users/psp/unity/notes/07-89.pdf IOW, guard is a specific term, not an amorphous metaphor that can be accurately applied to the enter/exit or enter/

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
s that our two new keywords are prepositions and the process that they apply to is somewhat abstract. Raymond P.S. I would still like to encourage the adoption of __leave__ instead of __exit__. The first suggests part of an enter/leave pair. The latter could too easily be taken as a standalon

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
One is expected to be used with "as" and the other is not. Neither of the above wordings begin to suggest whether decimal.Context.__enter__ will return a useful value (the PEP has examples of each). Raymond ___ Python-Dev mailing list Pyt

Re: [Python-Dev] floatobject.c 2.136

2005-07-04 Thread Raymond Hettinger
37, but you wouldn't know that from reading python-dev. A few years ago, the cc to python-dev was not automatic and the default reply address was the original committer. That worked much better. Raymond P.S. I still don't follow the whole yours/mine comment from Michael. The off

Re: [Python-Dev] Terminology for PEP 343

2005-07-04 Thread Raymond Hettinger
ork well. It's certainly the first case where I've been able to > easily explain what decimal.Context does (or will do) when used in a > 'with' statement. I think you're onto something. Stick with it. Your whole write-up is clear. It is the first one that does

Re: [Python-Dev] Request to add developer

2005-07-06 Thread Raymond Hettinger
> I wish to request that 'gregorykjohnson' be added to the Python SF > project. I'll enable the permissions tonight. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-d

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-06 Thread Raymond Hettinger
doesn't seem to be %s-encoded" % decoder.__name__ FWIW, the looping solution has worked out well in practice. From csv.py: for thisType in [int, long, float, complex]: try: thisType(row[col]) break except (ValueError, OverflowError):

Re: [Python-Dev] 'With' context documentation draft (was Re: Terminology for PEP 343

2005-07-06 Thread Raymond Hettinger
ls them. Remember, the methods will appear among a slew of other methods that have nothing to do with with-statements. There will be no surrounding contextual clue as to what these methods are for. Raymond ___ Python-Dev mailing list Python-Dev@python.org htt

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

2005-07-08 Thread Raymond Hettinger
l reports that don't fit one or all of those criteria. I don't want to unnecessarily raise the bar and not have someone report a potentially valid bug. IMO, the proposal is administrivia that doesn't add value and possibly makes things worse (by causing some folks to not go through th

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

2005-07-08 Thread Raymond Hettinger
g the standard library to cast a particular solution in stone. This doesn't preclude individual patches such as a context manager for decimal.Context objects. Each proposal should be considered on its own merits rather than as a part of an overall effort to ram a bunch of these in

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

2005-07-14 Thread Raymond Hettinger
> raymond> Log Message: > raymond> Brett requests that Flovis's permissions be dropped. [Skip] > 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 > h

Re: [Python-Dev] 'With' context documentation draft (was Re: Terminology for PEP 343

2005-07-14 Thread Raymond Hettinger
or "complicated". 'with' is not application specific, it is incredibly general. All it does is abstract recurring uses of try/finally. Naming it after a specific class of applications would be a mistake. Raymond ___ Python-Dev maili

Re: [Python-Dev] zlib 1.2.3 is just out

2005-07-23 Thread Raymond Hettinger
> Note zlib 1.2.3 is just out -- the zlib compression/decompression . . . > I'd guess this belongs in 2.5, with a possible retrofit for 2.4. +1 on backporting, but that is up to Anthony. Raymond ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] C api for built-in type set?

2005-07-25 Thread Raymond Hettinger
y well with this approach (many methods accept any iterable). The only inefficiencies that arise are with fine grained methods like __contains__() and add(); even then, it is no less efficient than pure Python. Raymond Hettinger ___ Python-Dev mailin

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-02 Thread Raymond Hettinger
[François Pinard] > While some say Subversion is the most reasonable avenue nowadays, others > them told me they found something more appealing than Subversion: > >http://www.venge.net/monotone/ The current release is 0.21 which suggests that it is not ready for primetim

Re: [Python-Dev] PEP, take 2: Exception Reorganization for Python 3.0

2005-08-02 Thread Raymond Hettinger
likelihood of either throwing away previous good decisions or adopting new ideas that later prove unworkable. IOW, unless the current tree is thought to be really bad, then the new tree ought to be very close to what we have now. Raymond > -Original Message- > From: [EMAIL PRO

Re: [Python-Dev] PEP, take 2: Exception Reorganization for Python 3.0

2005-08-03 Thread Raymond Hettinger
specific application (i.e. a case could be made that NotImplementedError is sometimes just a regular exception that can be expected to arise and be handled in the normal course of business). Unless we can point to real problems that people are having today, then these kind of changes are likely unw

[Python-Dev] PEP 342 Implementation

2005-08-04 Thread Raymond Hettinger
ut emerges immediately after: cvs up -D "2005-08-01 21:00" Raymond ___ 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] PEP, take 2: Exception Reorganization for Python 3.0

2005-08-05 Thread Raymond Hettinger
[ Guido] > One more thing. Is renaming NameError to NamespaceError really worth > it? I'd say that NameError is just as clear. +1 on NameError -- it's clear, easy to type, isn't a gratuitous change, and doesn't make you think twice about NamespaceError vs

Re: [Python-Dev] PEP, take 2: Exception Reorganization for Python 3.0

2005-08-05 Thread Raymond Hettinger
essarily better, and there is a high risk of introducing new usability problems. Raymond ___ 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

[Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Raymond Hettinger
n). Be careful with these proposals. While well intentioned, they have ramifications that aren't instantly apparent. Each one needs some deep thought, user discussion, usability testing, and a darned good reason for changing what we already hav

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Raymond Hettinger
e versus another. A common and basic use case for quick and dirty exceptions is to break out of nested loops and functions. That is control flow as well as quick-and-dirty. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.p

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Raymond Hettinger
[Raymond Hettinger wrote] > >The PEP moves StopIteration out from under Exception so that it cannot > >be caught by a bare except or an explicit "except Exception". > > > >IMO, this is a mistake. In either form, a programmer is stating that > >they want

Re: [Python-Dev] Exception Reorg PEP checked in

2005-08-05 Thread Raymond Hettinger
ated to bytecode). So UnboundFreeError is > > > raised when the interpreter cannot find a variable that is a free > > > variable. UnboundLocalError already exists. UnboundGlobalError is to > > > prevent NameError from being overloaded. UnboundFreeError is to > >

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-06 Thread Raymond Hettinger
truct. Your proposal breaks a major use case for it (preventing your sales demos from crashing in front of your customers, writing fault-tolerant programs, etc.) Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/l

[Python-Dev] FW: PEP 8: exception style

2005-08-06 Thread Raymond Hettinger
would also choose the second form. But why bother inflicting our preference on others, both forms are readable so we won't gain anything by dictating a style. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/l

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-06 Thread Raymond Hettinger
Exception:" are KeyboardInterrupt and SystemExit. Ah, I was too quick on the draw. It now appears that you were already converted :-) Now, if only the PEP would get updated ... BTW, why did you exclude MemoryError? Raymond ___ Python-Dev m

Re: [Python-Dev] Major revision of PEP 348 committed

2005-08-07 Thread Raymond Hettinger
etting your mind arbitrarily impose patterns on it. Raymond ___ 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] PEP 8: exception style

2005-08-07 Thread Raymond Hettinger
g two syntaxes. Treat this case the same as everything else: raise ValueError("blip", traceback=tb) Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mai

Re: [Python-Dev] PyTuple_Pack added references undocumented

2005-08-07 Thread Raymond Hettinger
> According to the source code, PyTuple_Pack returns a new reference (it > calls PyTuple_New). It also Py_INCREF's all the objects in the new > tuple. Is this unusual behavior? No. That is how containers work. Look at PyBuild_Value() for comparison. > None of these added references are doc

Re: [Python-Dev] Exception Reorg PEP revised yet again

2005-08-08 Thread Raymond Hettinger
ustrated at these reviews. Because there was no research into existing code, working to solve known problems, evaluation of alternatives, or usability analysis, it is no surprise Sturgeon's Law would apply. Since Python has been around so long, it is also no surprise that what we have now is p

Re: [Python-Dev] Exception Reorg PEP revised yet again

2005-08-09 Thread Raymond Hettinger
will ever use. Try not to add a new word whose only function is to replace a two-word tuple (TOOWTDI). Try not to unnecessarily nest the tree (FITBN). Try not to propose solutions to problems that don't exist (PBP). Raymond ___ Python-Dev ma

Re: [Python-Dev] Exception Reorg PEP revised yet again

2005-08-10 Thread Raymond Hettinger
e exception would be moved under > os, so it would be more of a renaming than a removal. Isn't OSError already used for another purpose (non-platform dependent exceptions raised by the os module)? Raymond ___ Python-Dev mailing list Pyth

Re: [Python-Dev] Exception Reorg PEP revised yet again

2005-08-10 Thread Raymond Hettinger
Mac errors and Linux errors. Also, it wouldn't tie a language feature to the name of an MS product. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.or

Re: [Python-Dev] Exception Reorg PEP revised yet again

2005-08-10 Thread Raymond Hettinger
ins. It is simply crummy design to take a multi-module, multi-application exception and push it down into a module namespace. +0 on renaming; +1 on leaving as-is. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mail

Re: [Python-Dev] Exception Reorg PEP revised yet again

2005-08-10 Thread Raymond Hettinger
> There > is a reason you listed writing a PEP on your own on the "School of > Hard Knocks" list; it isn't easy. I am trying my best here. Hang in there. Do what you can to make sure we get a result we can live with. -- R ___ Python-Dev mailing lis

Re: [Python-Dev] [Python-checkins] python/dist/src/Objectssetobject.c, 1.45, 1.46

2005-08-11 Thread Raymond Hettinger
a goal to eliminate redundant calls to PyObject_Hash(). The nice performance improvement was an unexpected bonus. Your questions are good. Thanks for reading the code and thinking about it. Hope you enjoy the new implementation which for the first time can outperform dicts in terms of both spa

Re: [Python-Dev] Exception Reorg PEP revised yet again

2005-08-11 Thread Raymond Hettinger
had been kept only for backwards compatibility. Raymond ___ 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] set.remove feature/bug

2005-08-12 Thread Raymond Hettinger
with any questions. Raymond ___ 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] plans for 2.4.2 and 2.5a1

2005-08-12 Thread Raymond Hettinger
[Josiah] > At this point, I'd be happy to get > /any/ mechanism, with a preference to struct and/or binascii Assign 1023290 to me and I'll get it done in the next month or so. Raymond ___ Python-Dev mailing list Python-Dev

[Python-Dev] Discussion draft: Proposed Py2.5 C API for set and frozenset objects

2005-08-13 Thread Raymond Hettinger
The object and types PySetObject subclass of object used for both sets and frozensets PySet_Type a basetype PyFrozenSet_Typea basetype The type check macros - PyFrozenS

Re: [Python-Dev] PEP 348 (exception reorg) revised again

2005-08-15 Thread Raymond Hettinger
tuple itself has been sufficiently obvious and explicit. This rationale assumes that code readers aren't smart enough to infer that SystemExit has something to do with termination. Raymond ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] PEP 348 (exception reorg) revised again

2005-08-15 Thread Raymond Hettinger
eaning clear: try: block() except SpecificException: se_handler() except: handle_everything_else() The pattern of use is similar to a "default" in a switch-case construct. Viewed out-of-context, one would ask "default WHAT&q

Re: [Python-Dev] On distributed vs centralised SCM for Python

2005-08-15 Thread Raymond Hettinger
s only a small learning curve to cvs users. Optionally adding svk to the mix allows us to get the benefits of a distributed system without any additional migration or support issues. Very nice. Raymond ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] PEP 347: Migration to Subversion

2005-08-16 Thread Raymond Hettinger
[Tim] > +1 from me. But, I don't think my vote should count much, and (sorry) > Guido's even less: what do the people who frequently check in want? > That means people like you (Martin), Michael, Raymond, Walter, Fred. > ... plus the release manager(s). +1 from me. CVS i

Re: [Python-Dev] SWIG and rlcompleter

2005-08-16 Thread Raymond Hettinger
shot based on the light conditions and camera settings. IOW, if you make the tools too smart, they become harder to use. Leica had it right all along. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python

Re: [Python-Dev] Deprecating builtin id (and moving it to sys())

2005-08-17 Thread Raymond Hettinger
use id() all the time and like having it as a builtin. Raymond ___ 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] SWIG and rlcompleter

2005-08-17 Thread Raymond Hettinger
, '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduc

Re: [Python-Dev] SWIG and rlcompleter

2005-08-17 Thread Raymond Hettinger
> > [Timothy Fitz] > > > It seems to > > > me that those who want dir to reflect __dict__ should just use > > > __dict__ in the first place. > > [Raymond] > > The dir() builtin does quite a bit more than obj.__dict__.keys(). > > Well that'

Re: [Python-Dev] PEP 309: Partial method application

2005-08-18 Thread Raymond Hettinger
[Ian Bicking] > I think partial() misses an important use case of method getting, for > instance: > > lst = ['A', 'b', 'C'] > lst.sort(key=partialmethod('lower')) We've already got one:

Re: [Python-Dev] PEP 309: Partial method application

2005-08-18 Thread Raymond Hettinger
> > We've already got one: > > > >lst.sort(key=operator.attrgetter('lower')) > > Doesn't that just sort on the str.lower or unicode.lower method object? My mistake. It sorts on the bound method rather than the results of applying that me

Re: [Python-Dev] PEP 309: Partial method application

2005-08-18 Thread Raymond Hettinger
[Guido] > They feel related to attrgetter more than to partial. That suggests operator.methodcall() ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options

Re: [Python-Dev] PEP 309: Partial method application

2005-08-19 Thread Raymond Hettinger
ith map(), if a new function doesn't fit neatly, take that as a cue to be writing a plain for-loop. Raymond ___ 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] [Python-checkins] python/dist/src setup.py, 1.219, 1.220

2005-08-22 Thread Raymond Hettinger
ompiler limit : too many open parentheses Also, there should be updating entries to Misc/NEWS, PC/VC6/pythoncore.dsp, and PC/config.c. Raymond ___ 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] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Raymond Hettinger
This patch should be reverted or fixed so that the Py2.5 build works again. It contains a disasterous search and replace error that prevents it from compiling. Hence, it couldn't have passed the test suite before being checked in. Also, all of the project and config files need to be updated fo

Re: [Python-Dev] PEP 342 Implementation

2005-08-23 Thread Raymond Hettinger
[Raymond Hettinger] > > > Could someone please make an independent check to verify an issue with > > the 342 checkin. The test suite passes but when I run IDLE and open a > > new window (using Control-N), it crashes and burns. > > > > The problem does

Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Raymond Hettinger
[Raymond Hettinger] > > This patch should be reverted or fixed so that the Py2.5 build works > > again. > > > > It contains a disasterous search and replace error that prevents it from > > compiling. Hence, it couldn't have passed the test suite before bei

Re: [Python-Dev] [Python-checkins]python/dist/src/Modules_hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Raymond Hettinger
[Gareth] > > It's valid C99, meaning "this is an unsigned long long". > since when does Python require C99 compilers? Except from PEP 7: "Use ANSI/ISO standard C (the 1989 version of the standard)." ___ Python-Dev mailing list Python-Dev@python.or

Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Raymond Hettinger
t dodgy. Except from PEP 7: "Use ANSI/ISO standard C (the 1989 version of the standard)." Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pytho

Re: [Python-Dev] [Python-checkins] python/dist/src setup.py, 1.219, 1.220

2005-08-23 Thread Raymond Hettinger
[Gregory P. Smith] > I don't have a win32 dev environment at the moment so i didn't see > that. Sorry. No big deal. But we still have to get the code back to ANSI compliance. Do you have an ANSI-strict option with your compiler? Raymond __

Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Raymond Hettinger
[Gregory P. Smith] > I just checked in an update removing all of the ULLs. Could you check > that it compiles on windows and passes test_hashlib.py now? Okay, all is well. Raymond ___ Python-Dev mailing list Python-Dev@python.or

[Python-Dev] Bare except clauses in PEP 348

2005-08-23 Thread Raymond Hettinger
ng around the mental confusion caused a bare except clause in the middle of a try-suite rather than at the end. We have to avoid code that looks like it does one thing but actually does something else. Raymond ___ Python-Dev mailing list Python-Dev@pyt

Re: [Python-Dev] Bare except clauses in PEP 348

2005-08-23 Thread Raymond Hettinger
a code review or inspection. I suspect it would. The code looks like does one thing but actually does something else. This may or may not be a big deal. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listin

[Python-Dev] FW: Bare except clauses in PEP 348

2005-08-24 Thread Raymond Hettinger
t example makes you think twice about whether the final case really does get everything (sometimes implicit IS better than explicit). Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] Bare except clauses in PEP 348

2005-08-24 Thread Raymond Hettinger
be a killer. I wonder if it is possible to treat BaseException as a constant (like we do with None) and teach the compiler to interpret it as catching anything that gets raised so that "except BaseException" will work like a bare except clause does now. Raymond ___

Re: [Python-Dev] Bare except clauses in PEP 348

2005-08-24 Thread Raymond Hettinger
like a bare except clause does now. > > Sorry Raymond, but my first reaction is "ick" :). That seems to be a > big change in the semantics of exception matching. I think I'd rather > keep bare except than add that! That may be your only other option if we're waiting until 3

Re: [Python-Dev] Bare except clauses in PEP 348

2005-08-25 Thread Raymond Hettinger
benefit from the whole PEP is that in 3.0, it will no longer be necessary to write "except (KeyError, SystemExit): raise". Steven and Jack's research show that that doesn't arise much in practice anyway. IOW, there's nothing worth inflicting destruction on tons of 2.x

Re: [Python-Dev] Bare except clauses in PEP 348

2005-08-25 Thread Raymond Hettinger
pt clauses weren't banned for 3.0, then we would have no problem writing code that works on all versions on Python from 2.0 to 3.0, that doen't break existing code, and that doesn't invalidate the text in Python books. IMO, that is a nice situation.

Re: [Python-Dev] Bare except clauses in PEP 348

2005-08-25 Thread Raymond Hettinger
> Deprecation means your code will still work I hope every book that > documents "except:" also adds "but don't use this except under very > special circumstances". > > I think you're overreacting (again), Raymond. 3.0 will be much more > successful

Re: [Python-Dev] Bare except clauses in PEP 348

2005-08-25 Thread Raymond Hettinger
is to leave bare excepts in for Py3.0. That buys us a happy world where code old code continues to work and new code can be written that functions as intended on all pythons new and old. I'm no fan of bare exceptions, but I'm not inclined to shoot myself in the foot to be rid of them. I w

Re: [Python-Dev] Remove str.find in 3.0?

2005-08-26 Thread Raymond Hettinger
> Can str.find be listed in PEP 3000 (under builtins) for removal? FWIW, here is a sample code transformation (extracted from zipfile.py). Judge for yourself whether the index version is better: Existing code: -- END_BLOCK = min(filesize, 1024 * 4) fpin.seek(filesize - END_B

Re: [Python-Dev] Remove str.find in 3.0?

2005-08-26 Thread Raymond Hettinger
. Each provided a new insight (zipfile was not improved, webbrowser was improved, and urlparse was about the same). Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://m

Re: [Python-Dev] Remove str.find in 3.0?

2005-08-27 Thread Raymond Hettinger
oposition. Why not use the wealth of data at our fingertips to augment a priori reasoning and anecdotes. I'm not at all arguing against the proposal; I'm just asking for a thoughtful design process. Raymond P.S. Josiah was not alone. The comp.lang.python discussion had other posts

Re: [Python-Dev] Remove str.find in 3.0?

2005-08-27 Thread Raymond Hettinger
have the option of introducing much cleaner iterator versions of these methods that use compact, fast, and readable for-loops instead of multi-statement while-loop boilerplate. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.or

Re: [Python-Dev] Remove str.find in 3.0?

2005-08-27 Thread Raymond Hettinger
except ValueError(): pass else: if optval[pos-1].isspace(): optval = optval[:pos] optval = optval.strip() . . . --- StringIO.py --- i = self.buf.find('\n', self.pos) if i < 0: newpos = self.len el

[Python-Dev] empty string api for files

2005-08-27 Thread Raymond Hettinger
> For reading bytes, I *know* that a lot of code would become uglier if > the API changed to raise EOFError exceptions I had StopIteration in mind. Instead of writing: while 1: block = f.read(20) if line == '': break . . . We would use: for block in

[Python-Dev] Remove str.find in 3.0?

2005-08-27 Thread Raymond Hettinger
[Guido] > However, after 12 years, I believe that the small benefit of having > find() is outweighed by the frequent occurrence of bugs in its use. My little code transformation exercise is bearing that out. Two of the first four cases in the standard library were buggy :-( R

Re: [Python-Dev] Remove str.find in 3.0?

2005-08-27 Thread Raymond Hettinger
[Tim] > You probably want "except ValueError:" in all these, not "except > ValueError():". Right. I was misremembering the new edict to write: raise ValueError() Raymond ___ Python-Dev mailing list Python-Dev@python.

Re: [Python-Dev] Remove str.find in 3.0?

2005-08-28 Thread Raymond Hettinger
ting > characters, which is about the lowest-level activity in programming -- > only counting bytes is lower!) > > Maybe if we had a *good* way of specifying string parsing we wouldn't > be needing to call find() or index() so much at all! (A good example > is the code that Raymo

Re: [Python-Dev] Remove str.find in 3.0?

2005-08-28 Thread Raymond Hettinger
IO.py, since the task at hand IS calculating an index, an indexless higher level construct doesn't help. However, many of the other s.find() use cases in the library simplify as readily and directly as the above cgi server example. Raymond --

Re: [Python-Dev] empty string api for files

2005-08-28 Thread Raymond Hettinger
f today's practice though. I believe this still comes up in 100% of the cases where you're buffering reads of large binary files. Given lot of RAM, this probably doesn't come up as much nowadays. Raymond ___ Python-Dev mailing list Python-D

Re: [Python-Dev] Remove str.find in 3.0?

2005-08-28 Thread Raymond Hettinger
1, in -toplevel- rest, query = rest.rsplit('?', 1) ValueError: need more than 1 value to unpack The whole point of str.partition() is to repackage str.split() in a way that is conducive to fulfilling many of the existing use cases for str.find() and str.index(). In going throu

[Python-Dev] Proof of the pudding: str.partition()

2005-08-28 Thread Raymond Hettinger
As promised, here is a full set of real-world comparative code transformations using str.partition(). The patch isn't intended to be applied; rather, it is here to test/demonstrate whether the new construct offers benefits under a variety of use cases. Overall, I found that partition() usefully e

Re: [Python-Dev] partition() (was: Remove str.find in 3.0?)

2005-08-29 Thread Raymond Hettinger
combined to the whole. IOW, it is exactly the right word. I won't part with it easily. http://www.google.com/search?q=quicksort+partition Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-d

Re: [Python-Dev] partition()

2005-08-30 Thread Raymond Hettinger
enefit from the length argument. I think you'll find that it comes up so infrequently and with such differing needs that it would be a mistake to bake this into the proposal. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mai

<    9   10   11   12   13   14   15   >