ANN: rom 0.25.0 - Redis object mapper for Python

2014-01-21 Thread Josiah Carlson
Hey everyone, Big change today: rom now supports fast prefix, suffix, and pattern match queries over your data. The method is based on the autocomplete process described in my book, Redis in Action The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's O

ANN: rom 0.22 - Redis object mapper for Python

2013-11-03 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

ANN: RPQueue 0.22

2013-10-08 Thread Josiah Carlson
Hello everyone, For those of you who didn't know, if you are interested in a Redis-backed time and/or fifo-queue with priorities, retries, etc., to be used with Python, one exists and is mature: it's called RPQueue, and it seeks to simplify your life of task execution. The recent changelog entries

ANN: rom 0.21 - Redis object mapper for Python

2013-10-02 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

ANN: RPQueue 0.21

2013-09-20 Thread Josiah Carlson
Hello everyone, For those of you who didn't know, if you are interested in a Redis-backed time and/or fifo-queue with priorities, retries, etc., to be used with Python, one exists and is mature: it's called RPQueue, and it seeks to simplify your life of task execution. The recent changelog entries

Ann: rom 0.20 - Redis object mapper for Python

2013-09-12 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

ANN: rom 0.19 - Redis object mapper for Python

2013-08-27 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

ANN: rom 0.18 - Redis object mapper for Python

2013-08-18 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

ANN: rom 0.16 - Redis object mapper for Python

2013-07-18 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

ANN: rom 0.10 - Redis object mapper for Python

2013-04-21 Thread Josiah Carlson
Hey everyone, I know, it's been several years since I announced anything on these lists, but I suspect that some of you may have uses for my new package, so here you go. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or

Re: Doubts about how implementing asynchronous timeouts through a heap

2008-08-05 Thread Josiah Carlson
On Jul 12, 12:16 pm, Josiah Carlson <[EMAIL PROTECTED]> wrote: > On Jul 9, 4:13 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > I'm trying to implement an asynchronous scheduler forasyncoreto call > > functions

Re: Questions about asyncore

2008-08-05 Thread Josiah Carlson
On Jul 29, 4:09 am, Frank Millman <[EMAIL PROTECTED]> wrote: > Hi all > > I have been using my own home-brewed client/server technique for a > while, using socket and select. It seems to work ok. The server can > handle multiple clients. It does this by creating a new thread for > each connection.

Re: Doubts about how implementing asynchronous timeouts through a heap

2008-07-12 Thread Josiah Carlson
On Jul 9, 4:13 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to implement an asynchronous scheduler for asyncore to call > functions at a later time without blocking the main loop. > The logic behind it consists in: > > - adding the scheduled functions into a heapified list

Re: Doubts about how implementing asynchronous timeouts through a heap

2008-07-10 Thread Josiah Carlson
On Jul 10, 11:30 am, Josiah Carlson <[EMAIL PROTECTED]> wrote: > On Jul 9, 4:13 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > I'm trying to implement an asynchronous scheduler for asyncore to call > > functions

Re: Doubts about how implementing asynchronous timeouts through a heap

2008-07-10 Thread Josiah Carlson
On Jul 9, 4:13 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to implement an asynchronous scheduler for asyncore to call > functions at a later time without blocking the main loop. > The logic behind it consists in: > > - adding the scheduled functions into a heapified list

Re: asynchat sends data on async_chat.push and .push_with_producer

2008-05-13 Thread Josiah Carlson
On May 13, 9:35 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > In a pure world, the only writing that is done would be within the > > handle_send() callbacks within the select loop. Then again, in a > > perfect world, calling readable() and writable() would have no strange > > side affects

Re: asynchat sends data on async_chat.push and .push_with_producer

2008-05-13 Thread Josiah Carlson
Ludvig, In a substantial way, I agree with you. Calling initiate_send() within push or push_with_producer is arguably a misfeature (which you have argued). In a pure world, the only writing that is done would be within the handle_send() callbacks within the select loop. Then again, in a perfect

Re: Adding idle timeout capabilities to asyncore

2007-10-24 Thread Josiah Carlson
On Oct 23, 9:30 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 23 Oct 2007 15:34:19 -0000, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > [snip] > > >Calling time.time() is relatively inexpensive in comparison to pure > >Python function calls,

Re: Adding idle timeout capabilities to asyncore

2007-10-23 Thread Josiah Carlson
On 22 Ott, 12:28, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > Hi there. > We're talking about an asyncore-based server. > Just for the heck of it I'd like to set a timeout which will > disconnects the clients if they're inactive (i.e., no command or data > transfer in progress) for a long period

Re: ANN: PyPE 2.8.7

2007-10-02 Thread Josiah Carlson
On Sep 26, 12:50 am, stef <[EMAIL PROTECTED]> wrote: > thebjorn wrote: > > On Sep 25, 12:37 pm, stef <[EMAIL PROTECTED]> wrote: > > >> Josiah Carlson wrote: > > >>> === What isPyPE? === > >>>PyPE(Python Programmers' Editor) was writ

ANN: PyPE 2.8.8

2007-09-30 Thread Josiah Carlson
7;s home on the web: http://pype.sf.net/index.shtml If you have any questions about PyPE, please contact me, Josiah Carlson, aka the author of PyPE, at jcarlson at uci.edu (remember to include "PyPE" in the subject). PyPE 2.8.7 includes the following changes and bug

ANN: PyPE 2.8.7

2007-09-25 Thread Josiah Carlson
7;s home on the web: http://pype.sf.net/index.shtml If you have any questions about PyPE, please contact me, Josiah Carlson, aka the author of PyPE, at jcarlson at uci.edu (remember to include "PyPE" in the subject). PyPE 2.8.7 includes the following changes and bug

ANN: PyPE 2.8.6

2007-08-26 Thread Josiah Carlson
7;s home on the web: http://pype.sf.net/index.shtml If you have any questions about PyPE, please contact me, Josiah Carlson, aka the author of PyPE, at jcarlson at uci.edu (remember to include "PyPE" in the subject). PyPE 2.8.6 includes the following changes and bugfixes since rele

Re: How to tell when a socket is closed on the other end?

2007-07-26 Thread Josiah Carlson
Jay Loden wrote: > Roy Smith wrote: >> In article <[EMAIL PROTECTED]>, >> billiejoex <[EMAIL PROTECTED]> wrote: >> >>> Hi there. >>> I'm setting up test suite for a project of mine. >>> >From test suite, acting as a client, I'd like to know, in certain >>> situations, if the socket is closed on th

Re: How to tell when a socket is closed on the other end?

2007-07-25 Thread Josiah Carlson
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > billiejoex <[EMAIL PROTECTED]> wrote: > >> Hi there. >> I'm setting up test suite for a project of mine. >> >From test suite, acting as a client, I'd like to know, in certain >> situations, if the socket is closed on the other end or not. >> I

Re: decorators tutorials

2007-07-25 Thread Josiah Carlson
james_027 wrote: > hi bruno, > > That seems to be hard to read at all, or I am just very new to python? No, it's hard to read. Note that it's not, technically, necessary to use nested functions to get the same results as a particular decorator. For example, earlier you provided... def check

Re: wxPython and threads

2007-07-19 Thread Josiah Carlson
Nick Craig-Wood wrote: > Josiah Carlson <[EMAIL PROTECTED]> wrote: >> Sending results one at a time to the GUI is going to be slow for any >> reasonably fast search engine (I've got a pure Python engine that does >> 50k results/second without breaking a

Re: wxPython and threads

2007-07-19 Thread Josiah Carlson
Benjamin wrote: > I'm writing a search engine in Python with wxPython as the GUI. I have > the actual searching preformed on a different thread from Gui thread. > It sends it's results through a Queue to the results ListCtrl which > adds a new item. This works fine or small searches, but when the >

Re: Implementaion of random.shuffle

2007-07-17 Thread Josiah Carlson
shabda raaj wrote: > The code for shuffle is > > if random is None: > random = self.random > for i in reversed(xrange(1, len(x))): > # pick an element in x[:i+1] with which to exchange x[i] > j = int(random() * (i+1)) > x[i], x[

Re: Marshalling big objects

2007-07-15 Thread Josiah Carlson
Gabriel Genellina wrote: > En Sat, 14 Jul 2007 20:04:21 -0300, Orlando Döhring <[EMAIL PROTECTED]> > escribió: > >> I want to marshal objects: >> >> - http://docs.python.org/lib/module-marshal.html >> where I have problems with a bigger objects, e.g. > > Any specific reason you use this module?

Re: Python Subprocess module

2007-07-15 Thread Josiah Carlson
Dave Sampson wrote: > I am supposed to be able to entre 'y' and return for the program to > continue if I agree with what I see in the stdout. > > A problem exists though that I have tried > 'y' > 'y\n' > 'y\r' Depending on the platform, you may need to send '\r\n'. > ASPN Python cookbok provi

Re: trouble controlling vim with subprocess on windows machine

2007-07-10 Thread Josiah Carlson
agc wrote: > Hi Josiah, > This recipe for asynchronous communication usingsubprocesscould be used to write an expect-like tool: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 > > I have played with the above recipe and it is excellent, > but could you please go i

Re: highly einteractive editor for python

2007-07-09 Thread Josiah Carlson
Atul Bhingarde wrote: > Does anybody know an editor that facilitates, interactive python > development. Where GUI etc developed will be possible to see in real time > mode. Boa Constructor? wxGlade embedded in some other software (SPE?) XRCed? What do you mean by "real time mode"? - Josi

Re: trouble controlling vim with subprocess on windows machine

2007-07-09 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > On Jul 9, 11:06 am, Josiah Carlson <[EMAIL PROTECTED]> > wrote: >> [EMAIL PROTECTED] wrote: >>> I am having trouble contolling vim with subprocess on a windows >>> machine. It appears that vim comes up on the machine all right a

Re: trouble controlling vim with subprocess on windows machine

2007-07-09 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I am having trouble contolling vim with subprocess on a windows > machine. It appears that vim comes up on the machine all right and it > sometimes looks like it is doing the searchs what I am asking it to do > but when I am asking it to load a file it doesn't do an

Re: Getting the home directory in Python and a bug in os.path.expanduser

2007-07-07 Thread Josiah Carlson
Edward Diener wrote: > What is the generic operating system way of getting the home directory ? > > I am guessing it is os.path.expanduser("~"). Is there a better way or an > alternate way ? > > If it is as I surmise, the aforementioned expanduser("~") of os.path > seems incorrect to me under W

Re: Auto-parallelizing with decorators?

2007-07-07 Thread Josiah Carlson
Kirk Strauser wrote: > In article <[EMAIL PROTECTED]>, > Kirk Strauser <[EMAIL PROTECTED]> wrote: > >> I was thinking about how a lot of Lisp proponents claim that Lisp is >> inherently parallelizable because its functions don't have (or are not >> supposed to have) side effects, and therefore th

Re: Interfacing python program to C++ program instance

2007-07-05 Thread Josiah Carlson
Jim Langston wrote: > Windows. Situation: Using a Python program called OpenRPG. I have a program > that displays form data (a character sheet) in C++. I am able in the C++ > program to build a string and copy it into the clipboard, then paste it into > the input in the running Python program.

Re: CGI vs WSGI

2007-07-04 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I'm wondering because the only variables I ever needed were PATH_INFO, > REQUEST_METHOD, QUERY_STRING and maybe one more, all of which should > be available from CGI, too. CGI starts up a new process for every request, using stdin/stdout for passing information. I beli

Re: Memory leak issue with complex data structure

2007-07-04 Thread Josiah Carlson
Alan Franzoni wrote: > I have a root node which is not referenced by any other node. So, I > created a "clear()" method which is called on all children (by calling > their clear() method" and then clears the set with the references of the > node itself. Using the .clear() method on sets (or dictio

Re: Building a Python app with Mozilla

2007-06-30 Thread Josiah Carlson
Thorsten Kampe wrote: > Hi, > > I've already sent this to the Komodo mailing list (which seemed to me > the more appropriate place) but unfortunately I got no response. > > I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor > PyQT are actually what I want (because the lack of

Re: 16bit hash

2007-06-27 Thread Josiah Carlson
Robin Becker wrote: > Is the any way to get an efficient 16bit hash in python? hash(obj)&65535 - Josiah -- http://mail.python.org/mailman/listinfo/python-list

Re: guidance needed: best practice for script packaging

2007-06-26 Thread Josiah Carlson
Alan Isaac wrote: > This is a simple question about actual practice. > I just want to know how you (yes you) are > approaching this problem. > The problem: > What is the recommended packaging of > demo scripts or test scripts for a package > to be distributed to others to "play with". > (I.e., wit

Re: Internals and complexity of types, containers and algorithms

2007-06-26 Thread Josiah Carlson
Harald Luessen wrote: > On Mon, 25 Jun 2007 Martin v. Löwis wrote: > >> Sure, see below: >> >> - tuples are represented as arrays, with a single block for the >> entire objects (object header, tuple size, and data) >> - list are represented as arrays, with two memory blocks: >> one for object he

Re: Chroot Jail Not Secure for Sandboxing Python?

2007-06-25 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > On Jun 25, 1:43 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] schrieb: >> >>> This wiki page suggests using a chroot jail to sandbox Python, but >>> wouldn't running something like this in your sandboxed Python instance >>> still break you out of t

Re: high performance/threaded applications in Python - your experiences?

2007-06-24 Thread Josiah Carlson
Ivan Voras wrote: > Jay Loden wrote: > >> I was hoping for some experiences that some of you on the list may have had >> in dealing with Python in a high performance and/or threaded environment. In >> essence, I'm wondering how big of a deal the GIL can be in a real-world >> scenario where you

Re: Python and (n)curses

2007-06-18 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I need to develop a cross-platform text-mode application. I would like > to do it in Python and I would like to use a mature text-mode library > for the UI stuff. > > The obvious choice, I thought, was ncurses. But as far as I can tell, > it is not available for Python o

Re: cStringIO unicode weirdness

2007-06-18 Thread Josiah Carlson
Paul Rubin wrote: > Python 2.5 (r25:51908, Oct 6 2006, 15:24:43) > [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import StringIO, cStringIO > >>> StringIO.StringIO('a').getvalu

Re: Memory problem with Python

2007-06-18 Thread Josiah Carlson
Squzer Crawler wrote: > On Jun 18, 11:06 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> On Jun 17, 8:51 pm, Squzer Crawler <[EMAIL PROTECTED]> wrote: >> >>> i am developing distributed environment in my college using Python. I >>> am using therads in client for downloading wepages. Even thou

Re: MS Word parser

2007-06-17 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I'm currently using antiword to extract content from MS Word files. > Is there another way to do this without relying on any command prompt > application? There is also wvware http://wvware.sourceforge.net/, but it is also generally a command-line application. Either o

Re: Trivial string substitution/parser

2007-06-17 Thread Josiah Carlson
Samuel wrote: > On Sun, 17 Jun 2007 11:00:58 +, Duncan Booth wrote: > >> The elegant and lazy way would be to change your specification so that $ >> characters are escaped by $$ not by backslashes. Then you can write: >> > from string import Template > ... > > Thanks, however, turns o

Re: smtp server simulation using Python

2007-06-17 Thread Josiah Carlson
William Gill wrote: > I have a (web) development computer w/o an SMTP server and want to test > form generated e-mail using a dummy SMTP server that delivers the mail > message to a file, or better yet, to a text editor instead of actually > sending it. Is it possible to extend the DebuggingSer

Re: Priority Queue with Mutable Elements

2007-06-15 Thread Josiah Carlson
Chris Lasher wrote: > I am working with large graphs (~150,000 to 500,000 nodes) which I > need decompose node-by-node, in order of a node's value. A node's > value is determined by the sum of its edge weights. When a node is > removed from the graph, its neighbors' values must be updated to take >

Re: dynamically generated runtime methods & reflection

2007-06-14 Thread Josiah Carlson
Josiah Carlson wrote: > Well, the particular operation is typically called 'currying a > function', and unless you know what to look for, it isn't very easy to > make happen. Replace "make happen" to "discover in the standard library". - Josiah

Re: save class

2007-06-14 Thread Josiah Carlson
nik wrote: > of having to keep track of a separate dictionary file. I am new to > this, but I thought that this would be a regular thing to do in > python, because people must make classes in the interactive console > and then export them somehow for later use. Create a file. Put your code in it.

Re: Method much slower than function?

2007-06-14 Thread Josiah Carlson
Francesco Guerrieri wrote: > On 6/14/07, Peter Otten <[EMAIL PROTECTED]> wrote: >> Gabriel Genellina wrote: >> > ... >> > py> print timeit.Timer("f2()", "from __main__ import >> f2").repeat(number=1) >> > [0.42673663831576358, 0.42807591467630662, 0.44401481193838876] >> > py> print timeit.Timer("

Re: Method much slower than function?

2007-06-14 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > On Jun 14, 1:10 am, Paul Rubin wrote: >> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >>> take virtually the same amount of time on my machine (2.5), and the >>> non-join version is clearer, IMO. I'd still use join in case I wind >>> up runn

Re: dynamically generated runtime methods & reflection

2007-06-14 Thread Josiah Carlson
Jay Loden wrote: > Josiah Carlson wrote: >> Ahh, so you want to pass the method name to the method that you are >> returning to be called. No problem. >> >> >>> import functools >> >>> >> >>> class foo: >> ...

Re: dynamically generated runtime methods & reflection

2007-06-13 Thread Josiah Carlson
Jay Loden wrote: > Hi all, > > First, apologies if anyone gets this twice, but it took me quite a > while to figure out that Python.org is evidently rejecting all mail > from my mail server because I don't have reverse DNS configured. > Anyway: > > I'm not even sure how to phrase this question pr

Re: save class

2007-06-13 Thread Josiah Carlson
Gabriel Genellina wrote: > En Wed, 13 Jun 2007 23:11:22 -0300, nik <[EMAIL PROTECTED]> escribió: >> It would seem that I want to actually save the source code for the >> class. I know that I could of course open up an editor and just make >> it, but my ideal would be to have the base class, Map, be

Re: memory efficient set/dictionary

2007-06-11 Thread Josiah Carlson
koara wrote: >>> I would recommend you to use a database since it meets your >>> requirements (off-memory, fast, persistent). The bsdddb module >>> (berkeley db) even gives you a dictionary like interface. >>> http://www.python.org/doc/lib/module-bsddb.html >> Standard SQL databases can work for th

Re: memory efficient set/dictionary

2007-06-10 Thread Josiah Carlson
Rafael Darder Calvo wrote: >> > > Please recommend a module that allows persistent set/dict storage + >> > > fast query that best fits my problem, >> > >> > What is the problem you are trying to solve? How many keys do you have? >> >> Corpus processing. There are in the order of billions to tens of

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread Josiah Carlson
Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >>> Not tail calls, in general, no. >> Sorry, how does that work? You're suggesting that there is an algorithm >> which the compiler could follow to optimize away tail-recursion, but human >> beings can't follow the same algorithm? >>

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-10 Thread Josiah Carlson
John Nagle wrote: > Josiah Carlson wrote: [snip] >> Constant folding happens regardless of optimization level in current >> Pythons. > >> So really, assert and docstring removals. Eh. > >It's hard to optimize Python code well without global analysis. >

Re: Hooking exceptions outside of call stack

2007-06-10 Thread Josiah Carlson
Warren Stringer wrote: > Josiah Carlson wrote: >> >>> foo = type(foo)(foo.func_code, d, foo.func_name, foo.func_defaults, >> foo.func_closure) > > Wow! I've never seen that, before. Is there documentation for `type(n)(...)` > somewhere? I did find a very u

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread Josiah Carlson
Steven D'Aprano wrote: > On Sat, 09 Jun 2007 22:52:32 +, Josiah Carlson wrote: > >> the only thing that optimization >> currently does in Python at present is to discard docstrings > > Python, or at least CPython, does more optimizations than that. Aside from

Re: Multiple python interpreters within the same process

2007-06-09 Thread Josiah Carlson
André wrote: > On Jun 9, 5:00 pm, "Marcin Kalicinski" <[EMAIL PROTECTED]> wrote: >> How do I use multiple Python interpreters within the same process? >> >> I know there's a function Py_NewInterpreter. However, how do I use functions >> like Py_RunString etc. with it? They don't take any arguments

Re: Hooking exceptions outside of call stack

2007-06-09 Thread Josiah Carlson
Warren Stringer wrote: > Am still trying to hook a NameError exception and continue to run. After a > few more hours of searching the web and pouring over Martelli's book, the > closest I've come is: [snip] > Is there a way of intervening as `exec cmd in globals, locals` attempts to > translate 'c'

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-09 Thread Josiah Carlson
Alexander Schmolck wrote: > Josiah Carlson <[EMAIL PROTECTED]> writes: > >> James Stroud wrote: >>> Terry Reedy wrote: >>>> In Python, you have a choice of recursion (normal or tail) >>> Please explain this. I remember reading on this newsgroup th

Re: Hooking exceptions outside of call stack

2007-06-09 Thread Josiah Carlson
Warren Stringer wrote: > Here is what I would like to do: > > # > a = Tr3() # implements domain specific language > a.b = 1# this works, Tr3 overrides __getattr__ > a.__dict__['b'] = 2# just so you know th

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-09 Thread Josiah Carlson
James Stroud wrote: > Terry Reedy wrote: >> In Python, you have a choice of recursion (normal or tail) > > Please explain this. I remember reading on this newsgroup that an > advantage of ruby (wrt python) is that ruby has tail recursion, implying > that python does not. Does python have fully o

Re: How Can I Increase the Speed of a Large Number of Date Conversions

2007-06-07 Thread Josiah Carlson
Some Other Guy wrote: > vdicarlo wrote: >> I am a programming amateur and a Python newbie who needs to convert >> about 100,000,000 strings of the form "1999-12-30" into ordinal dates >> for sorting, comparison, and calculations. Though my script does a ton >> of heavy calculational lifting (for wh

Re: who know?

2007-06-06 Thread Josiah Carlson
Michel Claveau wrote: > Hi! > > This image show IronPython. > But... what is it? > > Link : > http://msdn2.microsoft.com/en-us/vstudio/bb510103.vss_IronPython_large.jpg What is generally referred to as "Python", available from python.org, is really the 'CPython' runtime and associated libraries

Re: lists - append - unique and sorted

2007-06-06 Thread Josiah Carlson
Neil Cerutti wrote: > On 2007-06-06, rhXX <[EMAIL PROTECTED]> wrote: >> and/or >> >> - SORTED - INSERT in the correct place using some criteria? > > Consult the Python Docs about the heapq module. Heaps (as produced by heapq) are not sorted. This will not produce correct results unless one then

Re: another thread on Python threading

2007-06-05 Thread Josiah Carlson
sturlamolden wrote: > On Jun 4, 10:11 pm, Josiah Carlson <[EMAIL PROTECTED]> > wrote: > >> However, locking isn't just for refcounts, it's to make sure that thread >> A isn't mangling your object while thread B is traversing it. > > >> W

Re: another thread on Python threading

2007-06-05 Thread Josiah Carlson
sturlamolden wrote: > On Jun 4, 10:11 pm, Josiah Carlson <[EMAIL PROTECTED]> > wrote: > >> lock = threading.Lock() >> >> with lock: >> #synchronized block! >> pass > > True, except that the lock has to be shared

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread Josiah Carlson
Steve Howell wrote: > I don't predict a huge upswing in Slavic-writing > Python programmers after PEP 3131, even among > children. Are you predicting a sharp upswing in Chinese-writing (or any language) Python programmers after PEP 3131 among children? If so, why certain groups of children and

Re: another thread on Python threading

2007-06-04 Thread Josiah Carlson
sturlamolden wrote: > On Jun 4, 3:10 am, Josiah Carlson <[EMAIL PROTECTED]> > wrote: >> From what I understand, the Java runtime uses fine-grained locking on >> all objects. You just don't notice it because you don't need to write >> the acquire()/rele

Re: magic names in python

2007-06-04 Thread Josiah Carlson
per9000 wrote: > So my questions: > * is there a comprehensive list of magic names in python (so far i > know of __init__ and __repr__)? > * are these lists complete or can magic names be added over time (to > the python "core")? > * are magic names the same in different python versions? I don'

Re: another thread on Python threading

2007-06-03 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I've recently been working on an application[1] which does quite a bit > of searching through large data structures and string matching, and I > was thinking that it would help to put some of this CPU-intensive work > in another thread, but of course this won't work becau

Re: Python rocks

2007-06-02 Thread Josiah Carlson
Mark Carter wrote: > Josiah Carlson wrote: >> What kind of scoping did you desire? > > Well, I had in mind so that if you defined a function, but wanted to > access a global var, that you didn't have to use the global keyword. Not > much of a biggie, I guess. You

Re: Non-blocking subprocess call

2007-06-02 Thread Josiah Carlson
Kevin Walzer wrote: > I'm currently using os.popen in an application of mine, which calls for > non-blocking data, in this fashion: > > self.file = os.popen('echo %s | sudo -S /sw/bin/fink -y install %s' % > (self.passtext, self.packagename), 'r', os.O_NONBLOCK) > > What is the equivalent/comp

Re: Python rocks

2007-06-02 Thread Josiah Carlson
Mark Carter wrote: > Not that I'm particularly knowledgeable about language design issues, > but maybe closures and slightly different scoping rules would be nice. Python has had closures for years. What kind of scoping did you desire? > A > pitfall of Python is knowing whether an operation is

Re: interesting take on python OO

2007-06-02 Thread Josiah Carlson
7stud wrote: > http://www.evolt.org/article/OO_programming_the_Python_way/18/449/ > > lol I would have to agree. I could spend time talking about how bad that article was, but instead I will offer useful advice for the new Python programmer. For new users of Python and/or object-oriented prog

Re: A few questions

2007-05-21 Thread Josiah Carlson
Christopher Arndt wrote: > I have a few quibles with your summary of Python's properties: > On 21 Mai, 08:16, John Nagle <[EMAIL PROTECTED]> wrote: >> Memory management >> is safe and managed by reference counts backed by a garbage collector. >> Weak references are supported. Built in data types a

Re: Components for a client/server architecture

2007-05-21 Thread Josiah Carlson
Samuel wrote: > On Mon, 21 May 2007 12:06:50 +0200, Diez B. Roggisch wrote: > >> I'm not sure which configuration you want to change how often. But I'm >> not convinced that the python threading limitations really do make a >> difference here. Do you really benefit from multi-core capabilities in

Re: Python Web Programming - looking for examples of solid high-traffic sites

2007-05-18 Thread Josiah Carlson
John Nagle wrote: >Many of the basic libraries for web related functions do have > problems. Even standard modules like "urllib" and "SSL" are buggy, > and have been for years. Outside the standard modules, it gets > worse, especially for ones with C components. Version incompatibility > for

Re: Is wsgi ready for prime time?

2007-05-17 Thread Josiah Carlson
Ron Garret wrote: wsgiref.util > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'module' object has no attribute 'util' wsgiref.headers > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'module' object has no attribute 'headers

Re: Asyncore Help?

2007-05-16 Thread Josiah Carlson
Paul Kozik wrote: > I am working on the networking code for a small Multiplayer RPG I'm > working on. I currently have some basic code using threads, but it > seems like asyncore would be far better suited for my needs. However, > I have trouble finding a solid example for what I need. Python.org a

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Josiah Carlson
Daniel Nogradi wrote: > Caching? > from cPickle import dumps dumps('0') == dumps(str(0)) > True dumps('1') == dumps(str(1)) > True dumps('2') == dumps(str(2)) > True > > dumps('9') == dumps(str(9)) > True dumps('10') == dumps(str(10)) > False du

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-13 Thread Josiah Carlson
Stefan Behnel wrote: > Anton Vredegoor wrote: >>> In summary, this PEP proposes to allow non-ASCII letters as >>> identifiers in Python. If the PEP is accepted, the following >>> identifiers would also become valid as class, function, or >>> variable names: Löffelstiel, changé, ошибка, or 売り場 >>> (

Re: preferred windows text editor?

2007-05-12 Thread Josiah Carlson
T. Crane wrote: > Right now I'm using Notepad++. What are other people using? If you are looking for editors written in Python (that are generally multiplatform using wxPython), there are a few listed: http://wiki.wxpython.org/wxPythonPit_Apps . If you are looking for editors with Python suppo

Re: regex question

2007-04-27 Thread Josiah Carlson
proctor wrote: > i have a regex: rx_test = re.compile('/x([^x])*x/') You probably want... rx_test = re.compile('/x([^x]*)x/') - Josiah -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's handling of unicode surrogates

2007-04-21 Thread Josiah Carlson
On Apr 20, 7:34 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Apr 20, 6:21 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > > I don't believe this specific variant has been discussed. > > Now that you clarify it: no, it hasn't been discussed. I find that > > not surprising - this proposal

ANN: PyPE 2.8.5

2007-04-06 Thread Josiah Carlson
7;s home on the web: http://pype.sf.net/index.shtml If you have any questions about PyPE, please contact me, Josiah Carlson, aka the author of PyPE, at jcarlson at uci.edu (remember to include "PyPE" in the subject). PyPE 2.8.5 includes the following changes and bugfixes since re

where the hell is the run command of PyPe editor?

2006-11-02 Thread Josiah Carlson
daniel <[EMAIL PROTECTED]> wrote: > I'm trying to use PyPe, but I just got so frustrated when attempting to > run a script, this is the very first feature I would use for an editor, > OMG. I browsed through every single menu item and gave up... > > any help would be appreciated, (the most silly

Re: [wxPython-users] Re:

2006-10-25 Thread Josiah Carlson
nes.html . It would allow you to do all of your GUI manipulation/updating in Python without having to worry about locks or calling Python code from C. - Josiah > --- Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > > Gabriel Genellina <[EMAIL PROTEC

Re: [wxPython-users] Re:

2006-10-24 Thread Josiah Carlson
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Tuesday 24/10/2006 23:25, Michael S wrote: > > >I extended part of my program in C, since that part > >was too involved for Python. Now when I import the > >module I created and call its functions, I am trying > >to feedback some information bac t

Re: compiling python (or ironpython) to .exe or .dll for or not for .NET

2006-06-29 Thread josiah . carlson
per9000 wrote: > Update: > > I have found a holy handgrenade. > > I found something that seems to work fine for me - I've only tried it > for 5 minutes but seems to work very smoothly. Open-source, Mozilla > license, you know the drill... > > http://www.py2exe.org/ > > py2exe (the name makes me fa

sys.settrace() and Python 2.3

2006-06-28 Thread Josiah Carlson
According to my reading of Python 2.3 docs, the call to goo() at the end should exit with a KeyboardInterrupt... import sys def goo(): while 1: pass count = [100] def foo(frame, event, arg): count[0] -= 1 if not count[0]: raise Key

  1   2   >