[RELEASED] Python 3.2.5 and Python 3.3.2

2013-05-15 Thread Georg Brandl
report bugs to http://bugs.python.org/ (Thank you to those who reported these regressions.) Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and all contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.19 (GNU/Linux

[RELEASED] Python 3.3.0 beta 1

2012-06-26 Thread Georg Brandl
ng any bugs you may notice to: http://bugs.python.org/ Enjoy! (*) Please note that this document is usually finalized late in the release cycle and therefore may have stubs and missing entries at this point. -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.3's contributors) -- http://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.3.0 beta 2

2012-08-12 Thread Georg Brandl
.0 visit: http://www.python.org/download/releases/3.3.0/ Please consider trying Python 3.3.0 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! (*) Please note that this document is usually finalized late in the release cycle and therefore may h

[RELEASED] Python 3.3.0 release candidate 1

2012-08-25 Thread Georg Brandl
otal, almost 500 API items are new or improved in Python 3.3. For a more extensive list of changes in 3.3.0, see http://docs.python.org/3.3/whatsnew/3.3.html To download Python 3.3.0 visit: http://www.python.org/download/releases/3.3.0/ Please consider trying Python 3.3.0 with you

[RELEASED] Python 3.3.0 release candidate 2

2012-09-09 Thread Georg Brandl
eases/3.3.0/ Please consider trying Python 3.3.0 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.3's contributors) -BEGIN PGP SIGNATURE- Ve

[RELEASED] Python 3.3.0 release candidate 3

2012-09-23 Thread Georg Brandl
eases/3.3.0/ Please consider trying Python 3.3.0 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.3's contributors) -BEGIN PGP SIGNATURE- Ve

[RELEASED] Python 3.3.0

2012-09-29 Thread Georg Brandl
of changes in 3.3.0, see http://docs.python.org/3.3/whatsnew/3.3.html To download Python 3.3.0 visit: http://www.python.org/download/releases/3.3.0/ This is a production release, please report any bugs to http://bugs.python.org/ Enjoy! -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.3's contributors) -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASED] Python 3.3.0

2012-09-30 Thread Georg Brandl
On 09/29/2012 06:53 PM, Antoine Pitrou wrote: Hello, I've created a 3.3 category on the buildbots: http://buildbot.python.org/3.3/ http://buildbot.python.org/3.3.stable/ Someone will have to update the following HTML page: http://python.org/dev/buildbot/ Should be done now. Georg -- http:

[RELEASED] Python 3.3.0 alpha 1

2012-03-04 Thread Georg Brandl
s such as "sendfile()" For a more extensive list of changes in 3.3.0, see http://docs.python.org/3.3/whatsnew/3.3.html To download Python 3.3.0 visit: http://www.python.org/download/releases/3.3.0/ Please consider trying Python 3.3.0a1 with your code and reporting any bugs you

[RELEASED] Python 3.3.0 alpha 1

2012-04-01 Thread Georg Brandl
ython.org/ Enjoy! (*) Please note that this document is usually finalized late in the release cycle and therefore may have stubs and missing entries at this point. - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.3's cont

[RELEASED] Python 3.3.0 alpha 2

2012-04-01 Thread Georg Brandl
any bugs you may notice to: http://bugs.python.org/ Enjoy! (*) Please note that this document is usually finalized late in the release cycle and therefore may have stubs and missing entries at this point. - - -- Georg Brandl, Release Manager georg at python

[RELEASED] Python 3.3.0 alpha 3

2012-05-01 Thread Georg Brandl
3.0 visit: http://www.python.org/download/releases/3.3.0/ Please consider trying Python 3.3.0 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! (*) Please note that this document is usually finalized late in the release cycle and therefore

[RELEASED] Python 3.3.0 alpha 4

2012-05-31 Thread Georg Brandl
load Python 3.3.0 visit: http://www.python.org/download/releases/3.3.0/ Please consider trying Python 3.3.0 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! (*) Please note that this document is usually finalized late in the release cycle and

[RELEASED] Python 3.2.1 rc 2

2011-07-04 Thread Georg Brandl
http://docs.python.org/3.2/whatsnew/3.2.html To download Python 3.2.1 visit: http://www.python.org/download/releases/3.2.1/ This is a testing release: Please consider trying Python 3.2.1 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! -- Georg

[RELEASED] Python 3.2.1

2011-07-10 Thread Georg Brandl
features in the 3.2 line, see http://docs.python.org/3.2/whatsnew/3.2.html To download Python 3.2.1 visit: http://www.python.org/download/releases/3.2.1/ This is a final release: Please report any bugs you may notice to: http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release

[RELEASED] Python 3.2.2

2011-09-04 Thread Georg Brandl
list of changes in 3.2, see http://docs.python.org/3.2/whatsnew/3.2.html To download Python 3.2 visit: http://www.python.org/download/releases/3.2/ Please consider trying Python 3.2 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! - -- Georg

[RELEASED] Python 3.2.1 rc 1

2011-05-17 Thread Georg Brandl
http://docs.python.org/3.2/whatsnew/3.2.html To download Python 3.2.1 visit: http://www.python.org/download/releases/3.2.1/ This is a testing release: Please consider trying Python 3.2.1 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! -- Georg

Help on project, anyone?

2005-01-23 Thread Georg Brandl
Hello, to train my Python skills I am looking for some project I can contribute to. I learned Python about one year ago, and had already some programming background behind (I contributed to SharpDevelop for instance), so I'm not the complete newbie. About myself: I'm a 20 year old German with str

Re: finding name of instances created

2005-01-23 Thread Georg Brandl
Michael Tobis wrote: > I have a similar problem. Here's what I do: > > .def new_robot_named(name,indict=globals()): > . execstr = name + " = robot('" + name + "')" > . exec(execstr,indict) > > .class robot(object): > . def __init__(self,name): > . self.name = name > > . def sayhi(se

Re: What is print? A function?

2005-01-23 Thread Georg Brandl
Roy Smith wrote: >> So I wonder, what _is_ exactly the print statement? The untraditional way of >> invoking it(without paranteses) makes me wonder. > > It's a statement, just like "write" in Fortran. When C came around, the > idea of a language having no built-in print statement and having to

Re: MySQLdb - Tuples

2005-02-02 Thread Georg Brandl
Andy Dustman wrote: > #33 > #! /usr/bin/env python > import MySQLdb > db=MySQLdb.connect(host='localhost', db='photum_0_6_2', user='root', > passwd='thkhgfgd') > c=db.cursor() > c.execute('select person from persons order by person') > for (person,) in c: # o

Re: mounting a filesystem?

2005-02-05 Thread Georg Brandl
Dan Stromberg wrote: > Is there a python module that can mount a filesystem? > > More specifically, a loopback filesystem with a particular offset, under > linux? Why don't you just call the mount command via os.system, one of the popen methods or one of the commands.* methods? Georg -- http://

Re: Alternative to standard C "for"

2005-02-05 Thread Georg Brandl
BJörn Lindqvist wrote: >> I am quite new to Python, and have a straight & simple question. >> In C, there is for (init; cond; advance). We all know that. >> In Python there are two ways to loop over i=A..B (numerical.): >> 1) i = A >>while i> ...do something... >> i+=STEP > > This

Re: Alternative to standard C "for"

2005-02-05 Thread Georg Brandl
Alex Martelli wrote: > Georg Brandl <[EMAIL PROTECTED]> wrote: > >> Slight terminology glitch -- it does return an iterator, not a >> generator. Generators are functions that return iterators. > > xrange returns an ITERABLE, not an ITERATOR. Videat: > &g

Features for a Python package manager?

2004-12-25 Thread Georg Brandl
Hello c.l.py, what features would you expect of a Python package manager, similar to CPAN or rubygems? I am currently planning to write such a thing, at first privately for myself, and if it's proving useful, I think about releasing it. I plan to model it after gentoo's portage, with less featur

Re: Features for a Python package manager?

2004-12-25 Thread Georg Brandl
Robert Kern wrote: > Mike Meyer wrote: >> Nick Coghlan <[EMAIL PROTECTED]> writes: >> >> >>>I don't know enough about Portage to answer that question. I do know >>>any package manager which made it into the standard distribution would >>>need to work for at least the big three platforms (Windows/

Re: Features for a Python package manager?

2004-12-26 Thread Georg Brandl
Robert Kern wrote: > Georg Brandl wrote: >> Robert Kern wrote: >> >>>Mike Meyer wrote: >>> >>>>Nick Coghlan <[EMAIL PROTECTED]> writes: >>>> >>>> >>>> >>>>>I don't know enough about Porta

Re: More elegant way to cwd?

2004-12-28 Thread Georg Brandl
M.E.Farmer wrote: > Peter Hansen wrote: > [snip] >> Other than using os.pardir instead of '..', and possibly adding >> an "os.path.abspath()" call to the last bit (or does realpath >> already do that? It's unclear from the docs) > [snip] > I believe os.path.abspath and os.path.realpath are the sam

"specialdict" module

2005-04-03 Thread Georg Brandl
Hello, in follow-up to the recent "dictionary accumulator" thread, I wrote a little module with several subclassed dicts. Comments (e.g. makes it sense to use super), corrections, etc.? Is this PEP material? Docstrings, Documentation and test cases are to be provided later. mfg Georg -

Re: "specialdict" module

2005-04-03 Thread Georg Brandl
Jeff Epler wrote: > The software you used to post this message wrapped some of the lines of > code. For example: >> def __delitem__(self, key): >> super(keytransformdict, self).__delitem__(self, >> self._transformer(key)) Somehow I feared that this would happen. > In defaultdict, I w

Re: "specialdict" module

2005-04-03 Thread Georg Brandl
Michael Spencer wrote: > 1. Given that these are specializations, why not have: > > class defaultvaluedict(dict): > ... > > class defaultfactorydict(dict): > ... > > rather than having to jump through hoops to make one implementation satisfy > both > cases I think I like Jeff's app

Re: "specialdict" module

2005-04-04 Thread Georg Brandl
Michael Spencer wrote: > Georg Brandl wrote: > >> >> I think I like Jeff's approach more (defaultvalues are just special >> cases of default factories); there aren't many "hoops" required. >> Apart from that, the names just get longer ;) > &

Re: "specialdict" module

2005-04-04 Thread Georg Brandl
Michele Simionato wrote: > About not using super: you might have problems in multiple inheritance. > Suppose I want to use both your defaultdict and a thirdpartdict. A > subclass > > class mydict(defaultdict, thirdpartdict): >pass > > would not work if thirdpartdict requires a non-trivial __i

Re: "specialdict" module

2005-04-04 Thread Georg Brandl
Georg Brandl wrote: > Michele Simionato wrote: >> About not using super: you might have problems in multiple inheritance. >> Suppose I want to use both your defaultdict and a thirdpartdict. A >> subclass >> >> class mydict(defaultdict, thirdpartdict): &g

Re: re module non-greedy matches broken

2005-04-05 Thread Georg Brandl
lothar wrote: > give an re to find every innermost "table" element: > > innertabdoc = """ > > > >n > > > > > > > > > >y z > > > > > > > > > > > > > """ REs are Regular Expressions, not parsers. There are problems for which there is no RE

Re: os.path query functions behavior incorrect?

2005-04-05 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > It works fine under linux > [EMAIL PROTECTED]:~ $ python > Python 2.3.4 (#2, Feb 2 2005, 11:10:56) > [GCC 3.3.4 (Debian 1:3.3.4-9ubuntu5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import os.path os.path.exists('/blah')

Re: Best editor?

2005-04-05 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > ChinStrap wrote: >> When not using the interactive prompt, what are you using? I keep >> hearing everyone say Emacs, but I can't understand it at all. I keep >> trying to learn and understand why so many seem to like it because I >> can't understand customization even wit

Re: "specialdict" module

2005-04-05 Thread Georg Brandl
Georg Brandl wrote: > Hello, > > in follow-up to the recent "dictionary accumulator" thread, I wrote a > little module with several subclassed dicts. > > Comments (e.g. makes it sense to use super), corrections, etc.? Is this > PEP material? > > Docstrings

[RELEASED] Python 3.3.3 release candidate 2

2013-11-11 Thread Georg Brandl
gs to http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.3's contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.22 (GNU/Linux) iEYEARECAAYFAlKB1G4ACgkQN9GcIYhpnLAu5gCfRkfpnEs+rmtZ9i

Re: Self-defence

2013-11-17 Thread Georg Brandl
Am 17.11.2013 18:33, schrieb Mark Lawrence: >> This is a last-ditch request, and not one I particularly expect to >> succeed, but I honestly can't stand to watch this happen to python-list >> for very much longer, and am very close to unsubscribing after six years >> as an admittedly not very acti

[RELEASED] Python 3.3.3 final

2013-11-18 Thread Georg Brandl
visit: http://www.python.org/download/releases/3.3.3/ This is a production release, please report any bugs to http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.3's contributors) [1] http://bugs.

[RELEASED] Python 3.3.4 release candidate 1

2014-01-26 Thread Georg Brandl
http://www.python.org/download/releases/3.3.4/ This is a preview release, please report any bugs to http://bugs.python.org/ The final version is scheduled to be released in two weeks' time, on or about the 10th of February. Enjoy! - -- Georg Brandl, Release Manager georg at pyth

[RELEASED] Python 3.3.4

2014-02-10 Thread Georg Brandl
http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.3's contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.22 (GNU/Linux) iEYEARECAAYFAlL5PMwACgkQN9GcIYhpnLCv4wCePNVqwsOYCHdJBi

[RELEASED] Python 3.3.5 release candidate 1

2014-02-23 Thread Georg Brandl
nload Python 3.3.5 visit: http://www.python.org/download/releases/3.3.5/ This is a preview release, please report any bugs to http://bugs.python.org/ The final release is scheduled one week from now. Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire p

[RELEASED] Python 3.3.5 release candidate 2

2014-03-03 Thread Georg Brandl
nload Python 3.3.5 visit: http://www.python.org/download/releases/3.3.5/ This is a preview release, please report any bugs to http://bugs.python.org/ The final release is scheduled one week from now. Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire p

[RELEASED] Python 3.3.5

2014-03-09 Thread Georg Brandl
3.3.5 visit: http://www.python.org/downloads/release/python-335/ This is a production release, please report any bugs to http://bugs.python.org/ The final release is scheduled one week from now. Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire p

[RELEASED] Python 3.3.3 release candidate 1

2013-10-27 Thread Georg Brandl
to be released in two weeks' time, on or about the 10th of November. Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.3's contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v2.

Re: Problem installing matplotlib 1.3.1 with Python 2.7.6 and 3.3.3 (release candidate 1)

2013-11-03 Thread Georg Brandl
Am 04.11.2013 01:59, schrieb Ned Deily: > In article <21110.62791.44734.656...@cochabamba.vanoostrum.org>, > Piet van Oostrum wrote: >> I tried to install matplotlib 1.3.1 on the release candidates of Python >> 2.7.6 >> and 3.3.3. > > [...] > > Please open an issue on the Python bug tracker f

[RELEASED] Python 3.2.6rc1, Python 3.3.6rc1

2014-10-04 Thread Georg Brandl
https://www.python.org/downloads/release/python-336rc1/ These are pre-releases, please report any bugs to http://bugs.python.org/ The final releases are scheduled one week from now. Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and contrib

[RELEASED] Python 3.2.6, Python 3.3.6

2014-10-12 Thread Georg Brandl
These are production versions, please report any bugs to http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v2 iEYEARECAAYF

[RELEASED] Python 3.2.4 rc 1 and Python 3.3.1 rc 1

2013-03-25 Thread Georg Brandl
notice to: http://bugs.python.org/ To download Python 3.2.4 or Python 3.3.1, visit: http://www.python.org/download/releases/3.2.4/ or http://www.python.org/download/releases/3.3.1/ respectively. Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire

[RELEASED] Python 3.2.4 and Python 3.3.1

2013-04-06 Thread Georg Brandl
://www.python.org/download/releases/3.3.1/ respectively. As always, please report bugs to http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and all contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.19 (GNU

Re: [RELEASED] Python 3.2.4 and Python 3.3.1

2013-04-06 Thread Georg Brandl
Am 06.04.2013 22:48, schrieb cmcp: > On Saturday, 6 April 2013 21:43:11 UTC+1, Georg Brandl wrote: >> -BEGIN PGP SIGNED MESSAGE- >> >> Hash: SHA1 >> >> >> >> On behalf of the Python development team, I am pleased to announce the &g

Re: Restricted Access

2006-07-11 Thread Georg Brandl
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > iapain <[EMAIL PROTECTED]> wrote: > . > . > . >>Does that mean there is no way to implement restricted enviorment? > . > . >

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Georg Brandl
Carl J. Van Arsdall wrote: > Hrmms, well, here's an interesting situation. So say we wanna catch > most exceptions but we don't necessarily know what they are going to > be. For example, I have a framework that executes modules (python > functions), the framework wraps each function execution

Re: inheritance, types, operator overload, head ache

2006-07-11 Thread Georg Brandl
[EMAIL PROTECTED] wrote: >> > > Can some one *please* splain me why str(obj) works but not print obj, >> > >> > May have something to do with escape chars... I tried with: >> >def __str__(self): >> > return repr(self) > > Yes, that appears to be correct. Experiments indicated that it's a

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Georg Brandl
Ant wrote: >> Is there a way in python to say, "hey, catch everything but these two"? > try: > ... raise AttributeError > ... except Exception, ex: > ... if isinstance(ex, AttributeError): > ... print "Won't catch it!" > ... raise ex > ... > > Won't catch it! > Traceback (most re

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Georg Brandl
Ant wrote: >> > try: >> > # Do some stuff >> > except Exception, err: >> > if err not in (DontCatchMe1, DontCatchMe2): >> > # Handle err >> > >> > HTH, >> > ~Simon >> >> Dang! not only did somebody else beat me to it, but my code is wrong >> and theirs correct. > > Ignoring the fa

Re: timeit module for comparing the performance of two scripts

2006-07-12 Thread Georg Brandl
3c273 wrote: > "John Machin" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> You appear to know what a switch is. I'm therefore surprised that you >> appear not to >> know that the convention is that any program that uses >> command-line switches should do something informative whe

Re: Coding style

2006-07-19 Thread Georg Brandl
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Bob Greschke wrote: > >> I'd go even one step further. Turn it into English (or your favorite >> non-computer language): >> >> 1. While list, pop. >> >> 2. While the length of the list is greater than 0, pop. >> >> Which one makes mo

Re: Coding style

2006-07-19 Thread Georg Brandl
Antoon Pardon wrote: >> Other than in PHP, Python has clear rules when an object of a builtin type >> is considered false (i.e. when it's empty). So why not take advantage of >> this? > > Because it doesn't always do what I want. > > I once had a producer consumer code. When the client asked whe

Re: How to recognise "generator functions" ?

2006-07-19 Thread Georg Brandl
imho wrote: > Hi all. > > Is there a way to know if a function object is actually a "generator > function" or not ? e.g.: > > def f(): > pass > > def g(): > yield None > > f.__class__ is the same as g.__class__ , i.e. "function" type. > But i "know" that the second, when invoked, r

Re: How can I optimise this? [intended in good humour]

2006-07-25 Thread Georg Brandl
John Machin wrote: > Markus wrote: >> You know you're guilty of early/over optimisation, when it's almost two >> in the morning and the file open in front of you reads as follows. >> >> The code you are about to read is real... >> Some of the variable names have been changed >> to protect the

Re: New release of Diet Python (0.2 Beta)!!!

2006-07-27 Thread Georg Brandl
The Eternal Squire wrote: > Diet Python is a flavor of Python with allegro, multiarray, umath, > calldll, npstruct and curses builtin, all else nonessential to language > > ripped out. Total size < 3MB, 1% of PSF Python. Diet Python helps keep > clients thin :) Erm... Which "PSF Python" are you

Re: New release of Diet Python (0.2 Beta)!!!

2006-07-27 Thread Georg Brandl
The Eternal Squire wrote: > A developer's installation of PSF, including Pywin, WxPython, Numpy, > Scipy I believe can run up to 300 MB, no? > > Otherwise, I'll put up a different percentage. Well, if you refer to a Python installation including all these packages (anyway, I don't think it would

Re: Ann: SE 2.2b

2006-08-06 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > Frederic> In the short period of time since I introduced SE. the > Frederic> feedback has been overwhelmingly postive. > > Ummm... what is it? The last SE I had was a Mac. It is supposed to be a Stream Editor (in the spirit of sed, I think). However, the PyPI

Re: Ann: SE 2.2b

2006-08-08 Thread Georg Brandl
Anthra Norell wrote: > If you go to http://www.python.org/pypi. you see it about in the middle of > the recently updated packages. It's blue, so you can > click it and you're there. > The update page shows only the twenty most recent updates. So they drop > out at the bottom rather fast. If

Re: singleton decorator

2006-08-08 Thread Georg Brandl
Andre Meyer wrote: > While looking for an elegant implementation of the singleton design > pattern I came across the decorator as described in PEP318 > . > Unfortunately, the following does not work, because decorators only work > on functions or methods

Re: do people really complain about significant whitespace?

2006-08-10 Thread Georg Brandl
Gerhard Fiedler wrote: > function() > loop1() > blah > blah > > loop2() > blah > > loop3() > blah > #end loop3() > >

Re: Optimization of __len__() in cgi.py

2006-08-16 Thread Georg Brandl
Bob Kline wrote: > I have a suggestion for speeding up the performance of code like this: > > fields = cgi.FieldStorage() > if fields: ... > > which, as it turns out, invokes FieldStorage.__len__(), which in turn > calls FieldStorage.keys(), which builds a list of keys by hand, taking > several m

Re: sum and strings

2006-08-18 Thread Georg Brandl
Paul Rubin wrote: > Sybren Stuvel <[EMAIL PROTECTED]> writes: >> Because of "there should only be one way to do it, and that way should >> be obvious". There are already the str.join and unicode.join methods, > > Those are obvious??? Why would you try to sum up strings? Besides, the ''.join idio

Re: Clean way to not get object back from instantiation attempt gone bad

2006-08-18 Thread Georg Brandl
tobiah wrote: > Suppose I do: > > > myfoo = Foo('grapes', 'oranges') > > And in the __init__() of Foo, there is > a real problem with the consumption of fruit. > Is there a clean way to ensure that myfoo > will be None after the call? Would the > __init__() just do del(self), or is there > a be

Re: sum and strings

2006-08-18 Thread Georg Brandl
Paddy wrote: > Sybren Stuvel wrote: >> Paddy enlightened us with: >> > Well, after all the above, there is a question: >> > >> > Why not make sum work for strings too? >> >> Because of "there should only be one way to do it, and that way should >> be obvious". There are already the str.join and u

Re: how do you get the name of a dictionary?

2006-08-18 Thread Georg Brandl
Andy Terrel wrote: > Why bang your head? Because there's no chance that the original request is sane. If you want your objects to know their name, give them a name as an attribute. > It was a stupid hack that has lots of problems, > but done in a way that is readable. Sure I could do something

Re: sum and strings

2006-08-18 Thread Georg Brandl
Paul Rubin wrote: > Georg Brandl <[EMAIL PROTECTED]> writes: >> Why would you try to sum up strings? Besides, the ''.join idiom is quite >> common in Python. > > Just because it's common doesn't mean it's obvious. In my opinion > it&#x

Re: sum and strings

2006-08-19 Thread Georg Brandl
Bill Pursell wrote: > Georg Brandl wrote: >> Paul Rubin wrote: >> > Sybren Stuvel <[EMAIL PROTECTED]> writes: >> >> Because of "there should only be one way to do it, and that way should >> >> be obvious". There are already the str.

Re: import

2006-08-20 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > bugnthecode 写道: > >> How are you trying to import it? Is it in the same directory as your >> other script? If not is your python path set correctly? >> >> When importing a module that you have written you exlude the .py >> extension. You should be using: >> import hello

Re: import

2006-08-20 Thread Georg Brandl
01 wrote: > Georg Brandl wrote: >> [EMAIL PROTECTED] wrote: >> > bugnthecode 写道: >> > >> >> How are you trying to import it? Is it in the same directory as your >> >> other script? If not is your python path set correctly? >> >> >

Re: Input from the same file as the script

2006-08-20 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > Can the input to the python script be given from the same file as the > script itself. e.g., when we execute a python script with the command > 'python > When I ran the below the python interpreter gave an error. *sigh* Why do you think that we could guess what error t

Re: sum and strings

2006-08-21 Thread Georg Brandl
Steven D'Aprano wrote: > On Fri, 18 Aug 2006 19:08:37 -0700, Paul Rubin wrote: > >> If the args are strings, the above is a quadratic time algorithm and >> it's better to throw an error than create such a trap for an unwary user. > > That's a nonsense argument. There is no shortage of slow algori

Re: Problem of function calls from map()

2006-08-22 Thread Georg Brandl
Paul McGuire wrote: > "Dasn" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> >> Hi, there. >> >> 'lines' is a large list of strings each of which is seperated by '\t' >> >>> lines = ['bla\tbla\tblah', 'bh\tb\tb', ... ] >> >> I wanna split each string into a list. For speed, using m

Re: CONSTRUCT - Module Attributes and Execution Environment

2006-08-22 Thread Georg Brandl
Larry Bates wrote: > lazaridis_com wrote: >> I would like to change the construct: >> >> if __name__ == '__main__': >> >> to something like: >> >> if exec.isMain(): >> >> My (OO thought) is to place a class in an separate code module and to >> instantiate an singleton instance which would keep

Re: how do you get the name of a dictionary?

2006-08-22 Thread Georg Brandl
jojoba wrote: > Hello again, > > Fredrick said: > >> Python's object model. an object has a value, a type, and an identity, >> but no name. > > I say: > > Thank you Fredrick for the reply! > However, although python's object model does not currently support what > i am asking for, how difficul

Re: how do you get the name of a dictionary?

2006-08-22 Thread Georg Brandl
Steven D'Aprano wrote: > On Tue, 22 Aug 2006 10:12:00 -0700, BartlebyScrivener wrote: > how difficult would it be to assign a string name(s) to an object upon creation (and upon referencing)? >> >> Exactly the point that's being made. It's so easy just do it yourself: >> >> banana={"na

Re: how do you get the name of a dictionary?

2006-08-23 Thread Georg Brandl
jojoba wrote: >> And what im saying is that isnt it silly that we need pass an entire >> namespace, when a much simpler notion would be to have each object know >> its own name(s) (even if that name doesnt exist). > > > please note: in my above comment, i was completely disregarding any > notion

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Aug 23)

2006-08-23 Thread Georg Brandl
Jack Diederich wrote: > QOTW: "Because there's no chance that the original request is sane." - Georg > Brandl (responding to a question involving a Banana) Looks like I'm trying to fulfil my bot duties from time to time ;) > "this is one of your last chances

Re: What value should be passed to make a function use the default argument value?

2006-10-04 Thread Georg Brandl
Paul Rubin wrote: > Antoon Pardon <[EMAIL PROTECTED]> writes: >> repeat(object[, times]) >> Make an iterator that returns object over and over again. Runs >> indefinitely unless the times argument is specified. ... >> >> My first impression from this, is that it is possible to call >> this

Re: Python to use a non open source bug tracker?

2006-10-05 Thread Georg Brandl
Ilias Lazaridis wrote: > Giovanni Bajo wrote: >> Hello, >> >> I just read this mail by Brett Cannon: >> http://mail.python.org/pipermail/python-dev/2006-October/069139.html >> where the "PSF infrastracture committee", after weeks of evaluation, >> recommends >> using a non open source tracker (cal

Re: Python to use a non open source bug tracker?

2006-10-05 Thread Georg Brandl
Fredrik Lundh wrote: > Georg Brandl wrote: > >>> The python foundation suggests a non-python non-open-source bugtracking >>> tool for python. >> >> Actually, it suggests two bugtracking tools, one of them written in >> Python. > > the announcema

Re: Metaprogramming question

2006-10-06 Thread Georg Brandl
Steve Menard wrote: > I have a need to create class instance without invokking the class' __init__ > method. > > Were I using old-style classes, I'd use new.instance() function. However, I > am using new-style classes and new.instance() complain "TypeError: > instance() argument 1 must be clas

Re: Automatic import PEP

2006-10-06 Thread Georg Brandl
Dan Bishop wrote: > On Sep 22, 10:09 pm, Connelly Barnes <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I wrote the 'autoimp' module [1], which allows you to import lazy modules: >> >> from autoimp import * (Import lazy wrapper objects around all modules; >> "lazy >>module

Re: operator overloading + - / * = etc...

2006-10-07 Thread Georg Brandl
Tim Chase wrote: >>> Can these operators be overloaded? >> >> Yes. > > With the caveat of the "=" mentioned in the subject-line (being > different from "==")...I haven't found any way to override > assignment in the general case. There might be some oddball way > to do it via property() but A

Re: Python to use a non open source bug tracker?

2006-10-09 Thread Georg Brandl
Magnus Lycka wrote: > Fredrik Lundh wrote: >> you're not on the infrastructure list, I hear. > > I tried to figure out where that list is, so I could have > a look at the archives, but I didn't find it in the (for > me) obvious places. Could someone please provide a link > to the archives for th

Re: file system iteration

2006-10-09 Thread Georg Brandl
rick wrote: > In Unix, the file system hierarchy is like a tree that has a base or > 'root' that exposes objects (files and folders) that can easily be > iterated over. > > > \ \ | / / > \ \ | / / >\ \|/ / > \ | / > \|/ > | > | > Root > > So, when I do os.chdi

Re: file system iteration

2006-10-09 Thread Georg Brandl
rick wrote: > Georg Brandl wrote: > >> Which application needs to walk over ALL files? Normally, you just have a >> starting path and walk over everything under it. > > Searching for a file by name. Scanning for viruses. Etc. There are lots > of legitimate reas

Re: file system iteration

2006-10-09 Thread Georg Brandl
Jonathan Hartley wrote: > Georg Brandl wrote: > >> Which application needs to walk over ALL files? > > How about 'updatedb' for starters, the index-maintainer for the common > *nix command-line utility 'locate'. > > I'm pretty sure that os.w

Re: operator overloading + - / * = etc...

2006-10-09 Thread Georg Brandl
Bruno Desthuilliers wrote: > Steven D'Aprano wrote: >> On Sat, 07 Oct 2006 17:21:55 -0500, Tim Chase wrote: >> > With the caveat of the "=" mentioned in the subject-line (being > different from "==")...I haven't found any way to override > assignment in the general case. Why would

Re: OT: Sarcasm and irony

2006-10-10 Thread Georg Brandl
Steve Holden wrote: >> is that 'in America' meant to be an addendum to what I said, as in >> this is the situation in America and not elsewhere? If so I should >> probably point out that I am writing from Denmark and was thinking >> specifically of a situation where a dane told me they were be

Re: Python component model

2006-10-10 Thread Georg Brandl
Bruno Desthuilliers wrote: > Marc 'BlackJack' Rintsch wrote: > (snip) > Python itself is a RAD tool. > > +1 QOTW > Agreed. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: default variable in python $_

2006-10-10 Thread Georg Brandl
rh0dium wrote: > Hi all, > > So I have this simple little routine.. say like this.. > > > def foo() >return {"a":"b", "b":"c"} > > if foo(): >print "Have foo" > > > Now I want the dictionary item a (ie. b) > > How can I do it the above way or do I still have to go like this.. > > d

  1   2   3   4   >