Re: [Python-Dev] The decorator(s) module

2006-02-17 Thread Georg Brandl
Ian Bicking wrote: >> Unfortunately, a @property decorator is impossible... > > It already works! But only if you want a read-only property. Which is > actually about 50%+ of the properties I create. So the status quo is > not really that bad. I have abused it this way too and felt bad ever

Re: [Python-Dev] Serial function call composition syntax foo(x, y) -> bar() -> baz(z)

2006-02-17 Thread Georg Brandl
Bengt Richter wrote: > Cut to the chase: how about being able to write > > baz(bar(foo(x, y)),z) > > serially as > > foo(x, y) -> bar() -> baz(z) > > via the above as sugar for > > baz.__get__(bar.__get__(foo(x, y))())(z) Reminds me of http://dev.perl.org/perl6/doc/design/syn/S03.

Re: [Python-Dev] The decorator(s) module

2006-02-18 Thread Georg Brandl
Guido van Rossum wrote: > WFM. Patch anyone? Done. http://python.org/sf/1434038 Georg > On 2/17/06, Ian Bicking <[EMAIL PROTECTED]> wrote: >> Alex Martelli wrote: >> > Maybe we could fix that by having property(getfunc) use >> > getfunc.__doc__ as the __doc__ of the resulting property object >>

Re: [Python-Dev] The decorator(s) module

2006-02-18 Thread Georg Brandl
Alex Martelli wrote: > On Feb 18, 2006, at 12:38 AM, Georg Brandl wrote: > >> Guido van Rossum wrote: >>> WFM. Patch anyone? >> >> Done. >> http://python.org/sf/1434038 > > I reviewed the patch and added a comment on it, but since the point > m

Re: [Python-Dev] buildbot is all green

2006-02-18 Thread Georg Brandl
Neal Norwitz wrote: > http://www.python.org/dev/buildbot/ > > Whoever is first to break the build, buys a round of drinks at PyCon! > That's over 400 people and counting: > http://www.python.org/pycon/2006/pycon-attendees.txt > > Remember to run the tests *before* checkin. :-) Don't we have a

[Python-Dev] Enhancements to the fileinput module

2006-02-19 Thread Georg Brandl
I've just checked in some enhancements to the fileinput module. * fileno() to check the current file descriptor * mode argument to allow opening in universal newline mode * openhook argument to allow transparent opening of compressed or encoded files. Please feel free to comment. Cheers, Georg

Re: [Python-Dev] buildbot is all green

2006-02-19 Thread Georg Brandl
Benji York wrote: > Neal Norwitz wrote: >> http://www.python.org/dev/buildbot/ > > If there's interest in slightly nicer buildbot CSS (something like > http://buildbot.zope.org/) I'd be glad to contribute. +1. Looks nice! Georg ___ Python-Dev mailing

Re: [Python-Dev] (-1)**(1/2)==1?

2006-02-20 Thread Georg Brandl
Jonathan Barbero wrote: > Hello! > My name is Jonathan, i´m new with Python. > >I try this in the command line: > >>>> (-1)**(1/2) > 1 > >This is wrong, i think it must throw an exception. > What do you think? >>> 1/2 0 >>> (-1)**0 1 It's fine. If you want to get a flo

Re: [Python-Dev] buildbot is all green

2006-02-20 Thread Georg Brandl
Martin v. Löwis wrote: > Steve Holden wrote: >> All formats would be improved of the headers could be made to float at >> the top of the page as scrolling took place. > > Can this be done in CSS? If so, contributions are welcome. Not as it is. The big table would have to be split so that there i

Re: [Python-Dev] PEP for Better Control of Nested Lexical Scopes

2006-02-21 Thread Georg Brandl
Greg Ewing wrote: >def my_func(): > namespace foo > foo.x = 42 > > def inc_x(): >foo.x += 1 > > The idea here is that foo wouldn't be an object in > its own right, but just a collection of names that > would be implemented as local variables of my_func. But why is tha

Re: [Python-Dev] Removing Non-Unicode Support?

2006-02-21 Thread Georg Brandl
M.-A. Lemburg wrote: > Note that I'm not saying that these switches are useless - of > course they do allow to strip down the Python interpreter. > I believe that only very few people are interested in having these > options and it's fair enough to put the burden of maintaining these > branches on

Re: [Python-Dev] Deprecate ``multifile``?

2006-02-21 Thread Georg Brandl
Barry Warsaw wrote: > On Fri, 2006-02-17 at 14:01 +0100, Georg Brandl wrote: >> Fredrik Lundh wrote: >> > Georg Brandl wrote: >> > >> >> as Jim Jewett noted, multifile is supplanted by email as much as mimify >> >> etc. >> >> but

Re: [Python-Dev] Deprecate ``multifile``?

2006-02-21 Thread Georg Brandl
Barry Warsaw wrote: > On Tue, 2006-02-21 at 17:18 +0100, Georg Brandl wrote: > >> > IIRC, when I brought this up ages ago, there was some grumbling that >> > multifile is useful for other than email/MIME applications. Still, I'm >> > +1 on PEP 4'ing it.

[Python-Dev] Two patches

2006-02-21 Thread Georg Brandl
Hi, I have two patches lying around here, please comment: * I think I've submitted this one to the tracker, but can't remember: It's for PySequence_SetItem and makes something like this possible: tup = ([], ) tup[0] += [1] I can upload it once more to allow review. * One patch for stat

Re: [Python-Dev] Two patches

2006-02-21 Thread Georg Brandl
Martin v. Löwis wrote: > Georg Brandl wrote: >> * I think I've submitted this one to the tracker, but can't remember: >> It's for PySequence_SetItem and makes something like this possible: >> >> tup = ([], ) >> tup[0] += [1] > > That de

Re: [Python-Dev] Using and binding relative names (was Re: PEP for Better Control of Nested Lexical Scopes)

2006-02-23 Thread Georg Brandl
Phillip J. Eby wrote: > At 03:49 PM 2/23/2006 +1300, Greg Ewing wrote: >>Steven Bethard wrote: >> > And, as you mention, it's consistent >> > with the relative import feature. >> >>Only rather vaguely -- it's really somewhat different. >> >>With imports, .foo is an abbreviation for myself.foo, >>w

Re: [Python-Dev] Dropping support for Win9x in 2.6

2006-02-24 Thread Georg Brandl
Neal Norwitz wrote: > Martin and I were talking about dropping support for older versions of > Windows (of the non-NT flavor). We both thought that it was > reasonable to stop supporting Win9x (including WinME) in Python 2.6. > I updated PEP 11 to reflect this. > > The Python 2.5 installer will

Re: [Python-Dev] cProfile prints to stdout?

2006-02-25 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > I just noticed that cProfile (like profile) prints to stdout. Yuck. I > guess that's to be expected because the pstats module does the actual > printing and it's used by both modules. I'm willing to give up backward > compatibility to achieve a little more sanity and f

Re: [Python-Dev] cProfile prints to stdout?

2006-02-25 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > Georg> Probably related: > > Georg> http://python.org/sf/1235266 > > Don't think so. That was just a documentation nit (and is now fixed and > closed at any rate). Well, it is another module that prints to stdout instead of stderr. Okay, not so closely relate

Re: [Python-Dev] Fwd: Translating docs

2006-02-25 Thread Georg Brandl
Facundo Batista wrote: > 2006/2/25, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > >> Translating the library reference as such is more difficult, because >> it can't be translated in small chunks very well. > > The SVN directory "python/dist/src/Doc/lib/" has 276 .tex's, with an > average of 250 lines

[Python-Dev] "as" mania

2006-03-07 Thread Georg Brandl
Hi, while "as" is being made a keyword, I remembered parallels between "with" and a proposal made some time ago: with expr as f: do something with f while expr as f: do something with f if expr as f: do something with f elif expr as f: do something else with f What do you think

Re: [Python-Dev] "as" mania

2006-03-07 Thread Georg Brandl
[HPH the BDFL] > I suggest you file those as products of an overactive imagination. :-) At least not only mine. ;) > Have you even tried to define precise semantics for any of those, like > the expansion of "with E as V: B" in PEP 343? Easily. if expr as name: BLOCK would be equivalent to

Re: [Python-Dev] "as" mania

2006-03-07 Thread Georg Brandl
Alex Martelli wrote: > I think the best use cases for 'assignment inside an if or while' > condition, as far as they go, require `capturing' a SUB-expression of > the condition, rather than the whole condition. E.g., in C, > > while ( (x=next_x()) < threshold ) ... > > being able to capture

Re: [Python-Dev] "as" mania

2006-03-07 Thread Georg Brandl
Guido van Rossum wrote: > On 3/7/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> > Have you even tried to define precise semantics for any of those, like >> > the expansion of "with E as V: B" in PEP 343? >> >> Easily. >> >> if expr

Re: [Python-Dev] quit() on the prompt

2006-03-08 Thread Georg Brandl
Jim Jewett wrote: > Ian reproposed: > > class Quitter(object): > def __init__(self, name): > self.name = name > def __repr__(self): > return 'Use %s() to exit' % self.name > def __call__(self): > raise SystemExit() > > The one

[Python-Dev] Bug Day?

2006-03-08 Thread Georg Brandl
Hi, I know, PyCon's just been, but not many bugs were closed and there really ought to be some issues resolved before 2.4.3 happens. The number of open bugs is again crawling to 900. I myself are looking at many bugs and patches over time, but with most of them I can't decide alone what to do. Wr

Re: [Python-Dev] quit() on the prompt

2006-03-09 Thread Georg Brandl
Guido van Rossum wrote: > We seem to have a consensus. Is anybody working on a patch yet? http://python.org/sf/1446372 Georg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.

[Python-Dev] Google ads on python.org?

2006-03-11 Thread Georg Brandl
Okay, if they were sensible, but: http://www.ph.tum.de/~gbrandl/python-vb.png Not that we want them to use Python... Georg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.

Re: [Python-Dev] libbzip2 version?

2006-03-11 Thread Georg Brandl
Martin v. Löwis wrote: > Alan McIntyre wrote: >> The current PCBuild/readme.txt directs people to >> http://sources.redhat.com/bzip2 to get the 1.0.2 version of libbz2. The >> RedHat link redirects to http://www.bzip.org, which shows that 1.0.3 was >> released in February 2005. I suggest that Pyt

[Python-Dev] decorator module patch

2006-03-12 Thread Georg Brandl
Hi, to underlay my proposals with facts, I've written a simple decorator module containing at the moment only the "decorator" decorator. http://python.org/sf/1448297 It is implemented as a C extension module _decorator which contains the decorator object (modelled after the functional.partial ob

Re: [Python-Dev] decorator module patch

2006-03-12 Thread Georg Brandl
Nick Coghlan wrote: > Georg Brandl wrote: >> Hi, >> >> to underlay my proposals with facts, I've written a simple decorator >> module containing at the moment only the "decorator" decorator. >> >> http://python.org/sf/1448297 >> &

Re: [Python-Dev] decorator module patch

2006-03-12 Thread Georg Brandl
Nick Coghlan wrote: > Alex Martelli wrote: >> On Mar 12, 2006, at 11:16 AM, Ian Bicking wrote: >> ... >>> memoize seems to fit into functools fairly well, though deprecated not >>> so much. functools is similarly named to itertools, another module >>> that >>> is kind of vague in scope (thou

Re: [Python-Dev] decorator module patch

2006-03-12 Thread Georg Brandl
Raymond Hettinger wrote: >> In PEP 356, there is even a suggestion to "add builtin @deprecated >> decorator?". > > Restraint please. Well, that sentence wasn't meant in the sense of "we should add it" but in the sense of "why shouldn't we put it in functools _if_ we add it, when it's even sugges

Re: [Python-Dev] Bug Day?

2006-03-15 Thread Georg Brandl
Neil Schemenauer wrote: > I think it would be a good idea to follow the Plone project and try > to encourage new developers by offering assistance to get them up > and running. AFAIK, we've done that for the other bug days but it > might help to publish the fact that no prior Python development >

Re: [Python-Dev] Py3k: Except clause syntax

2006-03-16 Thread Georg Brandl
Greg Ewing wrote: > For Py3k, any thoughts on changing the syntax of > the except clause from > >except , : > > to > >except as : > > so that things like > >except TypeError, ValueError: > > will do what is expected? +1. Fits well with the current use of "as". Georg __

Re: [Python-Dev] Python Library Reference top page too long

2006-03-16 Thread Georg Brandl
Greg Ewing wrote: > Russell E. Owen wrote: > >> Fundamentally I think what's wanted is: >> - Another level of sub-TOCs, e.g. one for "Sequence Types", "Mapping >> Types", etc. Every page that has sub-topics or intimately related should >> have a list of them at the beginning. >> - The special me

Re: [Python-Dev] Py3k: Except clause syntax

2006-03-17 Thread Georg Brandl
John J Lee wrote: >> In your formulation the comma binds more tightly than the as keyword. >> In import statements it's the other way around. That seems like it >> might be a source of confusion. > > Perhaps parentheses around the exception list should be mandatory for the > 2-or-more excepti

Re: [Python-Dev] Py3k: Except clause syntax

2006-03-17 Thread Georg Brandl
Brett Cannon wrote: > On 3/17/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> John J Lee wrote: >> >> >> In your formulation the comma binds more tightly than the as keyword. >> >> In import statements it's the other way around. That

Re: [Python-Dev] GeneratorExit inheriting from Exception

2006-03-18 Thread Georg Brandl
Barry Warsaw wrote: > On Sat, 2006-03-18 at 22:53 +1000, Nick Coghlan wrote: >> Should GeneratorExit inherit from Exception or BaseException? > > Actually, this prompts me to write about an issue I have with PEP 352. > I actually don't think it's necessary (yes, I know it's already in the > tree).

Re: [Python-Dev] __dict__ strangeness

2006-03-18 Thread Georg Brandl
[moving to python-dev] Alex Martelli wrote: > Georg Brandl <[EMAIL PROTECTED]> wrote: > >> can someone please tell me that this is correct and why: > > IMHO, it is not correct: it is a Python bug (and it would be nice to fix > it in 2.5). Fine. Credits go to Michal

[Python-Dev] Bug Day on Friday, 31st of March

2006-03-20 Thread Georg Brandl
Hello, it's time for the 7th Python Bug Day. The aim of the bug day is to close as many bugs, patches and feature requests as possible, this time with a special focus on new features that can still go into the upcoming 2.5 alpha release. When? ^ The bug day will take place on Friday, March 3

Re: [Python-Dev] [Python-checkins] r43126 - in python/trunk: Doc/lib/libsocket.tex Lib/socket.py Lib/test/test_socket.py Misc/NEWS Modules/socketmodule.c

2006-03-21 Thread Georg Brandl
Tim Peters wrote: > [Guido] >>> Accessor functions are typical for APIs translated too literally from >>> Java. (threading.py being an example :-( ) >>> >>> I'd like to change this as long as we're doing greenfield API design. > > [Geo

Re: [Python-Dev] [Python-checkins] TRUNK FREEZE for 2.5a1: 0000 UTC, Thursday 30th

2006-03-27 Thread Georg Brandl
Jeremy Hylton wrote: > On 3/27/06, Anthony Baxter <[EMAIL PROTECTED]> wrote: >> Ok, it's time to rock and roll. >> >>The SVN trunk is FROZEN for 2.5a1 from 00:00 UTC on >>Thursday 30th of March. >> >> I'll post again once it's open. Note that new features can keep going >> in during the alp

Re: [Python-Dev] pysqlite for 2.5?

2006-03-27 Thread Georg Brandl
Anthony Baxter wrote: > This came up before (back in October 2004!) but didn't go anywhere > since, AFAICR. Do we want to consider including pysqlite in Python > 2.5? It's the only DB adaptor that I'd really consider suitable for > shipping with the distribution, because it's self-contained. >

Re: [Python-Dev] I'm not getting email from SF when assigned abug/patch

2006-03-28 Thread Georg Brandl
Anthony Baxter wrote: > On Tuesday 28 March 2006 19:35, Giovanni Bajo wrote: >> Anthony Baxter <[EMAIL PROTECTED]> wrote: >> >> Another option would be Bugzilla, which is proven to be stable, >> >> maintained and used succesfully by large open source projects >> >> (like GCC+RedHat+Binutils+Classpa

[Python-Dev] Error msgs for new-style division

2006-03-28 Thread Georg Brandl
Hi, (this makes test_ctypes fail, therefore I noticed) currently with -Qnew: >>> 2/0 Traceback (most recent call last): File "", line 1, in ? ZeroDivisionError: float division >>> 2L/0 Traceback (most recent call last): File "", line 1, in ? ZeroDivisionError: long division or modulo by zero

Re: [Python-Dev] pysqlite for 2.5?

2006-03-28 Thread Georg Brandl
Gerhard Häring wrote: > Georg Brandl wrote: >> Anthony Baxter wrote: >> >>>This came up before (back in October 2004!) but didn't go anywhere >>>since, AFAICR. Do we want to consider including pysqlite in Python >>>2.5? It's the only DB adapto

[Python-Dev] What about PEP 299?

2006-03-28 Thread Georg Brandl
Hi, since I found myself writing "if __name__ == '__main__'" often these days, I wondered whether PEP 299 could be pronounced upon. I'm not proposing putting it into 2.5, but it should be relatively small a change. Cheers, Georg ___ Python-Dev mailing

Re: [Python-Dev] I'm not getting email from SF when assigned abug/patch

2006-03-28 Thread Georg Brandl
Martin v. Löwis wrote: > [EMAIL PROTECTED] wrote: >> Roundup is there now, right (sans SF export)? > > Richard Jones has an SF importer for one of the two XML-like formats, > the one that is correct XML but with incomplete data. The other format, > which has complete data but is ill-formed XML,

Re: [Python-Dev] pysqlite for 2.5?

2006-03-28 Thread Georg Brandl
Fredrik Lundh wrote: > Gerhard Häring wrote: > >> I know that pushing new things into Python 2.5 should happen soon, if at >> all. So *if* pysqlite should go into Python, I propose that I release >> pysqlite 2.2.0 and we integrate that into the Python alpha release. > > +1 ! > >> If this is goin

[Python-Dev] Reminder: Bug Day this Friday, 31st of March

2006-03-28 Thread Georg Brandl
Hello, it's time for the 7th Python Bug Day, just before 2.5 alpha 1 is released. The aim of the bug day is to close as many bugs, patches and feature requests as possible, this time with a focus on small feature additions that can still go into the upcoming 2.5 alpha release. When? ^ The bu

Re: [Python-Dev] pysqlite for 2.5?

2006-03-29 Thread Georg Brandl
Neal Norwitz wrote: > On 3/28/06, Gerhard Häring <[EMAIL PROTECTED]> wrote: >> >> > Even better, the authors should be willing to keep the version in >> > Python synchronized with the separate release. >> >> In particular, I would then synchronize changes that have proven stable >> in the standalon

Re: [Python-Dev] pysqlite for 2.5?

2006-03-29 Thread Georg Brandl
Bill Janssen wrote: >> I think short names are more more consistent with the existing naming in >> the standard library. > > Which doesn't make it a good idea. +1 on adding longer top-level > package names as aliases for existing shorter top-level package names. Which existing short names do yo

Re: [Python-Dev] What about PEP 299?

2006-03-29 Thread Georg Brandl
Guido van Rossum wrote: > Die, thread. > > Do I personally have to go into svn and reject this PEP? After my latest channeling disaster, I was cautious about this one ;) I'll reject it now. Georg ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] pysqlite for 2.5?

2006-03-29 Thread Georg Brandl
Phillip J. Eby wrote: > At 11:36 AM 3/29/2006 -0800, Guido van Rossum wrote: >>On 3/28/06, Anthony Baxter <[EMAIL PROTECTED]> wrote: >> > I'm happy to work with Gerhard to make this happen. Does it need a >> > PEP? I'd say "no", but only because things like ElementTree didn't, >> > either. Does it

Re: [Python-Dev] I'm not getting email from SF whenassignedabug/patch

2006-03-30 Thread Georg Brandl
Fredrik Lundh wrote: > Neal Norwitz wrote: > >> I'm in favor of having Atlassian setup a system to be used for 3k. It >> would be completely experimental and could be completely thrown away >> which should be made clear to Atlassian if we were to do this. I >> would use the system for evaluation

Re: [Python-Dev] Class decorators

2006-03-30 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote on > 30/03/2006 11:38:30: > >> Jack Diederich wrote: >> >> > Classes have a unique property in that they are the easiest way to > make >> > little namespaces in python. >> >> For a while now, I've been wondering whether it would >> be worth ha

Re: [Python-Dev] I'm not getting email from SF whenassignedabug/patch

2006-03-30 Thread Georg Brandl
Barry Warsaw wrote: > On Thu, 2006-03-30 at 10:39 +0200, Georg Brandl wrote: > >> Perhaps that Jira is commercial, so it is out of the question for most >> open-source Python applications. > > Sorry, I don't follow. Why is a commercial product out of the question &

Re: [Python-Dev] I'm not getting email from SFwhenassignedabug/patch

2006-03-30 Thread Georg Brandl
Fredrik Lundh wrote: > Georg Brandl wrote: > >> What I answered to was: >> >> """ >> from what I can tell, no big contemporary Python project use Atlassian. >> they all use Trac. there are thousands of Python developers out there >> that a

Re: [Python-Dev] pysqlite for 2.5?

2006-03-30 Thread Georg Brandl
M.-A. Lemburg wrote: > Anthony Baxter wrote: >> On Friday 31 March 2006 02:04, M.-A. Lemburg wrote: Excellent point. Hm. Maybe we should just go with 'sqlite', instead. >>> Anything, but please no "db" or "database" top-level module or >>> package :-) >> >> >> How about "sql"? >> >> I

Re: [Python-Dev] pysqlite for 2.5?

2006-03-30 Thread Georg Brandl
Anthony Baxter wrote: > On Friday 31 March 2006 02:04, M.-A. Lemburg wrote: >> > Excellent point. Hm. Maybe we should just go with 'sqlite', >> > instead. >> >> Anything, but please no "db" or "database" top-level module or >> package :-) > > > How about "sql"? > > I can't think of a better nam

[Python-Dev] 2.5 trunk built for Windows available?

2006-03-30 Thread Georg Brandl
Hi, for the Bug Day, someone asked me if there is a prebuilt trunk for Windows available somewhere so that he could participate. Martin: I read you've built for a snapshot AMD64, is there one for x86 too? Georg ___ Python-Dev mailing list Python-Dev@p

[Python-Dev] New-style icons, .desktop file

2006-03-31 Thread Georg Brandl
Hi, some time ago, someone posted in python-list about icons using the Python logo from the new site design [1]. IMO they are looking great and would be a good replacement for the old non-scaling snakes on Windows in 2.5. While we're at it, Python (and IDLE) .desktop files could be added to the d

Re: [Python-Dev] [Python-checkins] r43545 - in python/trunk: Doc/lib/libcalendar.tex Lib/calendar.py

2006-04-01 Thread Georg Brandl
Tim Peters wrote: >> Author: walter.doerwald >> Date: Sat Apr 1 22:40:23 2006 >> New Revision: 43545 >> >> Modified: >>python/trunk/Doc/lib/libcalendar.tex >>python/trunk/Lib/calendar.py >> Log: >> Make firstweekday a simple attribute instead >> of hiding it behind a setter and a getter. >

Re: [Python-Dev] Bug Day on Friday, 31st of March

2006-04-02 Thread Georg Brandl
Tim Peters wrote: > [/F] >> so, how did it go? a status report / summary would be nice, I think ? 19 bugs, 9 patches (which were mostly created to fix one of the bugs). Not much, but better than nothing and there has been quite a participation from "newbies". > http://wiki.python.org/moin/Py

Re: [Python-Dev] tally (and other accumulators)

2006-04-04 Thread Georg Brandl
Alex Martelli wrote: > On Apr 4, 2006, at 8:01 AM, Jeremy Hylton wrote: > >> On 4/4/06, Alex Martelli <[EMAIL PROTECTED]> wrote: >>> import collections >>> def tally(seq): >>> d = collections.defaultdict(int) >>> for item in seq: >>> d[item] += 1 >>> return dict(d) > ..

Re: [Python-Dev] Should issubclass() be more like isinstance()?

2006-04-04 Thread Georg Brandl
Crutcher Dunnavant wrote: > While nocking together a framework today, I ran into the amazing > limitations of issubclass(). > > A) issubclass() throws a TypeError if the object being checked is not > a class, which seems very strange. It is a predicate, and lacking a > isclass() method, it should

[Python-Dev] dis module and new-style classes

2006-04-06 Thread Georg Brandl
Hi, dis.dis currently handles new-style classes stepmotherly: given class C(object): def Cm(): pass class D(object): def Dm(): pass dis.dis(C) doesn't touch D, and dis.dis(C()) doesn't touch anything. Should it be fixed? It may need some reworking in dis.dis. Georg ___

Re: [Python-Dev] dis module and new-style classes

2006-04-06 Thread Georg Brandl
n't you mean "dis.dis(D) doesn't touch C"?) No. > On 4/6/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> Hi, >> >> dis.dis currently handles new-style classes stepmotherly: given >> >> class C(object): >> def Cm(): pass >> cla

[Python-Dev] str.partition?

2006-04-06 Thread Georg Brandl
Hi, a while ago, Raymond proposed str.partition, and I guess the reaction was positive. So what about including it now? Georg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail

Re: [Python-Dev] New-style icons, .desktop file

2006-04-06 Thread Georg Brandl
Nick Coghlan wrote: > Georg Brandl wrote: >> Hi, >> >> some time ago, someone posted in python-list about icons using the Python >> logo from the new site design [1]. IMO they are looking great and would >> be a good replacement for the old non-scaling snakes

Re: [Python-Dev] elementtree in stdlib

2006-04-07 Thread Georg Brandl
Greg Ewing wrote: > Trent Mick wrote: > >> try: >> import xml.etree.ElementTree as ET # in python >=2.5 >> except ImportError: > >... etc ad nauseam > > For situations like this I've thought it might > be handy to be able to say > >import xml.etree.ElementTree or cEl

Re: [Python-Dev] elementtree in stdlib

2006-04-07 Thread Georg Brandl
Nick Coghlan wrote: > Georg Brandl wrote: >> Greg Ewing wrote: >>> Trent Mick wrote: >>> >>>> try: >>>> import xml.etree.ElementTree as ET # in python >=2.5 >>>> except ImportError: >>> >... etc

Re: [Python-Dev] Who understands _ssl.c on Windows?

2006-04-08 Thread Georg Brandl
Michael Hudson wrote: > "Tim Peters" <[EMAIL PROTECTED]> writes: > >> _Perhaps_ it's the case that doubles are aligned to an 8-byte boundary >> when socketmodule.c is compiled, but (for some unknown reason) only to >> a 4-byte boundary when _ssl.c is compiled. Although that seems to >> match the

Re: [Python-Dev] Request for review

2006-04-12 Thread Georg Brandl
Seo Sanghyeon wrote: > Can someone have a look at #860326? I got bitten by it today, and I can > see no reason not to apply suggested patch. I've reviewed it and checked it in. Cheers, Georg ___ Python-Dev mailing list Python-Dev@python.org http://mail

Re: [Python-Dev] Request for review

2006-04-12 Thread Georg Brandl
Georg Brandl wrote: > Seo Sanghyeon wrote: >> Can someone have a look at #860326? I got bitten by it today, and I can >> see no reason not to apply suggested patch. > > I've reviewed it and checked it in. Hm. This broke a few doctests. I can fix them, but I wonder if do

Re: [Python-Dev] [Python-checkins] r45321 - in python/trunk: Lib/test/test_traceback.py Lib/traceback.py Misc/NEWS

2006-04-13 Thread Georg Brandl
Tim Peters wrote: > [georg.brandl] >> Author: georg.brandl >> Date: Wed Apr 12 23:14:09 2006 >> New Revision: 45321 >> >> Modified: >>python/trunk/Lib/test/test_traceback.py >>python/trunk/Lib/traceback.py >>python/trunk/Misc/NEWS >> Log: >> Patch #860326: traceback.format_exception_onl

Re: [Python-Dev] Any reason that any()/all() do not take a predicate argument?

2006-04-13 Thread Georg Brandl
Mikhail Glushenkov wrote: > Hi, > > sorry if this came up before, but I tried searching the archives and > found nothing. It would be really nice if new builtin truth functions > in 2.5 took a predicate argument(defaults to bool), so one could > write, for example: > > seq = [1,2,3,4,5] > if any

Re: [Python-Dev] [Python-checkins] r45321 - in python/trunk: Lib/test/test_traceback.py Lib/traceback.py Misc/NEWS

2006-04-13 Thread Georg Brandl
Tim Peters wrote: > [Georg Brandl] >> Well, it's tempting to let the buildbots run the tests for you >> Honestly, I didn't realize that doctest relies on traceback. Running >> the test suite takes over half an hour on this box, so I decided to >> take a ch

Re: [Python-Dev] New-style icons, .desktop file

2006-04-27 Thread Georg Brandl
Martin v. Löwis wrote: > Fredrik Lundh wrote: >> you do wonderful stuff, and then you post the announcement as a >> followup to a really old message, to make sure that people using a >> threaded reader only stumbles upon this by accident... this should >> be on the python.org frontpage! > > I als

Re: [Python-Dev] what do you like about other trackers and what do you hate about SF?

2006-04-27 Thread Georg Brandl
Brett Cannon wrote: > I am starting to hash out what the Call for Trackers is going to say > on the Infrastructure mailing list. Laura Creighton suggested we have > a list of features that we would like to see and what we all hate > about SF so as to provide some guidelines in terms of how to set

Re: [Python-Dev] 2.5 open issues

2006-04-28 Thread Georg Brandl
Martin v. Löwis wrote: > Neal Norwitz wrote: >> Who is the owner for getting new icons installed with the new logo? > > Nobody, so far (for Windows). Somebody should contact the owner and > find out what the license on this work is, and then tell me what > to do with them. I assume the py and pyc

[Python-Dev] Float formatting and #

2006-04-28 Thread Georg Brandl
Is there a reason why the "alternate format" isn't documented for float conversions in http://docs.python.org/lib/typesseq-strings.html ? '%#8.f' % 1.0 keeps the decimal point while '%8.f' % 1.0 drops it. Also, for %g the alternate form keeps trailing zeroes. While at it, I noticed a difference

Re: [Python-Dev] Float formatting and #

2006-04-28 Thread Georg Brandl
Georg Brandl wrote: > Is there a reason why the "alternate format" isn't documented for float > conversions in http://docs.python.org/lib/typesseq-strings.html ? > > '%#8.f' % 1.0 keeps the decimal point while '%8.f' % 1.0 drops it. > >

Re: [Python-Dev] 2.5 open issues

2006-04-29 Thread Georg Brandl
Neal Norwitz wrote: > Here's what's left for 2.5 after the most recent go around. > > There's no owner for these items. If no one takes them, they won't > get done and I will move them to deferred within a week: > > * Add @decorator decorator to functional, rename to functools? > What's th

Re: [Python-Dev] [Python-checkins] r45770 - in python/trunk:

2006-04-29 Thread Georg Brandl
A.M. Kuchling wrote: > On Fri, Apr 28, 2006 at 01:13:21AM +0200, thomas.wouters wrote: >> - Warn-raise ImportWarning when importing would have picked up a directory >>as package, if only it'd had an __init__.py. This swaps two tests (for >>case-ness and __init__-ness), but case-test is not

[Python-Dev] Problem with inspect and PEP 302

2006-04-30 Thread Georg Brandl
Recently, the inspect module was updated to conform with PEP 302. Now this is broken: >>> import inspect >>> inspect.stack() The traceback shows clearly what's going on. However, I don't know how to resolve the problem. Georg ___ Python-Dev mailing l

Re: [Python-Dev] Adding functools.decorator

2006-04-30 Thread Georg Brandl
Nick Coghlan wrote: > Collin Winters has done the work necessary to rename PEP 309's functional > module to functools and posted the details to SF [1]. > > I'd like to take that patch, tweak it so the C module is built as _functools > rather than functools, and then add a functools.py consisting

Re: [Python-Dev] Adding functools.decorator

2006-04-30 Thread Georg Brandl
Guido van Rossum wrote: > On 4/30/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> Nick Coghlan wrote: >> > Collin Winters has done the work necessary to rename PEP 309's functional >> > module to functools and posted the details to SF [1]. >> > >

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-04-30 Thread Georg Brandl
Zachary Pincus wrote: > Some thoughts from a lurker, largely concerning syntax; discount as > you wish. > > First: >> Keyword-only arguments are not required to have a default value. >> Since Python requires that all arguments be bound to a value, >> and since the only way to bind

Re: [Python-Dev] PEP 3101: Advanced String Formatting

2006-04-30 Thread Georg Brandl
Zachary Pincus wrote: > I'm not sure about introducing a special syntax for accessing > dictionary entries, array elements and/or object attributes *within a > string formatter*... much less an overloaded one that differs from > how these elements are accessed in "regular python". Yes, I als

Re: [Python-Dev] more pyref: a better term for "string conversion"

2006-05-02 Thread Georg Brandl
Guido van Rossum wrote: > Backticks certainly are deprecated -- Py3k won't have them (nor will > they become available for other syntax; they are undesirable > characters due to font issues and the tendency of word processing > tools to generate backticks in certain cases where you type forward > t

Re: [Python-Dev] test failures in test_ctypes (HEAD)

2006-05-02 Thread Georg Brandl
Guido van Rossum wrote: > I see test failures in current HEAD on my Google Red Hat Linux desktop > that the buildbots don't seem to have: > > ./python -E -tt ../Lib/test/regrtest.py test_ctypes > test_ctypes > test test_ctypes failed -- errors occurred; run in verbose mode for details > > More de

Re: [Python-Dev] Python long command line options

2006-05-04 Thread Georg Brandl
Heiko Wundram wrote: > Anyway, back on topic, I personally agree with the people who posted to > comp.lang.python that --version (and possibly --help, possibly other long > parameters too) would be useful additions to Pythons command-line parameters, > as it's increasingly getting more common a

Re: [Python-Dev] lambda in Python

2006-05-04 Thread Georg Brandl
xahlee wrote: > I do not wish to be the subject of mobbing here. > > If you have opinions on what i wrote, respond to the subject on topic > as with any discussion. Please do not start a gazillion war-cry on me. > > If you cannot tolerate the way i express my opinions, at this moment > write

[Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Georg Brandl
Hi, which formatting code should be used for a Py_ssize_t value in e.g. PyString_FromFormat? '%zd' won't work since my value can be negative, and the 'z' modifier converts the argument to size_t. Georg ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Georg Brandl
Martin v. Löwis wrote: > Georg Brandl wrote: >> which formatting code should be used for a Py_ssize_t value in e.g. >> PyString_FromFormat? > > %zd > >> '%zd' won't work since my value can be negative, and the 'z' modifier >> converts

Re: [Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Georg Brandl
Martin v. Löwis wrote: > Georg Brandl wrote: >> Similary, there's no way for a structmember to be of type Py_ssize_t... > > Right. At least, not with changing structmember.[ch]. Did you mean "without"? Can I submit a patch? Georg

Re: [Python-Dev] zlib module doesn't build - inflateCopy() not found

2006-05-20 Thread Georg Brandl
Martin v. Löwis wrote: > Guido van Rossum wrote: >> It seems I have libz 1.1.4. Is this no longer supported? > > Apparently so. This function started to be used with > > > r46012 | georg.brandl | 2006-05-16 09:38:27 +0200 (D

[Python-Dev] Import hooks falling back on built-in import machinery?

2006-05-25 Thread Georg Brandl
While working on a patch involving sys.path_importer_cache, I discovered that if a path_hooks import hook has been found for a given sys.path entry, but isn't able to import a specific module, find_module() tries to import the module from this sys.path entry as a regular file. This results in e.g.

<    10   11   12   13   14   15   16   >