Re: Are ABCs an anti-pattern?

2012-10-05 Thread Trent Nelson
On Tue, Oct 02, 2012 at 07:23:05AM -0700, Demian Brecht wrote: > I don't use them anymore, but I'm curious about others opinions on this > list... I like them. In particular, I like that I can enumerate all the subclasses that happen to implement the ABC via the metaclass's __subclas

Re: Python presentations

2012-09-18 Thread Trent Nelson
On Thu, Sep 13, 2012 at 09:00:19AM -0700, andrea crotti wrote: > I have to give a couple of Python presentations in the next weeks, and > I'm still thinking what is the best approach. > > In one presentation for example I will present decorators and context > managers, and my biggest doubt is how

RE: Coolest Python recipe of all time

2011-05-09 Thread Trent Nelson
> What are your favorites? I think I've posted this before, but I love my 3-lines-if-you-ignore-the-scaffolding language translator. Not because it's clever code -- quite the opposite, the code is dead simple -- but because it encompasses one of the things I love about Python the most: it gets

Re: Financial time series data

2010-09-03 Thread Trent Nelson
On 03-Sep-10 1:48 PM, Frederic Rentsch wrote: And do let us know if you get an answer from Yahoo. Hacks like this are unreliable. They fail almost certainly the next time a page gets redesigned, which can be any time. Indeed -- see my other post (regarding ystockquote.py). There's a CSV

Re: Financial time series data

2010-09-03 Thread Trent Nelson
On 03-Sep-10 7:29 AM, Virgil Stokes wrote: A more direct question on accessing stock information from Yahoo. First, use your browser to go to: http://finance.yahoo.com/q/cp?s=%5EGSPC+Components Now, you see the first 50 rows of a 500 row table of information on S&P 500 index. You can LM click

Re: Why list comprehension faster than for loop?

2010-05-09 Thread Trent Nelson
On 9 May 2010, at 16:29, Xavier Ho wrote: On Sun, May 9, 2010 at 6:20 PM, gopi krishna mailto:dasarathulag...@gmail.com>> wrote: Why list comprehension faster than for loop? Because Python optimises for certain special cases, when the number of iterations is predicable in a list comprehension.

RE: Django as exemplary design

2010-05-06 Thread Trent Nelson
> I'm interested in improving my python design by studying a large, > well-designed codebase. I'll tell you one of the best ways to improve your Python code: attend one of Raymond Hettinger's Code Clinic workshops at a Python conference and put some up of your work up on the projector for 20+ deve

Re: Can anyone suggest a good crypto package?

2008-09-04 Thread Trent Nelson
On Thu, Sep 04, 2008 at 11:39:42AM -0700, Fett wrote: > I need a crypto package that works on windows with python 2.5. Can > anyone suggest one for me? You could always rely on the the APIs Windows provides to do this sort out stuff, either via pywin32 or ctypes. Trent. -- h

REMINDER: Python Sprint Weekend This Weekend!

2008-05-07 Thread Trent Nelson
Just a friendly reminder that this weekend is the Python sprint weekend! Look forward to seeing everyone on #python-dev irc.freenode.net over the course of the weekend! Trent. On 16 Apr, 18:52, Trent Nelson wrote: > >Following on from the success of previous sprint/bugfix we

RE: Python development tools

2008-04-23 Thread Trent Nelson
> Are there any completely free developent tools for python > scripts like IDLE. I have used IDLE , but I want to try out > others also. I saw stuff like PyCrust, but I don't see that > it can run the script as well. > Thanks, Ignoring the 'free' part of your question, I've recently moved from Py

RE: Python script to automate use of Google Translate? (or other translator)

2008-04-22 Thread Trent Nelson
> > I have the need to occasionally translate a single word > > programatically. Would anyone have a Python script that > > would let me do this using Google (or another) translation > > service? As a matter of fact, yes, I do! This happens to be my most favourite piece of Python code I've ever

Global Python Sprint Weekends: May 10th-11th and June 21st-22nd.

2008-04-16 Thread Trent Nelson
Following on from the success of previous sprint/bugfix weekends and sprinting efforts at PyCon 2008, I'd like to propose the next two Global Python Sprint Weekends take place on the following dates: * May 10th-11th (four days after 2.6a3 and 3.0a5 are released) * June

RE: Randall Munroe loves Python

2008-04-11 Thread Trent Nelson
> Another xkcd plug for Python: http://xkcd.com/409/ Damn it. There goes another 40 minutes of my life magically whisked away by that more-addictive-than-crack 'RANDOM' button. -- http://mail.python.org/mailman/listinfo/python-list

RE: Google App Engine

2008-04-08 Thread Trent Nelson
> But people will always prefer complaining on the grounds of > insufficient information to keeping quiet on the basis of knowledge. +1 QOTW! -- http://mail.python.org/mailman/listinfo/python-list

RE: calling a function from string

2007-10-22 Thread Trent Nelson
> i have a function that I could like to call, but to make it more > dynamic I am constructing a string first that could equivalent to the > name of the function I wish to call. how could I do that? the string > could might include name of the module. > > for example > > a_string = 'datetime.' +

RE: a question about decorator

2007-10-22 Thread Trent Nelson
> def A(): > print 'warp in A' > def why(self, *arg, **kw): > print 'in A' > print self > print arg > print kw > #self(*arg, **kw) > > return why > > class T(object): > @A() > def test(g, out): >