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

2006-10-09 Thread Georg Brandl
more roundup volunteers, > > but it's not like nobody's prepared to contribute manhours. > > don't underestimate the community. > > So, how many have offered to help? Is this information > available in some public repository? Not yet, as it seems. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: file system iteration

2006-10-09 Thread Georg Brandl
ints, perhaps not even representing real files like the /proc filesystem. All that needs caution when iterating over "all files". Georg -- http://mail.python.org/mailman/listinfo/python-list

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
to set a variable. >> > (snip) > >> Suppose we bind the name "x" to the object 1, and then rebind the name "x" >> to the object []. Which object's hypothetical __assign__ method should get >> called? > > The current namespace object, of course. Which is? Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Sarcasm and irony

2006-10-10 Thread Georg Brandl
adation of the (understanding of the) meaning of irony. > People are just too damned sloppy with language nowadays. Let me tell you: There are times when I'm really glad that as a German, I'm not supposed to possess any sense of humour at all. warning-this-post-may-be-ironic-ly yours, Georg -- http://mail.python.org/mailman/listinfo/python-list

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
the new language is. In the case of Python, one credo is "explicit is better than implicit". IMO, this precludes, among other things, the notion of a "default variable". Where is the problem with your second snippet? Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN compiler2 : Produce bytecode from Python 2.5 Abstract Syntax Trees

2006-10-22 Thread Georg Brandl
roved stdlib compiler package? In the latter case, maybe you can contribute some patches to the core. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: pylint: What's wrong with the builtin map()

2006-10-22 Thread Georg Brandl
= """ > No config file found, using default configuration > * Module test_mod > W: 6: Used builtin function 'map' > E: 6: Using variable 'x' before assigment Some people think that all occurences of map() must be replaced by list comprehensions. The designer of pylint seems to be one of those. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: pylint: What's wrong with the builtin map()

2006-10-22 Thread Georg Brandl
Tuomas wrote: > Georg Brandl wrote: >> Some people think that all occurences of map() must be replaced >> by list comprehensions. The designer of pylint seems to be >> one of those. > > So it seems, but why? See Fredrik's post. There's no error in the

Re: ANN compiler2 : Produce bytecode from Python 2.5 Abstract Syntax Trees

2006-10-23 Thread Georg Brandl
Michael Spencer wrote: > Georg Brandl wrote: >> Michael Spencer wrote: >>> Announcing: compiler2 >>> - >>> >>> For all you bytecode enthusiasts: 'compiler2' is an alternative to the >>> standard >>&

Re: question about True values

2006-10-28 Thread Georg Brandl
J. Clifford Dyer wrote: > >>> (1 > 0) < 1 > False > >>> 1 > 0 < 1 > True > >>> 1 > (0 < 1) > False > >>> 10 > (0 < 1) > True I hope you know why this works the way it does. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Import if condition is correct

2006-10-28 Thread Georg Brandl
MindClass wrote: > Is possible import a library according to a condition? > > if Foo = True: > import bar > Why don't you try it? (in the above code, not the import is the problem, but using the assignment operator in an expression) Georg -- http://mail.python.org/mai

Re: what is "@param" in docstrings?

2006-10-28 Thread Georg Brandl
to be > machine readable. Alas, googling on "@param" doesn't work... It looks > at first like a decorator, but that doesn't make much sense. It's docstring markup that can be parsed by e.g. epydoc. It's borrowed from JavaDoc's similar syntax. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: question about True values

2006-10-28 Thread Georg Brandl
J. Clifford Dyer wrote: > Georg Brandl wrote: >> J. Clifford Dyer wrote: >> >>> >>> (1 > 0) < 1 >>> False >>> >>> 1 > 0 < 1 >>> True >>> >>> 1 > (0 < 1) >>> False >>> >

Re: question about True values

2006-10-28 Thread Georg Brandl
y have misunderstood the semantics of the "and" and "or" operators. >>>> None >>>> None and True >>>> None or True > True >>>> None and False >>>> None or False > False >>>> False or None >>>> False and None > False >>>> True and None >>>> True or None > True >>>> not None > True x and y | x something | x nothing --- y something | y | x y nothing | y | x x or y | x something | x nothing --- y something | x | y y nothing | x | y Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: question about True values

2006-10-29 Thread Georg Brandl
"somethingness") evaluation, as you can see from this example: Python 2.5 (r25:51908, Sep 22 2006, 10:45:03) >>> class A: ... def __nonzero__(self): ... print "nonzero" ... return True ... >>> A() and 1 nonzero 1 >>> Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Metaclasses are not called in subclasses. What did I wrong?

2006-10-29 Thread Georg Brandl
the metaclass, but the class of the first base class is. This is an inconsistency IMHO, since Python normally respects inherited attributes just like those defined in the class itself. But well, you can live with it :) Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: enumerate improvement proposal

2006-10-29 Thread Georg Brandl
se use (or is it use case?): Incidentally, I yesterday wrote a patch giving enumerate() a start parameter (and, more importantly, changing it so that it doesn't wraparound at sys.maxint). It can be found here: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1586315&group_id=5470 Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Distilled

2006-11-06 Thread Georg Brandl
ng, since in Python 2.5 all exceptions are new-style, but new exception classes must be derived from an existing one. Classic classes, their instances and strings are only allowed for backwards compatibility. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Distilled

2006-11-06 Thread Georg Brandl
://docs.python.org/whatsnew/pep-352.html). Yes, they were. Still, you can't raise instance of arbitrary new-style classes as exceptions, and you will never be able to. In Py3k, only instances of "BaseException" subclasses will be raisable. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode/ascii encoding nightmare

2006-11-06 Thread Georg Brandl
;codec can't decode byte" and > UnicodeDecodeError etc. produces a bunch of hits so it's obvious I'm > not alone. Unicode causes many problems if not used properly. If you want to use Unicode strings, use them everywhere in your Python application, decode input as early as possible, and encode output only before writing it to a file or another program. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a commas-in-between idiom?

2006-11-08 Thread Georg Brandl
objecting to the fact that both names point to the same object? It couldn't be otherwise. Consider: X = [] A = B = X What should this do? Copy "X" and assign one copy to A, one to B? Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple question to split

2006-11-09 Thread Georg Brandl
t;> single split-call? >> >> Nope. But you could replace the commas with spaces, and then split. > > Or use re.split And not forget to map it through int() afterwards. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Georg Brandl
ays that the colon increases >> readability, but I'm skeptical. The indentation seems to provide more >> than enough of a visual clue as to where the if conditional ends. > > I'm not sure why '\'s are required to do multi-line before the colon. Special cases aren't special enough to break the rules. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Georg Brandl
Ron Adam wrote: > Georg Brandl wrote: >> Ron Adam wrote: >>> Michael Hobbs wrote: >>> >>>> The same problem that is solved by not having to type parens around the >>>> 'if' conditional, a la C and its derivatives. That is, it's un

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Georg Brandl
the way > __nonzero__ is defined to use __len__, or __contains__ to use __iter__. What has a better chance of success in my eyes is an extension to yield all items from an iterable without using an explicit for loop: instead of for item in iterable: yield item you could write yield from iterable or yield *iterable etc. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Georg Brandl
Carl Banks wrote: > Georg Brandl wrote: >> What has a better chance of success in my eyes is an extension to yield >> all items from an iterable without using an explicit for loop: instead of >> >> for item in iterable: >> yield item >> >> you c

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Georg Brandl
Michael Hobbs wrote: > Georg Brandl wrote: >> Ron Adam wrote: >> >>> Michael Hobbs wrote: >>> >>> >>>> The same problem that is solved by not having to type parens around the >>>> 'if' conditional, a la C and

Re: atexit.register does not return the registered function. IMHO, it should.

2006-11-16 Thread Georg Brandl
ead before the bug report, which is why I already handled this one ;) cheers, Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: is it possible to find which process dumped core

2006-06-05 Thread Georg Brandl
; that /usr/bin/python (or some other interpreter executable) dumped core. > > You'd have to poke around inside the core image to find out which file > was being executed when the interpreter failed. I think he didn't want to analyze a Python core dump. su: look into

Re: Question about the Exception class

2006-06-14 Thread Georg Brandl
exception raised by Python itself occurs. Also, you can customize your own exception objects (such as, add new instance attributes). Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: nested functions

2006-06-14 Thread Georg Brandl
function is redefined every time the outer is called. That's right. However, if the outer function is only called a few times and the nested function is called a lot, the locals lookup for the function name is theoretically faster than the globals lookup. Also, in methods you can use closures, so you don't have to pass, for example, self to the inner function. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: struct.unpack on 64-bit platforms

2006-06-22 Thread Georg Brandl
integer (since > that's what the C Type unsigned long means on 64-bit platforms). > > So what's the way to make it read exactly 32-bits, on all platforms? Looking into the docs, prepending your format string with "=" should make "L" exactly 32 bits on each platform. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Immutability

2006-06-28 Thread Georg Brandl
f, bar): > |> self._bar = bar > |> > |> @property > |> def bar(self): > |> return self._bar > > Thanks very much. And, what's more, I have even found its documentation! > Whatsnew2.2. The 2.4.2 reference is, er, unhelpful. Is it? http://docs.python.org/lib/built-in-funcs.html documents "property" quite well. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Immutability

2006-06-28 Thread Georg Brandl
I am sure). In my opinion property isn't really meant to be used as a decorator since it's impossible to create a read-write property. The decorator pattern doesn't really fit here. What I agree is that it's not really defined what a "property" object is and what its properties are. For that, documentation patches are welcome. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: how do i make an array global

2006-06-28 Thread Georg Brandl
> global count > for i in range(l): > count[i] = ... > No need for "global" here. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: how do i make an array global

2006-06-28 Thread Georg Brandl
worst possible thing. > There are very few chances you *need* a global here. Look at the use case first. For small scripts, sometimes re-assigning global names or mutating objects refered to by global names is essential. For large-scale packages, though, I agree with you that mutating globals is bad. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Immutability

2006-06-28 Thread Georg Brandl
Duncan Booth wrote: > Georg Brandl wrote: > >> In my opinion property isn't really meant to be used as a decorator since >> it's impossible to create a read-write property. The decorator pattern >> doesn't really fit here. >> > I agree that p

Re: Immutability

2006-06-28 Thread Georg Brandl
rmally, decorators wrap functions with other functions. property doesn't return a function but a descriptor object. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: how do i make an array global

2006-06-28 Thread Georg Brandl
Bruno Desthuilliers wrote: > Georg Brandl wrote: >> Bruno Desthuilliers wrote: >> >>>a wrote: >>> >>>>def fn(): >>>> for i in range(l) >>> >>>l is not defined - you should have an error here. >>> >>>

Re: Generator naming convention?

2006-06-29 Thread Georg Brandl
diately, I think it's more important to mention the generator-ness in the docstring. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Immutability

2006-06-29 Thread Georg Brandl
Steve Holden wrote: > Georg Brandl wrote: >> Nick Maclaren wrote: >> >>>In article <[EMAIL PROTECTED]>, >>>"Fredrik Lundh" <[EMAIL PROTECTED]> writes: >>>|> >>>|> identical? you only applied @property to one of the

Re: Bug reporting impossible

2006-06-29 Thread Georg Brandl
Nick Maclaren wrote: > Currently logins are disabled to sourceforge.net, and (despite the > comments) it won't let me report a bug anonymously. Does anyone > know whether this is short or long term? I have a bug in 2.5 to > report - which has been there for a while and isn't overwhelmingly > crit

Re: Immutability

2006-06-29 Thread Georg Brandl
Steve Holden wrote: > Georg Brandl wrote: >> Steve Holden wrote: > [...] >> >>>Would it make sense, in the single argument case, to default the doc >>>value to fget.__doc__ to support that use case, or should we just not >>>create read-onl

Re: Way for see if dict has a key

2006-06-30 Thread Georg Brandl
context: see if the key are into the dict... What other >>>context do you know? >>> >> >> Why do you want to do that ? >> >> if key in dict: >> value = dict[key] >> else: >> value = None >> >> could be write: > > value = dict.get(key, None) value = dict.get(key) ;) Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Way for see if dict has a key

2006-06-30 Thread Georg Brandl
d I would write that with explicit None too. Just wanted to continue the shortening ;) Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Immutability

2006-06-30 Thread Georg Brandl
Georg Brandl wrote: > Steve Holden wrote: >> Georg Brandl wrote: >>> Steve Holden wrote: >> [...] >>> >>>>Would it make sense, in the single argument case, to default the doc >>>>value to fget.__doc__ to support that use case, or sho

Re: Module executed twice when imported!

2006-06-30 Thread Georg Brandl
and when it does "import imptest" Python searches for the module "some1.imptest", not for "imptest", and finds it in the current directory (which it assumes to be the package directory). You can verify this by inspecting sys.modules after the execfile() call. So it's not a bug, but expected behavior. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Import bug: Module executed twice when imported!

2006-06-30 Thread Georg Brandl
ince the seemingly double imported module is not the one that's execfile'd. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Module executed twice when imported!

2006-07-01 Thread Georg Brandl
Michael Abbott wrote: > In article <[EMAIL PROTECTED]>, > Georg Brandl <[EMAIL PROTECTED]> wrote: >> That's because __name__ is normally set to the module's name in the package >> hierarchy. When you set it to "some1.some2", Python thinks it'

Re: sqlite3 in Python 2.5b1: my out-of-the-box experience

2006-07-04 Thread Georg Brandl
John Machin wrote: > Apologies in advance if this is a bit bloggy, but I'd like to get > comments on whether I've lost the plot (or, more likely, failed to > acquire it) before I start reporting bugs etc. Please forward to Gerhard Haering if you still think these are bu

Re: fonction in python

2006-07-04 Thread Georg Brandl
if function(x) != y: break else: print "function", function, "matches" Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Why can't I subclass off of "date" ?

2006-08-24 Thread Georg Brandl
3 arguments (4 given) > > > If I make A a subclass of some toy class that is constructed with three > arguments, it works fine. Why can't I make "date" the subclass? You'll have to also override the __new__ method. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: callable to disappear?

2006-08-25 Thread Georg Brandl
mpossible for Py3k to get an improved version of callable() including signature checking. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: List problem

2006-08-25 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > For example i write the following code in the Python command line; > >>>>list = ['One,Two,Three,Four'] > > Then enter this command, which will then return the following; > > ['One,Two,Three,Four'] This is already

Re: Taking data from a text file to parse html page

2006-08-26 Thread Georg Brandl
serves case and in the zip file > the names are upper case. I am baffled. But I believe that an import tripping > up on the wrong case can't be a hard nut to crack. The problem is the extension: SE.py is acceptable, while SE.PY is not. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Weekly Python Patch/Bug Summary

2006-08-27 Thread Georg Brandl
32 open ( +3) / 236 closed ( +1) / 468 total ( +4) > > could this script perhaps be modified to filter out Python 3000 stuff, > at least for the edition sent to python-dev ? Good idea, but I'd wait until we have the new tracker running. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: callable to disappear?

2006-08-28 Thread Georg Brandl
Bruno Desthuilliers wrote: > Georg Brandl a écrit : >> Antoon Pardon wrote: >> >>> I have been reading http://www.python.org/dev/peps/pep-3100/ >>> en there is written: >>> >>> To be removed: >>> ... >>&

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

2006-08-28 Thread Georg Brandl
Antoon Pardon wrote: > On 2006-08-23, Georg Brandl <[EMAIL PROTECTED]> wrote: >> 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 >>>&

Re: Misleading error message when opening a file (on Windows XP SP 2)

2006-08-28 Thread Georg Brandl
ry files on Windows and the text files are e.g. opened being > buffered using a 32-bit buffer pointer, this fails on too large NTFS files. > > I could also imagine that Python tries to buffer the text file and fails > because it uses the wrong pointer size when asking Windows for the > content. I have not yet looked into the C-code of Python - any hint > which file I should take a closer look at? That would be Objects/fileobject.c. And no, on just open()ing the file, Python does nothing more than fopen() (or some Windows equivalent). Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you want in a new web framework?

2006-08-30 Thread Georg Brandl
any of them is that all of them > suck badly? The reason is that writing one is fun in Python. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: refering to base classes

2006-08-30 Thread Georg Brandl
ings. If you > use module.classname() you invoke the __new__ and __init__ methods in > the class, and you might get an error from them. > > On the other hand module.classname will always work, assuming classname > really exists in module. What you get back is a sort of referen

Re: dictionary with object's method as thier items

2006-08-30 Thread Georg Brandl
n(self, arg): ... print arg ... >>> obj = C() >>> d = C.__dict__ >>> d['function'](obj, 42) 42 >>> Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-31 Thread Georg Brandl
alf wrote: > Robert Kern wrote: >> alf wrote: >> >>> Fredrik Lundh wrote: >>> >>>> http://www.catb.org/~esr/faqs/smart-questions.html#writewell >>>> >>>> >>> >>> >>> and means? >> >>

Re: Assignment-in-conditional

2006-08-31 Thread Georg Brandl
t accidentally using '=' instead of > '=='. One possible solution is to do what the 'with' statement does: > > if pat.match(s) as m: >... > > a little ugly but not too much worse that with itself.. > > what do you guys think? It has

Re: Classes referencing each other

2006-09-01 Thread Georg Brandl
;s just incredibly ugly if I have to look for > the attribute definitions in more than one place. You could move all connections to a central location after the class definitions, such as class A: pass class B: pass class C: pass connections = {A: (B, C), B: (C,), C: (A,)} Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: IndentationError: expected an indented block

2006-09-02 Thread Georg Brandl
; Haha. I know. I just find it silly that a language insists on > indentation. I'd long known it but just was reminded of it when I > messed a little with the interpreter. Let me tell you that we've had far better trolls. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT -

2006-09-03 Thread Georg Brandl
d be selected based on the meaning of the > __double-underscore-enclosure__ of the entities. > > - > > What I would need to know is: > > a) what would be the correct term for "identifier"? import sys class _identifier: def __getattr__(self, name):

Re: CONSTRUCT -

2006-09-04 Thread Georg Brandl
lazaridis_com wrote: > Georg Brandl wrote: >> lazaridis_com wrote: >> > I would like to fulfill the following task: >> > >> > The construct: >> > >> > if __name__ == '__main__': >> > >> > should be changed

Access elements from nested tuples

2006-09-04 Thread Georg Sauthoff
Hi, t = (1, (2, 3)) I am bit suprised, that I cannot access '3' via: t[1].[1] # syntax error But t[1].__getitem__(1) works like expected. Why is that? Regards Georg Sauthoff -- http://mail.python.org/mailman/listinfo/python-list

Re: Access elements from nested tuples

2006-09-05 Thread Georg Sauthoff
On 2006-09-04, Tim Chase <[EMAIL PROTECTED]> wrote: Hi, [nested tuples] thanks - I should not post before 8 am or 10 pm ... Regards Georg Sauthoff -- http://mail.python.org/mailman/listinfo/python-list

Re: No ValueError for large exponents?

2006-09-07 Thread Georg Brandl
ll > raise a ValueError. What message does that value error have? If it's a memory issue, the operation should raise MemoryError (at least in CPython). Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT -

2006-09-07 Thread Georg Brandl
Steve Holden wrote: >> I am not a (python) domain expert. >> >> Thus I am asking here for available standard-solutions, before I >> implement an own solution. >> > There is no standard solution for the problem you mention. Because it's not a prob

Re: the first arg to super() must be a type, not a class obj?

2006-09-08 Thread Georg Brandl
ould make "ftputilx" new-style by inheriting from object and FTPHost, but FTPHost is still old-style, and I don't know if that's okay with super. So in your case it would be advisable to use FTPHost.__init__(self) instead of super(ftputilx, self).__init__() Georg -- http://mail.python.org/mailman/listinfo/python-list

ANN: Pocoo (bulletin board software) 0.1 beta released

2006-09-10 Thread Georg Brandl
Download the release at <http://www.pocoo.org/download>. Cheers, Georg Brandl, on behalf of the Pocoo Team -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a varargs tuple to a list - a definite pitfall for new comers to Python

2006-09-14 Thread Georg Brandl
return output.splitlines() > > def list(): ^^^ This is called by list(args) above, and the call fails. If you want to avoid such clashes, don't name your functions list, dict, int, str etc. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.5 (release candidate 2)

2006-09-14 Thread Georg Brandl
itle of > http://docs.python.org/dev/lib/module-elementtree.html (8.13 > elementtree -- The xml.etree.ElementTree Module). Please open a bug in the tracker at http://www.sf.net/projects/python. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.5 (release candidate 2)

2006-09-14 Thread Georg Brandl
Georg Brandl wrote: > Ant wrote: >> Anthony Baxter wrote: >> ... >>> code in 2.5 before the final release. *Please* try this >>> release out and let us know about any problems you find. >> >> Not a problem with the release, but with the docs. I

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-17 Thread Georg Brandl
set __metaclass__ = whatever at the top of each module whose classes are to get the new behavior. You can't alter classes which you don't control or create in your code. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-18 Thread Georg Brandl
yle classes, inheriting from object or another new-style class, works because if no __metaclass__ is defined, the first base class's class is taken as the metaclass. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Georg Brandl
x27;OldStyle', (), {'__module__': '__main__'}) > deets$ > > I was astonished to see that. Any explanation? Yes. I was wrong, the order of lookup is reversed. This first base class's class is used before the global __metaclass__. So what Damjan said is correct: global __metaclass__ is only usable for classes that don't have bases. Whether this is desirable is another question... Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: webbrowser module's Firefox support

2006-09-24 Thread Georg Brandl
gt; > Looking in the docs on subprocess.Popopen > (http://docs.python.org/lib/node529.html), it says "If close_fds is > true, all file descriptors except 0, 1 and 2 will be closed before the > child process is executed. (Unix only)". I have to be frank; I have no > idea what this means. What should I do to fix this? This is a bug, and has now been fixed in SVN. As a workaround, you can edit the webbrowser.py file and remove the close_fds and preexec_fn arguments to Popen. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-24 Thread Georg Brandl
character (""") is also translated; this helps for inclusion in an HTML attribute value, as in . If the value to be quoted might include single- or double-quote characters, or both, consider using the quoteattr() function in the xml.sax.saxutils module instead. Now, do you still think cgi.escape is broken? Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: assignment hook

2006-09-24 Thread Georg Brandl
loadable via __setattr__ and __setitem__. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange __future__ behavior in Python 2.5

2006-09-24 Thread Georg Brandl
or am I misunderstanding something? I'm using the final > release of Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) on Mac OS X. This is a bug and has now been fixed in the SVN repo. Thanks for bringing it up. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: +1 QOTW

2006-09-24 Thread Georg Brandl
; There is also this: >> 'But I think the basic Perl paradigm is "Whatever-oriented programming."' > > But what this really means, in practise, is "dis-oriented programming." I think now we got our QOTW. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Reverse a String?

2006-09-25 Thread Georg Brandl
id, hasn't it worked well in the past to use no spam filter, if you have to be registered to post comments? Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-25 Thread Georg Brandl
precisely, would it break > "existing code"? Can you come up with an example, or even an > explanation of how it *could* break existing code? Is that so hard to see? If cgi.escape replaced "'" with an entity reference, code that expects it not to do so would break. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Verify an e-mail-adress - syntax and dns

2006-09-25 Thread Georg Brandl
users that misspel their e-mail address more frequently, just like passwords. And therefore it's a nice touch to spare both the original submitter and the owner of the misspelled address more work. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-25 Thread Georg Brandl
y clear without the need to reproduce the exact replacements for each character. If anyone doesn't know what is meant by this, he shouldn't really write apps using the cgi module before doing a basic HTML course. Or use the source. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Verify an e-mail-adress - syntax and dns

2006-09-25 Thread Georg Brandl
Christophe wrote: > Georg Brandl a écrit : >> Christophe wrote: >>> Steven D'Aprano a écrit : >>>> By memory, in an thread about the same topic just a few days ago, >>>> Fredrik >>>> Lundh posted a link to Perl's FAQs that suggest

Re: ruby %w equivalent

2006-09-25 Thread Georg Brandl
>> >>| >>> "a b c".split() >>| ['a', 'b', 'c'] >> >>... appears to match your single example. > > Something wrong with "list('abc')"? Or is it too simple?! It is quite unreliable for strings consisting of more than one char... ;) Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing a percent sign

2006-09-25 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > Hi all. How do I escape the "%" sign in a print statement so that it > prints? Thanks. >>> print "%" % Did you mean in a string being interpolated with the % operator? Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-26 Thread Georg Brandl
ey thought it was. Why should they be surprised? The documentation states clearly what cgi.escape() does (as does the docstring). Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-26 Thread Georg Brandl
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Fredrik > Lundh wrote: > >> Lawrence D'Oliveiro wrote: >> >>>> Georg Brandl wrote: >>>> >>>>> A function is broken if its implementation doesn't matc

Re: A critique of cgi.escape

2006-09-26 Thread Georg Brandl
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Georg Brandl wrote: > >> Lawrence D'Oliveiro wrote: >>> In message <[EMAIL PROTECTED]>, Max M wrote: >>> >>>> Lawrence is right that the escape method doesn't work

Re: A critique of cgi.escape

2006-09-26 Thread Georg Brandl
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Georg Brandl wrote: > >> Lawrence D'Oliveiro wrote: >>> In message <[EMAIL PROTECTED]>, Georg Brandl wrote: >>> >>>> Lawrence D'Oliveiro wrote: >>>>>

Re: where are isinstance types documented?

2006-09-26 Thread Georg Brandl
>>> tuple >>> list >> >> And set, presumably. > > absolutely! > > however, sets don't seem to be mentioned on that page at all (and if > they were, they should be under mappings, right?). any documentation > hackers out there ? File

<    1   2   3   4   5   >