Re: File object question

2005-12-23 Thread Ben Hutchings
n some encoding. (By contrast, objects of type unicode definitely do represent text in some Unicode encoding.) > I thought it was good only for variables, lists, etc. Variables? Do you mean tuples? len() works with any kind of sequence, and strings behave as a sequence of 1-byte strings. -- Ben Hutchings It is easier to write an incorrect program than to understand a correct one. -- http://mail.python.org/mailman/listinfo/python-list

Re: Find out the schema with psycopg?

2005-12-23 Thread Ben Hutchings
; are running PostgreSQL 7.4 or higher. Under those circumstances you can > query the metadata through the information schema. It's not *that* non-portable - information_schema is a standard part of ANSI SQL and is supported by several RDBMSes. -- Ben Hutchings It is easier to write an incorrect program than to understand a correct one. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to lock a file in ftp site

2005-12-20 Thread Ben Hutchings
onflicting changes and stop you from overwriting other people's changes. -- Ben Hutchings Every program is either trivial or else contains at least one bug -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding methods to instances

2005-12-16 Thread Ben Hutchings
; But this will make the function a method to all instances of the class. > Is that what you want? From your first post I had the impression you > only wanted the function to be the method of one particular instance. How about: def bind(fun, arg): return lambda *a, **k: fun(arg, *a, **k) t.dynamic = bind(dynamic, t) -- Ben Hutchings The world is coming to an end. Please log off. -- http://mail.python.org/mailman/listinfo/python-list

Re: how does exception mechanism work?

2005-12-12 Thread Ben Hutchings
g exception handler records on the stack was used because it was relatively obvious and initially not too expensive (since few exception handlers were used). FWIW, most C++ implementations now use range tables, as you described. So do the Win64 ABIs and the Unix/Linux IA64 ABI. -- Ben Hutchings Klip