Python Mastery Bootcamp - April 12-16, 2010 - Final Weeks to Register

2010-03-25 Thread David Beazley
* * * Final Weeks to Register * * * Python Mastery Bootcamp with David Beazley, author Python Essential Reference April 12-16, 2010 Big Nerd Ranch Atlanta, Georgia

pyexiv2 0.2.0 released

2010-03-25 Thread Olivier Tilloy
Hello Python users and developers, I'm happy to announce that pyexiv2 0.2.0 [1], codename Commuting, was released today, after almost two years of quite irregular development. pyexiv2 is a python binding to exiv2 [2], the C++ library for manipulation of EXIF, IPTC and XMP image metadata. It

Re: sum for sequences?

2010-03-25 Thread TomF
On 2010-03-24 14:07:24 -0700, Steven D'Aprano ste...@remove.this.cybersource.com.au said: On Wed, 24 Mar 2010 15:29:07 +, kj wrote: Is there a sequence-oriented equivalent to the sum built-in? E.g.: seq_sum(((1, 2), (5, 6))) -- (1, 2) + (5, 6) -- (1, 2, 5, 6) ? Yes, sum. help(sum) is

Re: C-API: Extract information from function object

2010-03-25 Thread Stefan Behnel
Gabriel Genellina, 24.03.2010 17:49: En Wed, 24 Mar 2010 12:09:27 -0300, moerchendiser2k3 escribió: I have a reference to a function and would like to know how to extract information from a function object. Information I am looking for: line and file where this function is from.

Re: sum for sequences?

2010-03-25 Thread Steven D'Aprano
On Wed, 24 Mar 2010 23:50:23 -0700, TomF wrote: On 2010-03-24 14:07:24 -0700, Steven D'Aprano ste...@remove.this.cybersource.com.au said: On Wed, 24 Mar 2010 15:29:07 +, kj wrote: Is there a sequence-oriented equivalent to the sum built-in? E.g.: seq_sum(((1, 2), (5, 6))) -- (1, 2)

Saving a page loaded using the webbrowser library?

2010-03-25 Thread Dr. Benjamin David Clarke
Does anyone know of a way to save the a loaded web page to file after opening it with a webbrowser.open() call? Specifically, what I want to do is get the raw HTML from a web page. This web page uses Javascript. I need the resulting HTML after the Javascript has been run. I've seen a lot about

Re: Is there any library for indexing binary data?

2010-03-25 Thread Irmen de Jong
On 3/25/10 4:28 AM, 甜瓜 wrote: Howdy, Recently, I am finding a good library for build index on binary data. Xapian Lucene for python binding focus on text digestion rather than binary data. Could anyone give me some recommendation? Is there any library for indexing binary data no matter whether

Re: Saving a page loaded using the webbrowser library?

2010-03-25 Thread Irmen de Jong
On 3/25/10 8:41 AM, Dr. Benjamin David Clarke wrote: Does anyone know of a way to save the a loaded web page to file after opening it with a webbrowser.open() call? Specifically, what I want to do is get the raw HTML from a web page. This web page uses Javascript. I need the resulting HTML

Re: Is there any library for indexing binary data?

2010-03-25 Thread Paul Rubin
甜瓜 littlesweetme...@gmail.com writes: Well, Database is not proper because 1. the table is very big (~10^9 rows) 2. we should support very fast *simple* query that is to get value corresponding to single key (~10^7 queries / second). Just one numeric key/value pair in each row? What's wrong

how to display variables down a stackdump when an exception occurred

2010-03-25 Thread News123
Hi, I captured a piece of code with a try except statement: In the except part I display a stackdump try: domyxmlrpcstuff() except Exception as e: import traceback ex_type,ex_value,e_b = sys.exc_info() tbstring = traceback.format_exc() print '%s%s:%s:%s' % \

xpat error in xmlrp client. How to inspect data.

2010-03-25 Thread News123
Hi, I'm havign a small xmlrpc client, which works normally fine. (xmlrpc via https) Sometimes however I receive an Exception about an expat error. The output, that I receive is: File C:\mycode\myrpcclient.py, line 63, in upload_chunk rslt = myrpcclient.call() File

Re: Is there any library for indexing binary data?

2010-03-25 Thread 甜瓜
Thank you Rubin! Let me have a look at Judy. It seems good at first glance. -- ShenLei 2010/3/25 Paul Rubin no.em...@nospam.invalid: 甜瓜 littlesweetme...@gmail.com writes: Well, Database is not proper because 1. the table is very big (~10^9 rows) 2. we should support very fast *simple* query

Re: Is it possible to use re2 from Python?

2010-03-25 Thread Tim Wintle
On Wed, 2010-03-24 at 10:44 -0700, _wolf wrote: yes we can! http://github.com/facebook/pyre2 I had made a thin wrapper experiment with here - looks like the version he's shipped is relatively complete and compatible with the re module though. I'll be interested in seeing how well it performs -

Re: Is there any library for indexing binary data?

2010-03-25 Thread 甜瓜
Thank you irmen. I will take a look at pytable. FYI, let me explain the case clearly. Originally, my big data table is simply array of Item: struct Item { long id;// used as key BYTE payload[LEN]; // corresponding value with fixed length }; All items are stored in one file by using

Re: threads (specifically timers) and releasing resources

2010-03-25 Thread Tim Golden
On 25/03/2010 02:31, Alex Hall wrote: Okay, I have my program and it has three different modes (there will be more than that). Each mode will have a timer attached to it. If the mode remains active and the timer runs out, a function specific to that mode is called. If that mode is switched away

from import and __init__.py

2010-03-25 Thread egbert
When I do 'from some_package import some_module' the __init__.py of some_package will be run. However, there will not be anything like a package-module, and the effects of __init__.py seem all to be lost. Is that true ? Or can I still do something useful with __init__.py ? e -- Egbert Bouwman

Re: the Python Foundation

2010-03-25 Thread Rami Chowdhury
On 2010-03-24 16:22, Paul Rubin wrote: Steve Holden, Chairman, PSF chair...@python.org writes: We have also registered the trademark Python for use in reference to computer programming languages, thereby ensuring that we can take action should some ill-advised individual or organization

Re: from import and __init__.py

2010-03-25 Thread Steve Holden
egbert wrote: When I do 'from some_package import some_module' the __init__.py of some_package will be run. However, there will not be anything like a package-module, and the effects of __init__.py seem all to be lost. Is that true ? Or can I still do something useful with __init__.py ?

Re: chroot fails with mount point passed to subprocess.Popen?

2010-03-25 Thread newton10471
Hi Alf, After doing some more research, including the character-by-character comparison you suggested (thank you!), I was able to get things working the way I wanted using the following: def getInstalledKernelVersion(mountPoint): linuxFsRoot = mountPoint + /root

Re: chroot fails with mount point passed to subprocess.Popen?

2010-03-25 Thread newton10471
Hi Alf, After doing some more research, including the character-by-character comparison you suggested (thank you!), I was able to get things working the way I wanted using the following: def getInstalledKernelVersion(mountPoint): linuxFsRoot = mountPoint + /root

Re: cxfreeze on ubuntu 9.10

2010-03-25 Thread Sandy
I used cxFreeze without any problem on Ubuntu 9.10 32 bit version. I tried it on a wxPython gui script and it works fine though I did'n use any setup file. Just try cxFreeze executable (should be in /usr/bin/) instead of setup file. $/usr/bin/cxFreeze my_script.py --target-dir=/what_ever_dir/

Advanced Python Programming Oxford Lectures [was: Re: *Advanced* Python book?]

2010-03-25 Thread Ethan Furman
Michele Simionato wrote: On Jan 16, 9:27 pm, mk mrk...@gmail.com wrote: Hello everyone, I looked for it I swear, but just can't find it. Most Python books seem to focus on examples of how to call functions from standard library. I don't need that, I have online Python documentation for that.

Re: sum for sequences?

2010-03-25 Thread Neil Cerutti
On 2010-03-25, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: You might not want to be so glib. The sum doc sure doesn't sound like it should work on lists. Returns the sum of a sequence of numbers (NOT strings) plus the value of parameter 'start' (which defaults to

Re: sum for sequences?

2010-03-25 Thread Stefan Behnel
Neil Cerutti, 25.03.2010 13:37: On 2010-03-25, Steven D'Aprano wrote: You might not want to be so glib. The sum doc sure doesn't sound like it should work on lists. Returns the sum of a sequence of numbers (NOT strings) plus the value of parameter 'start' (which defaults to 0).

Does a tiny Python distribution exist?

2010-03-25 Thread Johny
Does anyone know if there is a tiny Python distribution available running in a Linux environment? -- http://mail.python.org/mailman/listinfo/python-list

Re: sum for sequences?

2010-03-25 Thread Alf P. Steinbach
* Neil Cerutti: On 2010-03-25, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: You might not want to be so glib. The sum doc sure doesn't sound like it should work on lists. Returns the sum of a sequence of numbers (NOT strings) plus the value of parameter 'start' (which

Re: Advice needed on parallel processing in python

2010-03-25 Thread bobicanprogram
On Mar 24, 1:13 pm, Jon Clements jon...@googlemail.com wrote: On 24 Mar, 15:27, Glazner yoavglaz...@gmail.com wrote: Hi! I need to replace an app that does number crunching over a local network. it have about 50 computers as slaves each computer needs to run COM that will do the job

Re: Python is cool!!

2010-03-25 Thread bobicanprogram
On Mar 23, 11:55 am, Jose Manuel jfernan...@gmail.com wrote: I have been learning Python, and it is amazing I am using the tutorial that comes with the official distribution. At the end my goal is to develop applied mathematic in engineering applications to be published on the Web,

Re: Advanced Python Programming Oxford Lectures [was: Re: *Advanced* Python book?]

2010-03-25 Thread Michele Simionato
On Mar 25, 1:28 pm, Ethan Furman et...@stoneleaf.us wrote: Michele, Was wondering if you'd had a chance to re-post your lectures -- just did a search for them and came up empty, and I would love to read them! Many thanks in advance! Oops, I forgot! I will try to make them available soon.

Re: Advice Criticism on Python App

2010-03-25 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Wed, 24 Mar 2010 21:14:23 -0700, Tim Roberts wrote: Jimbo nill...@yahoo.com wrote: class stock: code = purchasePrice= 0 purchaseQuantity = 0 price= [] # list of recent prices recentBid= [] # list of recent

Re: threads (specifically timers) and releasing resources

2010-03-25 Thread Alex Hall
Thanks, this should work. On 3/25/10, Tim Golden m...@timgolden.me.uk wrote: On 25/03/2010 02:31, Alex Hall wrote: Okay, I have my program and it has three different modes (there will be more than that). Each mode will have a timer attached to it. If the mode remains active and the timer runs

Re: Python is cool!!

2010-03-25 Thread Bruno Desthuilliers
Jose Manuel a écrit : I have been learning Python, and it is amazing I am using the tutorial that comes with the official distribution. At the end my goal is to develop applied mathematic in engineering applications to be published on the Web, specially on app. oriented to simulations and

Re: Does a tiny Python distribution exist?

2010-03-25 Thread cassiope
On Mar 25, 5:45 am, Johny pyt...@hope.cz wrote: Does anyone know if there is a tiny Python distribution available running in a Linux environment? Debian has a package: python-minimal. HTH... -- http://mail.python.org/mailman/listinfo/python-list

nested threading

2010-03-25 Thread Omer Ihsan
is there anything as nested threadingthat is, call a thread from within a thread. in this case how will thread locking take place. for example initially there were two functions that were called using threading.Thread. these wont get unlocked unless both of them are done with whatever they

Re: Does a tiny Python distribution exist?

2010-03-25 Thread Tim Golden
On 25/03/2010 15:10, cassiope wrote: On Mar 25, 5:45 am, Johnypyt...@hope.cz wrote: Does anyone know if there is a tiny Python distribution available running in a Linux environment? Debian has a package: python-minimal. HTH... tinypy? http://www.tinypy.org/ TJG --

Represent object type as

2010-03-25 Thread Jason
Hi, I want to send objects (new style) over DBUS. DBUS can only send fairly primitive types[1] so I turn my objects into dicts and send that. I'm reusing the __getstate__ function I wrote for pickling like so: def __getstate__(self): attrs = self.__dict__.copy() return attrs

Re: Represent object type as

2010-03-25 Thread Bruno Desthuilliers
Jason a écrit : Hi, I want to send objects (new style) over DBUS. DBUS can only send fairly primitive types[1] so I turn my objects into dicts and send that. I'm reusing the __getstate__ function I wrote for pickling like so: def __getstate__(self): attrs = self.__dict__.copy()

ANN: Pymazon 0.1.1 Released

2010-03-25 Thread Chris Colbert
I'm happy to announce the release of Pymazon 0.1.1! This release brings a big enhancement in the form of PyGtk support in addition to the PyQt4 and Command line interfaces already available. A special thanks to Ray Meyers for his gtk commits! Pymazon Changelog 0.1.1 - - Added support for

Re: from import and __init__.py

2010-03-25 Thread Terry Reedy
On 3/25/2010 6:16 AM, egbert wrote: When I do 'from some_package import some_module' the __init__.py of some_package will be run. However, there will not be anything like a package-module, and the effects of __init__.py seem all to be lost. Is that true ? No. If you do from sys import

ANN: ActivePython 2.6.5.12 and 3.1.2.3 are now available

2010-03-25 Thread Sridhar Ratnakumar
We are pleased to announce the availability of both ActivePython 2.6.5.12 and ActivePython 3.1.2.3. http://www.activestate.com/activepython/ Here is what you should know about these two releases: PyWin32: PyWin32 is now included in the 64-bit Python3 builds! Since we recently updated

Repetition of work in Jython

2010-03-25 Thread Andrey Fedorov
Hi all, So from what I understand, Jython translates Python code into JVM byte code. Does anyone know why this was chosen instead of translating Python bytecode to JVM bytecode directly? It seems that it would be a lot easier to get Jython up-to-speed if there could be some shared components

Re: Castrated traceback in sys.exc_info()

2010-03-25 Thread Andreas Löscher
As you see, the traceback only starts from function c, which handles the exception. It doesn't show main(), a() and b(), which might however be (and are, in my case) critical to diagnose the severity of the problem (since many different paths would lead to calling c()). This results in

Re: Repetition of work in Jython

2010-03-25 Thread Steve Holden
Andrey Fedorov wrote: Hi all, So from what I understand, Jython translates Python code into JVM byte code. Does anyone know why this was chosen instead of translating Python bytecode to JVM bytecode directly? It seems that it would be a lot easier to get Jython up-to-speed if there could be

Re: Possible? Python 2.6.x and PythonWin on 64-bit Windows 7

2010-03-25 Thread Sridhar Ratnakumar
On 2010-02-09, at 2:49 PM, Sridhar Ratnakumar wrote: On 2010-02-07, at 5:02 PM, escalation746 wrote: Andrej Mitrovic wrote: Perhaps you've accidentally downloaded the wrong version of PythonWin? Erk, yes, my bad. Thanks for the quick help! Though I still wonder why the ActiveState

Re: Is there any library for indexing binary data?

2010-03-25 Thread Irmen de Jong
On 25-3-2010 10:55, 甜瓜 wrote: Thank you irmen. I will take a look at pytable. FYI, let me explain the case clearly. Originally, my big data table is simply array of Item: struct Item { long id;// used as key BYTE payload[LEN]; // corresponding value with fixed length };

Improved timedelta attributes/methods

2010-03-25 Thread Christian Ştefănescu
Hello dear Python-wielding developers! I generally like date/time handling in Python very much, especially how date operations result in Timedelta objectshttp://docs.python.org/library/datetime.html#timedelta-objects. But I find it somewhat impractical, that you can only get days, seconds and

Re: RELEASED Python 2.6.5

2010-03-25 Thread Peter
On Wed, 24 Mar 2010 23:22:01 +0100, Martin v. Loewis wrote: Is anyone else having trouble with the 2.6.5 Windows x86 installer? Not me. Run msiexec /i py...msi /l*v py.log and inspect py.log for errors (post it to bugs.python.org if you can't determine the cause of the problems).

Re: sum for sequences?

2010-03-25 Thread Steven D'Aprano
On Thu, 25 Mar 2010 14:02:05 +0100, Alf P. Steinbach wrote: * Neil Cerutti: On 2010-03-25, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: You might not want to be so glib. The sum doc sure doesn't sound like it should work on lists. Returns the sum of a sequence of

Revisiting Generators and Subgenerators

2010-03-25 Thread Winston
I have been reading PEP 380 because I am writing a video game/ simulation in Jython and I need cooperative multitasking. PEP 380 hits on my problem, but does not quite solve it for me. I have the following proposal as an alternative to PEP380. I don't know if this is the right way for me to

Revisiting Generators and Subgenerators

2010-03-25 Thread Winston
Here's my proposal again, but hopefully with better formatting so you can read it easier. -Winston - Proposal for a new Generator Syntax in Python 3K-- A Baton object for generators to allow subfunction to yield, and to make them symetric. Abstract Generators can

Create a class at run-time

2010-03-25 Thread Michel
Hi everyone, I'm trying to dynamically create a class. What I need is to define a class, add methods to it and later instantiate this class. Methods need to be bound to the instance though, and that's my problem. Here is what I have so far: method_template = def test_foo(self):\ #actual

XPCOM/hulahop: waiting for JavaScript finished?

2010-03-25 Thread John Bokma
I am playing a bit with hulahop/xpcom using the code found at http://www.advogato.org/article/1014.html but have no idea how to check if some JavaScript has finised running. The _loaded method of Browser is called after the document has finished loading, but as far as I can tell this doesn't

Re: Create a class at run-time

2010-03-25 Thread Michiel Overtoom
On 2010-03-25 23:00, Michel wrote: I'm trying to dynamically create a class. What I need is to define a class, add methods to it and later instantiate this class. Methods need to be bound to the instance though, and that's my problem. Maybe this snippet is of any help? import functools

Re: from import and __init__.py

2010-03-25 Thread egbert
On Thu, Mar 25, 2010 at 12:43:13PM -0400, Terry Reedy wrote: On 3/25/2010 6:16 AM, egbert wrote: When I do 'from some_package import some_module' the __init__.py of some_package will be run. However, there will not be anything like a package-module, and the effects of __init__.py seem all to

Re: Create a class at run-time

2010-03-25 Thread Patrick Maupin
On Mar 25, 5:00 pm, Michel michel.metz...@gmail.com wrote: Hi everyone, I'm trying to dynamically create a class. What I need is to define a class, add methods to it and later instantiate this class. Methods need to be bound to the instance though, and that's my problem. Here is what I have

Python database of plain text editable by notepad or vi

2010-03-25 Thread James Harris
I am looking to store named pieces of text in a form that can be edited by a standard editor such as notepad (under Windows) or vi (under Unix) and then pulled into Python as needed. The usual record locking and transactions of databases are not required. Another way to look at it is to treat the

Re: Python database of plain text editable by notepad or vi

2010-03-25 Thread jkn
Kirbybase is one possibility. http://pypi.python.org/pypi/KirbyBase/1.9 J^n -- http://mail.python.org/mailman/listinfo/python-list

Re: Python database of plain text editable by notepad or vi

2010-03-25 Thread Jon Clements
On 25 Mar, 22:40, James Harris james.harri...@googlemail.com wrote: I am looking to store named pieces of text in a form that can be edited by a standard editor such as notepad (under Windows) or vi (under Unix) and then pulled into Python as needed. The usual record locking and transactions

Re: nested threading

2010-03-25 Thread Chris Colbert
Spawning a thread from within a thread works just fine. Calling thread.start() is a non-blocking function and returns immediately. On Thu, Mar 25, 2010 at 11:23 AM, Omer Ihsan omrih...@gmail.com wrote: is there anything as nested threadingthat is, call a thread from within a thread. in

Re: Sniffing encoding type by looking at file BOM header

2010-03-25 Thread Lawrence D'Oliveiro
In message mailman.1139.1269442366.23598.python-l...@python.org, pyt...@bdurham.com wrote: BOM_UTF8 = '\xef\xbb\xbf' Since when does UTF-8 need a BOM? -- http://mail.python.org/mailman/listinfo/python-list

Re: Sniffing encoding type by looking at file BOM header

2010-03-25 Thread Irmen de Jong
On 26-3-2010 0:16, Lawrence D'Oliveiro wrote: In messagemailman.1139.1269442366.23598.python-l...@python.org, pyt...@bdurham.com wrote: BOM_UTF8 = '\xef\xbb\xbf' Since when does UTF-8 need a BOM? It doesn't, but it is allowed. Not recommended though. Unfortunately several tools, such

Don't understand behavior; instance form a class in another class' instance

2010-03-25 Thread Martin P. Hellwig
Hi all, When I run the following snippet (drastically simplified, to just show what I mean): import platform, sys class One(object): def __init__(self): self.one = True def change(self): self.one = False class Two(object): def __init__(self):

Re: Don't understand behavior; instance form a class in another class' instance

2010-03-25 Thread Christian Heimes
Martin P. Hellwig schrieb: What I don't understand why in the second test, the last boolean is True instead of (what I expect) False. Could somebody enlighten me please as this has bitten me before and I am confused by this behavior. Hint: TEST2.one is not a reference to

Re: Don't understand behavior; instance form a class in another class' instance

2010-03-25 Thread Martin P. Hellwig
On 03/25/10 23:41, Christian Heimes wrote: Martin P. Hellwig schrieb: What I don't understand why in the second test, the last boolean is True instead of (what I expect) False. Could somebody enlighten me please as this has bitten me before and I am confused by this behavior. Hint: TEST2.one

python logging writes an empty file

2010-03-25 Thread Ovidiu Deac
Hi, I have the following situation: My application uses nosetests to discoverrun the unittests. I pass the log configuration file as --logging-config=logging.conf Everything works just fine, the logs are printed as required by the configuration file which makes me happy. I take this as a sign

Re: Revisiting Generators and Subgenerators

2010-03-25 Thread Cameron Simpson
On 25Mar2010 14:39, Winston winst...@stratolab.com wrote: | Here's my proposal again, but hopefully with better formatting so you | can read it easier. Having quickly read the Abstract and Motivation, why is this any better than a pair of threads and a pair of Queue objects? (Aside from

Traversing through Dir()

2010-03-25 Thread Andrej Mitrovic
I would like to traverse through the entire structure of dir(), and write it to a file. Now, if I try to write the contents of dir() to a file (via pickle), I only get the top layer. So even if there are lists within the returned list from dir(), they get written as a list of strings to the file.

Re: Revisiting Generators and Subgenerators

2010-03-25 Thread Winston Wolff
Coroutines achieve very similar things to threads, but avoid problems resulting from the pre-emptive nature of threads. Specifically, a coroutine indicates where it will yield to the other coroutine. This avoids lots of problems related to synchronization. Also the lightweight aspect is

Re: Represent object type as

2010-03-25 Thread Jason
On Mar 26, 12:00 am, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote:            attrs['type'] = type(self) Do the same thing with less work !-) Ah, silly me :P      attrs['__typename__'] = type(self).__name__ That's exactly what I needed — I was not aware of the

Re: Traversing through Dir()

2010-03-25 Thread Shashwat Anand
have you tried os.walk() ? On Fri, Mar 26, 2010 at 5:55 AM, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: I would like to traverse through the entire structure of dir(), and write it to a file. Now, if I try to write the contents of dir() to a file (via pickle), I only get the top

Automatic import ?

2010-03-25 Thread C. B.
Hi everyone, I'm currently coding a C library which provides several modules and objects. Let's say that some of these objects are classes called AAA and BBB. The constructor of AAA needs to get BBB as argument. So I can run the following code : from mymodule import AAA from mymodule import

Re: Don't understand behavior; instance form a class in another class' instance

2010-03-25 Thread Rhodri James
On Fri, 26 Mar 2010 00:06:06 -, Martin P. Hellwig martin.hell...@dcuktec.org wrote: On 03/25/10 23:41, Christian Heimes wrote: Martin P. Hellwig schrieb: What I don't understand why in the second test, the last boolean is True instead of (what I expect) False. Could somebody enlighten

Re: Is there any library for indexing binary data?

2010-03-25 Thread 甜瓜
Many thanks for your kind reply. As you mentioned, a sparse array may be the best choice. Storing offset rather than payload itself can greatly save memory space. 1e7 queries per second is my ideal aim. But 1e6 must be achieved. Currently I have implemented 5e6 on one PC (without incremental

Re: Create a class at run-time

2010-03-25 Thread I V
On Thu, 25 Mar 2010 15:00:35 -0700, Michel wrote: I'm trying to dynamically create a class. What I need is to define a class, add methods to it and later instantiate this class. Methods need to be bound to the instance though, and that's my problem. Here is what I have so far: I'm not

Re: Don't understand behavior; instance form a class in another class' instance

2010-03-25 Thread Martin P. Hellwig
On 03/26/10 01:10, Rhodri James wrote: cut Pretty much. In the sense that you're thinking of, every assignment works that way, even the initial TEST1 = One(). Assignment binds names to objects, though you have to be aware that names can be such exotic things as t, a[15] or

Re: Is there any library for indexing binary data?

2010-03-25 Thread John Nagle
甜瓜 wrote: Well, Database is not proper because 1. the table is very big (~10^9 rows) 2. we should support very fast *simple* query that is to get value corresponding to single key (~10^7 queries / second). Ah, crypto rainbow tables. John Nagle --

Re: Revisiting Generators and Subgenerators

2010-03-25 Thread Patrick Maupin
On Mar 25, 7:31 pm, Winston Wolff winst...@stratolab.com wrote: (a bunch of stuff about coroutines) There have been proposals in the past for more full-featured generators, that would work as general purpose coroutines. Among other things, there were issues with exception propagation, and the

Re: Automatic import ?

2010-03-25 Thread Steven D'Aprano
On Thu, 25 Mar 2010 18:03:58 -0700, C. B. wrote: Hi everyone, I'm currently coding a C library which provides several modules and objects. Let's say that some of these objects are classes called AAA and BBB. The constructor of AAA needs to get BBB as argument. So I can run the

Re: Revisiting Generators and Subgenerators

2010-03-25 Thread Stefan Behnel
Patrick Maupin, 26.03.2010 04:30: ... and then re-post your document. ... preferably to the python-ideas mailing list. Although it seems to me that this is something that could be explored as a library first - which usually means that people will tell you exactly that on python-ideas and

[issue8228] pprint, single/multiple items per line parameter

2010-03-25 Thread Dmitry Chichkov
New submission from Dmitry Chichkov dchich...@gmail.com: I've run into a case where pprint isn't really pretty. import pprint pprint.PrettyPrinter().pprint([1]*100) Prints a lengthy column of '1'; Not pretty at all. Look: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,

[issue8211] configure: ignore AC_PROG_CC hardcoded CFLAGS

2010-03-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: MaL It unconditionally overrides CFLAGS - even if it is not MaL set and defined by AC_PROG_CC as -g -O2. That would need MaL to be corrected. MaL

[issue8211] configure: ignore AC_PROG_CC hardcoded CFLAGS

2010-03-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: I commited my patch: r79392 (trunk). I'm waiting for the buildbots before porting to other branches :-) The buildbots look happy = r79401 (py3k),

[issue8228] pprint, single/multiple items per line parameter

2010-03-25 Thread Dmitry Chichkov
Dmitry Chichkov dchich...@gmail.com added the comment: Quick, dirty and utterly incorrect patch that works for me. Includes issue_5131.patch (defaultdict support, etc). Targets trunk (2.6), revision 77310. -- keywords: +patch Added file:

[issue6543] traceback presented in wrong encoding

2010-03-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Storing unicode in c_filename would not solve the problem: surrogateescape characters are not printable. There is no need to support non-decodable filenames in the import mechanism. -- ___

[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-03-25 Thread Giampaolo Rodola'
Giampaolo Rodola' billiej...@users.sourceforge.net added the comment: @Antoine Pitrou: ok, I think I'll have to be able to replicate the error in order to try to fix this. I'm gonna try on FreeBSD and another Linux box later today. -- ___ Python

[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-03-25 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: I don't know if it is better to fix it in the ftplib or the ssl module. The previous patch fixes it at the SSL level (stdlib only). This patch implements the fix at the ftplib level (stdlib + test). -- Added file:

[issue8229] Interpreter crash on application shutdown

2010-03-25 Thread tb220
New submission from tb220 tb...@yahoo.com: Attached the error report generated by Windows. The problem occurs in 1 out of 10 shutdowns. -- components: Interpreter Core, Windows files: cabb_appcompat.txt messages: 101679 nosy: tb220 severity: normal status: open title: Interpreter crash

[issue8229] Interpreter crash on application shutdown

2010-03-25 Thread tb220
Changes by tb220 tb...@yahoo.com: -- type: - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8229 ___ ___ Python-bugs-list mailing list

[issue8211] configure: ignore AC_PROG_CC hardcoded CFLAGS

2010-03-25 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: MaL The patch you checked in still unconditionally overrides the MaL CFLAGS setting applied by AC_PROG_CC in case no CFLAGS variable MaL is set. MaL MaL The issue now is: AC_PROG_CC no longer initializes CFLAGS MaL if not set.

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Good point. So that makes the implementation more like: import traceback import syslog import sys def syslog_exception(etype, evalue, etb): # The result of traceback.format_exception might contain # embedded newlines, so we have the

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Once it's moved into syslog, maybe syslog_exception named syslog.log_exception. In that case, how would be called the second function? Can write a patch with an unit test? -- ___

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Once it's moved into syslog, maybe syslog_exception named syslog.log_exception. That's should be named, of course. Although on second thought maybe syslog.syslog_exception really is the right name, to mirror syslog.syslog. In that case, how

[issue8229] Interpreter crash on application shutdown

2010-03-25 Thread tb220
tb220 tb...@yahoo.com added the comment: Please let me know how I can provide you with additional information. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8229 ___

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I'm not sure which second function you mean. logexceptions which replaces sys.excepthook. log_exception and log_exceptions are very close. cgitb has a function enable which sets sys.excepthook. --

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Ah, I see. Yes, logexceptions needs a better name. Maybe enable_exception_logging. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8214 ___

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Here's a version that would be more analogous to what the C implementation would look like. It uses a class instead of a closure to capture the chain value. The 2 exposed functions syslog_exception and enable_exception_logging are the new APIs

[issue8224] subprocess.Popen raises WindowsError if there is a dot in program name

2010-03-25 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I agree with David that this is a Windows problem. I copied xcopy.exe into a local directory as xcopy.exe and xcopy.a.exe. When running this VBScript, the first line runs, the second gives me an error 0x8007002, The system could not find the

[issue8211] configure: ignore AC_PROG_CC hardcoded CFLAGS

2010-03-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: MaL The patch you checked in still unconditionally overrides the MaL CFLAGS setting applied by AC_PROG_CC in case no CFLAGS variable MaL is set. MaL

[issue8229] Interpreter crash on application shutdown

2010-03-25 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: A recipe for reproducing the problem would be the most useful thing. I suspect the windows error report is pretty much useless in this context. -- nosy: +r.david.murray priority: - normal stage: - test needed

[issue7992] Backport capsule object

2010-03-25 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: All windows buildbots fail to compile: http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%20trunk http://www.python.org/dev/buildbot/all/builders/x86%20XP-5%20trunk

  1   2   >