Re: OT: Entitlements [was Re: Python usage numbers]

2012-02-14 Thread Tim Wintle
(Sorry for top-posting this bit, but I think it's required before the rest of my response) At the risk of wading into this from a UK citizen's perspective: You're imagining a public healthcare system as if it were private. Imagine you go to a doctor and say "I've got the flu, can you give me ant

Re: Python math is off by .000000000000045

2012-02-25 Thread Tim Wintle
On Sat, 2012-02-25 at 09:56 -0800, Tobiah wrote: > > For every floating point > > number there is a corresponding real number, but 0% of real numbers > > can be represented exactly by floating point numbers. > > It seems to me that there are a great many real numbers that can be > represented

Re: Python Gotcha's?

2012-04-05 Thread Tim Wintle
On Thu, 2012-04-05 at 12:00 +, Steven D'Aprano wrote: > The reason this is a Gotcha rather than a bug is because the JSON > standard specifies the behaviour (probably in order to be compatible with > Javascript). It's not to be compatible with javascript (you can use either in javascript) I

Re: Half-baked idea: list comprehensions with "while"

2012-04-27 Thread Tim Wintle
On Fri, 2012-04-27 at 19:57 +1000, Chris Angelico wrote: > On Fri, Apr 27, 2012 at 7:49 PM, Miles Rout wrote: > > We have if inside list comprehensions? I didn't know that, could you provide > > an example? > > You mean like: > > [x*2+1 for x in range(10) if x%3] Or like: >>> print [ 0 if b%2=

Re: John Carmack glorifying functional programing in 3k words

2012-05-02 Thread Tim Wintle
On Wed, 2012-05-02 at 17:31 +0200, Tomasz Rola wrote: > positive aura drives more people and more permamently towards you. Perhaps he > should > develop an alter ego that could stand side by side with Dalai Lama and see > which one gets more attention. Really?

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-08 Thread Tim Wintle
On Tue, 2012-05-08 at 15:20 +1000, Chris Angelico wrote: > I hope that pyjamas can be restored at some point to a single live > project. Whether that's headed by Luke Leighton or C Anthony Risinger > (neither of whom I know at all and thus I can't speak to either's > merits) or someone else, I don'

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-15 Thread Tim Wintle
On Tue, 2012-05-15 at 12:39 +0200, Pascal Chambon wrote: > believe me all this fuss is pitiful compared to the real harm that was > done numerous time to willing newcomers, on pyjs' old ML, when they > weren't aware about the heavy dogmas lying around. > > A demo sample (I quote it each time the

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-06 Thread Tim Wintle
On Wed, 2012-06-06 at 12:03 +0200, Ulrich Eckhardt wrote: > "block else for other cases" - this sounds as if it was blocking the > else. Maybe "else-block for other cases", I would say "else block". "else-block" is grammatically correct too, but I don't think I've seen it used regularly. RE: the

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-07 Thread Tim Wintle
On Wed, 2012-06-06 at 16:56 -0400, Jerry Hill wrote: > For what it's worth, I've never seen either of those constructs ("see > overleaf" and "see over"). Are they perhaps more common in a > particular academic context, or possibly more common in places that > use "British English" spellings rather

Re: Unit test failing please help

2011-08-26 Thread Tim Wintle
On Fri, 2011-08-26 at 08:35 -0700, lblake wrote: > Hi I am new to python I am at bit lost as to why my unit test is > failing below is the code and the unit test: > > class Centipede(object): > legs, stomach This doesn't do what you think it does. "legs, stomach" is a statement and is not de

Re: why memoizing is faster

2011-03-25 Thread Tim Wintle
On Fri, 2011-03-25 at 09:49 +0100, Andrea Crotti wrote: > Terry Reedy writes: > > > > For the reason Stefan explained and hinted above. Try the following instead: > > > > def fib_iter(n, _cache = [1,1]): > > k = len(_cache) > > if n >= k: > > for i in range(k, n+1): > >_cache.appen

Re: Non-deterministic output

2011-03-28 Thread Tim Wintle
On Mon, 2011-03-28 at 12:42 +0200, Esben Nielsen wrote: > We are making a prototype program in Python. I discovered the output was > non-deterministic, i.e. I rerun the program on the same input files and > get different output files. We do not use any random calls, nor > threading. > > One of us

Re: Fun python 3.2 one-liner

2011-04-05 Thread Tim Wintle
gt; want to limit him/herself to 80 characters in 2011? I'd rather have two files open with 80 columns in them than a single file with 160 columns and have to switch between files. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about GIL and web services from a n00b

2011-04-15 Thread Tim Wintle
rallel *processes* as you have cores/CPUs (assuming you're designing an application that can have multiple instances running in parallel so that you can run over multiple servers anyway). Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: The python implementation of the "relationships between classes".

2011-11-10 Thread Tim Wintle
On Thu, 2011-11-10 at 22:25 +0800, Jerry Zhang wrote: > > > 2011/11/10 Chris Angelico > On Fri, Nov 11, 2011 at 12:58 AM, Jerry Zhang > wrote: > > Cls_a: > > def __init__(self): > > self.at1 = 1 > > Cls_b: > > def __init__(

Re: Use and usefulness of the as syntax

2011-11-12 Thread Tim Wintle
On Sat, 2011-11-12 at 12:56 +0100, candide wrote: > So what is the pragmatics of the as syntax ? Another case: try: import json except: import simplejson as json (same goes for several modules where the C implementation may or may not be available) Tim -- http://mail.python.org/mail

Re: can't decompress data; zlib not available

2011-11-13 Thread Tim Wintle
oks like you need python2.6 I've never had a missing zlib module - but it's possible that it might be missing if you don't have the zlib/deflate headers installed - if they're not available then I'd try installing them and then reinstalling the package you started with. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: can't decompress data; zlib not available

2011-11-14 Thread Tim Wintle
On Mon, 2011-11-14 at 12:30 -0700, Steve Edlefsen wrote: > I did a search on files named "python" on my machine. > There are 23 not including the ones in the Plone > buildout-cache in my account. Seems like a lot of > applications install their own copy of python. > > There are also > > ./usr/li

Re: Make a small function thread safe

2011-12-16 Thread Tim Wintle
On Fri, 2011-12-16 at 05:21 -0800, Brad Tilley wrote: > 107 void increment_counter( unsigned int& counter ) > 108 { > 109 boost::mutex::scoped_lock lock( counter_lock ); > 110 ++counter; > 111 } with counter_lock: counter += 1 ... wher

Re: Make a small function thread safe

2011-12-16 Thread Tim Wintle
On Fri, 2011-12-16 at 09:24 -0500, Brad Tilley wrote: > So something like this then: > > import threading > > shared_container = [] > lock = threading.Lock() > > class thread_example( threading.Thread ): > > def __init__( self ): > threading.Thread.__init__ (self) > > def run(t

Re: python philosophical question - strong vs duck typing

2012-01-04 Thread Tim Wintle
ative code. > I am just thinking in my brain about the differences between cpp and > python, and if there is a way to compromise a bit on the python-ness > to get closer to cpp, but still be able to keep a lot of the goodness, > then put in a translator or converter to cpp and gain performance by > using cpp code. Sounds like Rpython, cython, shedskin are doing a lot > or all of this, so lots to study up on. Yup Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: How to support a non-standard encoding?

2012-01-06 Thread Tim Wintle
On Fri, 2012-01-06 at 10:03 +, Ivan wrote: > Dear All > > I'm developing a python application for which I need to support a > non-standard character encoding (specifically ISO 6937/2-1983, Addendum > 1-1989). If your system version of iconv contains that encoding (mine does) then you could

Re: How to support a non-standard encoding?

2012-01-06 Thread Tim Wintle
On Fri, 2012-01-06 at 12:00 -0800, jmfauth wrote: > The distibution of such a codec may be a problem. There is a register_codec method (or similar) in the codecs module. Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: replacing __dict__ with an OrderedDict

2012-01-10 Thread Tim Wintle
On Tue, 2012-01-10 at 09:05 -0500, Roy Smith wrote: > > I guess MongoDB is not a serious database? That's opening up a can of worms ;) ... anyway, cassandra is far better. Tim -- http://mail.python.org/mailman/listinfo/python-list

thread. question

2009-02-09 Thread Tim Wintle
(assuming they very infrequently block)? Since if you use the thread module direct the code doesn't seem to escape from C during the acquire() etc. or am I missing something important? Thanks, Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: thread. question

2009-02-09 Thread Tim Wintle
Thanks for both replies, On Mon, 2009-02-09 at 15:59 +0100, Christian Heimes wrote: > You shouldn't use the thread module directly. It's not meant to be used > by a user. Please stick to the threading module. You won't notice a > slowdown, trust me :) I'm aware that thread is being renamed to _thr

Re: thread. question

2009-02-13 Thread Tim Wintle
On Mon, 2009-02-09 at 21:02 +0100, Christian Heimes wrote: > The module was renamed to _thread to stop people from using it directly. > The extension module is the interface to some low level types and > functions. Especially the usage of thread.start_new_thread is > problematic, since it bypasses

Re: Module to read/write MIDI ?

2009-02-16 Thread Tim Wintle
> I had my first look around pypi.python.org/pypi yesterday and didn't > see anything. Is there a MIDI-module for Python ? If not, I'll > email Sean to ask if he'd mind me translating his module into Python3... This is the only project I have seen

Re: Speedup Bitmap Parser

2009-02-17 Thread Tim Wintle
on is often better left to C (or compiled extensions to python in Cython etc.) than done in Python - it's just too tough to do pointer-magic in Python. You may find that so much time is being spent by your application in the ".create_line" method that there's no other opti

Re: memory recycling/garbage collecting problem

2009-02-17 Thread Tim Wintle
On Tue, 2009-02-17 at 00:40 -0800, Chris Rebert wrote: > > > > 'gc.collect()' -- I believe, but I'm not the specialist in it. > > If I understand correctly, that only effects objects that are part of > a reference cycle and doesn't necessarily force the freed memory to be > released to the OS. I

Re: memory recycling/garbage collecting problem

2009-02-18 Thread Tim Wintle
On Tue, 2009-02-17 at 17:04 +0100, Christian Heimes wrote: > Tim Wintle wrote: > > Basically malloc() and free() are computationally expensive, so Python > > tries to call them as little as possible - but it's quite clever at > > knowing what to do - e.g. if a list ha

Re: Searching Google?

2009-02-18 Thread Tim Wintle
On Wed, 2009-02-18 at 13:36 +0100, Johannes Bauer wrote: > Curt Hash schrieb: > > > You just need to change your User-Agent so that Google doesn't know a > > Python script is making the request: > > Why would Google not send a response if the User-Agent header field is > not a recognized browser?

Re: Revision Control

2009-02-18 Thread Tim Wintle
On Wed, 2009-02-18 at 09:08 -0800, Sam Clark wrote: > Any suggestions for a beginer on what to use for version control? > It's just me, the lone person programming. I've already nailed one > "version" of my code accidentaly. MS VSS is too expensive for the > stuff I'm doing, plus I really don't l

os.fdopen giving "Invalid Argument" from pipes

2009-02-19 Thread Tim Wintle
Was wondering if someone could point out what the stupid thing I'm doing wrong is: {{{ import os, time def run_multi_proc(): server_send, logger_recieve = os.pipe() pid = os.fork() if pid == 0: # we are the logger #os.close(server_send) logger_recieve = os.fdop

Re: os.fdopen giving "Invalid Argument" from pipes

2009-02-19 Thread Tim Wintle
On Thu, 2009-02-19 at 11:50 -0500, Jean-Paul Calderone wrote: > You got server_send and logger_receive backwards Doh! > (also, i before e *except* after c et cetera). Flip 'em around and > all is well. Thanks - never was great at speling :-) Tim -- http://mail.python.org/mailman/listinfo/pyt

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Wintle
e in Python. Yes, we're coming to a point where we're going to have tens of cores in a chip, but by that time someone far cleverer than me (possibly someone who's on this list) will have solved that problem. The top experts in many fields use Python, and if they weren'

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Wintle
mounts of code into my 4mb level-2 cache *on my laptop*! That's a huge impact for numerical work. (3) Multiple cores scale processing power linearly at best with the number of cores (since you're normally going to be IO based at some point). Perhaps the GIL will be relaxed a bit, but it&#x

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Tim Wintle
On Fri, 2009-02-20 at 16:38 +, Nigel Rantor wrote: > Luke Dunn wrote: That was my initial thought when I read this too - but I'm not certain that is guaranteed to find a solution (i.e. a solution that's optimal). I'd welcome a proof that it will though, a few minutes thought hasn't found a

Re: Forwarding keyword arguments from one function to another

2009-02-22 Thread Tim Wintle
g the parameter "string" as the first parameter, and then a sequence of keyword arguments taken from kwds, which will be passed separately. This is what the second form expects, but not what the first one expects. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python shell scripting and errors

2009-02-23 Thread Tim Wintle
On Mon, 2009-02-23 at 09:12 -0800, Phillip B Oldham wrote: > I've got a python script running as a daemon (using someone else's > daemon module). It runs fine for a while, but will occasionally balk > and die. Since its running in the background, I'm getting no error > from it. > > What's the best

Re: Challenge: Please break this! [Python Security]

2009-02-23 Thread Tim Wintle
,"w") f.write("oops") f.close() > Dinner and drinks on me for an evening -- when you are next in London > or I am in your town -- to the first person who manages to break > safelite.py and write to the filesystem. I'm in London on Wednesday ;-) Unfortunately I

Re: Challenge: Please break this! [Python Security]

2009-02-23 Thread Tim Wintle
On Mon, 2009-02-23 at 13:20 -0800, Paul McNett wrote: > tav wrote: > > I'm keen to know your experiences even if you don't manage to write to > > the filesystem -- and especially if you do! > > Does it count when it breaks some standard libs that aren't even trying to > write to > the filesystem

Re: more on unescaping escapes

2009-02-23 Thread Tim Wintle
ngs in the interpreter it includes escape characters, when it is printed though the output is straight to stdout and isn't escaped. Hope that helps, Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Run a python script as an exe and run a new process from it

2009-02-26 Thread Tim Wintle
On Thu, 2009-02-26 at 04:55 -0800, venutaurus...@gmail.com wrote: > Hello all, >I've a strange requirement where I need to run a python > script just as we run an exe (by double clicking through windows > explorer or by typing the script name at command prompt). I don't know how windows

Re: Run a python script as an exe and run a new process from it

2009-02-26 Thread Tim Wintle
On Thu, 2009-02-26 at 06:00 -0800, venutaurus...@gmail.com wrote: > Thanks for the reply, >Being a newbie to python, I am finding it difficult to > understand the logic even after thorough reading of comments. Is there > any simpler way where I can just run a python script from the main

Re: best way to parse a function-call-like string?

2009-02-26 Thread Tim Wintle
ot;, [] > "junkpkg.f1", ['aaa'] > "junkpkg.f1", ['aaa','bbb'] > "junkpkg.f1", ['aaa','bbb','ccc'] > "junkpkg.f1", ['aaa','with,comma'] > quick and dirty for s in string_list: if "(" in s and s[-1] == ")": parts = s.split("(") fn, args = s[0],s[1][:-1].split(",") Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to parse a function-call-like string?

2009-02-26 Thread Tim Wintle
On Thu, 2009-02-26 at 21:39 +, Tim Wintle wrote: > On Thu, 2009-02-26 at 21:29 +, m...@pixar.com wrote: > > "junkpkg.f1", ['aaa','with,comma'] oops - missed this one, ignore my last reply. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle Problem

2009-03-03 Thread Tim Wintle
efines it) Exceptions are just classes, so you'll have to import and reference it like you'd reference any other class you import. Hope that helps Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Roulette wheel

2009-03-04 Thread Tim Wintle
On Wed, 2009-03-04 at 18:02 +, mattia wrote: > ri = randint(0, len(rw) - 1) > print("Random index:", rw[ri], ", value:", pop[rw[ri]]) you probably want random.choice(rw) -- http://mail.python.org/mailman/listinfo/python-list

Re: Can Python do shopping cart?

2009-03-06 Thread Tim Wintle
d a wrapper to files on disk - then it's just your OS's limits that hold it back - so python is turing/register complete. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: strings for beginers

2009-03-07 Thread Tim Wintle
On Sat, 2009-03-07 at 12:53 -0800, Sapote wrote: > I have an incrementing variable disc_num that I could insert in the > line below to create discspanisoX.iso where X is incrementing... > > burn_cmd = "mkisofs -udf -o /home/donkey/discspaniso.iso -graft- > points --path-list %s" %(temp_list)

Re: strings for beginers

2009-03-07 Thread Tim Wintle
On Sat, 2009-03-07 at 21:25 +, Tim Wintle wrote: > burn_cmd = "mkisofs -udf -o /home/donkey/discspaniso%d.iso > -graft-points --path-list %s" %(x,temp_list) obviously I meant to say burn_cmd = "mkisofs -udf -o /home/donkey/discspaniso% d.iso-graft-points --pat

Re: Themed TK (tk Tile) at last?!

2009-03-07 Thread Tim Wintle
Gtk? > Good job python-dev team. And especially Guilherme Polo for doing all the tough work as far as I tell from the issue and the commit logs. Am I right this was a Google Summer of Code project? If so then thanks to Google as well for sponsoring it. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: should i move on to python3

2009-03-07 Thread Tim Wintle
#x27;s JVM for 6 and 5, and IBM's JDK for Java 5 all running. Similarly, on various machines I use CPython 2.3, 2.4, 2.5, 2.6 and Jython 2.2 for various reasons - and I'm certainly planning on using PyPy a large amount once it's stable. I used the Beta of 3.0, but to be honest I ha

Re: Is there a better way of doing this?

2009-03-07 Thread Tim Wintle
(obviously doesn't change how "environmentally harmful" something is) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Chandler, Python, speed

2009-03-08 Thread Tim Wintle
've got is the long shutdown times, which is caused by backing up a copy of _Everything_ to disk, so that upgrades can happen cleanly - sure that's going to be fixed though. Startup time is a bit slow too, but it's designed to be left open all the time, and it's fairly zippy once it&#

Re: Is python worth learning as a second language?

2009-03-09 Thread Tim Wintle
On Mon, 2009-03-09 at 11:19 +, Lie Ryan wrote: > Certainly. A programmer that only knows one language would be too > limited. Try as many programming language as you can, and especially > look for programming languages that have "obscenely different" paradigm > than the language you already

Re: Ban Xah Lee

2009-03-10 Thread Tim Wintle
On Mon, 2009-03-09 at 21:28 -0700, Luis Gonzalez wrote: > C'mon guys, Xha Lee always wins, because fools like you get mad at him > instead of ignoring him. Here here! -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory efficient tuple storage

2009-03-13 Thread Tim Wintle
in my_file: chromosome = reference_dict.setdefault(chromosome,chromosome) list_of_coordinates.append((chromosome,posn)) (or something like that) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Style question - defining immutable class data members

2009-03-15 Thread Tim Wintle
On Sun, 2009-03-15 at 10:39 -0700, John Posner wrote: > (My apologies if the thread has already covered this.) I believe I understand > the WHAT in this situation, but I don't understand the WHY ... > Is there a beneficial effect of silently creating the instance attribute, > which outweighs the

Re: Style question - defining immutable class data members

2009-03-15 Thread Tim Wintle
On Mon, 2009-03-16 at 04:02 +, Tim Wintle wrote: > On Sun, 2009-03-15 at 10:39 -0700, John Posner wrote: Doh, reply out of thread there - I meant to reply to Rhodi's comment further down. > Is there any actual advantage to self.attribute picking up > Class.attribute instea

Re: Run on Startup

2009-03-18 Thread Tim Wintle
On Wed, 2009-03-18 at 11:13 -0700, Mike Driscoll wrote: > On Mar 18, 1:09 am, "Gabriel Genellina" > > Any decent installer is able to register a program so it runs on startup > > (InnoSetup, by example). Anyway, if you want to it it yourself, > > see:http://msdn.microsoft.com/en-us/library/bb77

Re: Another of those "is" issues.

2009-03-20 Thread Tim Wintle
ict__["myMethod"], and when it hasn't found it it creates a new function which wraps the call to the base class up correctly. It's more complicated than this though because you see the same behaviour when checking the method on the class definition. Seem to remember Raymon

Re: pygame and socket.recv

2009-04-01 Thread Tim Wintle
lly simple algorithm - both machines send each other their local [game] time every few seconds, and if the received time is ahead of the local time then the receiving machine updates it's time to match - that way they are always out by at most the shortest time it takes for a packet to travel from

Re: pygame and socket.recv

2009-04-02 Thread Tim Wintle
On Wed, 2009-04-01 at 18:45 -0700, Aaron Brady wrote: > > My game loop looks like this: > > poll events, get 1 at most > send to server > wait for server reply > render entire frame The look I'm suggesting is: poll events write to (non-blocking) socket render frame check non-blocking socket and

Re: python for loop

2009-04-02 Thread Tim Wintle
On Thu, 2009-04-02 at 06:28 +, Steven D'Aprano wrote: > In set theory, you start by defining the integers like this: > > 0 = len( {} ) > 1 = len( {{}} ) > 2 = len( {{}, {{}}} ) > 3 = len( {{}, {{}}, {{}, {{}}} ) > etc. not quite len() - surely you mean something like "any object along with an

Re: pygame and socket.recv

2009-04-02 Thread Tim Wintle
On Thu, 2009-04-02 at 06:50 -0700, Aaron Brady wrote: > It's just that if you register a collision in between the time that > one object has changed its position and momentum, and the time you > learn about it, you have to retroactively edit the collision, restore > hit points, and recalculate the

Re: python for loop

2009-04-02 Thread Tim Wintle
On Thu, 2009-04-02 at 15:16 -0700, Emile van Sebille wrote: > Lou Pecora wrote: > > Confusion only comes when you try to force the > > defintion of one of them on the other and then say it's illogical or not > > natural. Both are natural. > > Consider the French 'Premiere etage' vs the American

Re: python needs leaning stuff from other language

2009-04-03 Thread Tim Wintle
On Fri, 2009-04-03 at 13:12 -0400, Mel wrote: > >>> I think it would also be better to have One (and prefereably Only One) > >>> Obvious Way To Do It. That obvious way, for those who work with > >>> Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to have > >>> ‘list’ conform with this

Re: python needs leaning stuff from other language

2009-04-03 Thread Tim Wintle
antic value function (in 1st order language terms), although I understand that it is sometimes unavoidable in real life. For example, this makes me question the orthogonality of "ordered" and "collection" with semantics dictated by their methods/features. Proposing that the object: my

Re: is there a way to collect twitts with python?

2009-04-03 Thread Tim Wintle
s to love that thing (twitter), and I still can't work out why (apart from hacks such as using it as a hosted queue for cross-server comms, or receiving cheap sms to your app) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing dynamic languages

2009-04-04 Thread Tim Wintle
On Sat, 2009-04-04 at 06:37 -0700, grkunt...@gmail.com wrote: > If I am writing in Python, since it is dynamically, but strongly > typed, I really should check that each parameter is of the expected > type, or at least can respond to the method I plan on calling ("duck" > typing). Every call should

Re: python needs leaning stuff from other language

2009-04-04 Thread Tim Wintle
On Sat, 2009-04-04 at 02:03 -0500, Robert Kern wrote: > > Let's be clear: python-ideas seems positive on the idea of adding a .clear() > method. *Completely removing* slice assignment has not been broached there. Yup, sorry - I did mean to refer to the initial suggestion, rather than my comments

Re: python needs leaning stuff from other language

2009-04-05 Thread Tim Wintle
On Sat, 2009-04-04 at 15:36 -0500, Robert Kern wrote: > On 2009-04-04 12:07, Tim Wintle wrote: > >>> (I didn't expect such strong responses btw!) > >> You are proposing the removal of a general, orthogonal feature (and > >> breaking > >> code in c

Re: binary file compare...

2009-04-17 Thread Tim Wintle
ic algorithm anyway, which is fine if you're ok with that, but for mission critical software it's crazy. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Too early implementation

2009-04-18 Thread Tim Wintle
and approached the problem from various angles ;-) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] large db question about no joins

2009-04-18 Thread Tim Wintle
ic. (I'm a relational database user btw, but it seems to happen with object database people too - we get so used to our own paradigm that we don't think about other ways of doing the task) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Tim Wintle
that I feel jump is more than justified in some situations (when it's jumping to within 10-20 lines of the start position, and it's a routine that needs to be highly optimised - I'm thinking tail recursion etc.) (btw, how come nobody has mentioned python bytecode? Most flow control is

Re: Is there a programming language that is combination of Python and Basic?

2009-04-19 Thread Tim Wintle
On Sun, 2009-04-19 at 06:26 +, Steven D'Aprano wrote: > > (btw, how come nobody has mentioned python bytecode? Most flow > control is jumps) > > > I wrote yesterday: > > "GOTO, after all, is just a jump, and we use jumps in Python all the > time: > > raise Exception > break > continue > if.

Re: Python interpreter speed

2009-04-20 Thread Tim Wintle
ticed) You'll also probably notice that many of python's types (list, dict, etc.) might be slower for small sizes than Java's are - that's because they have been optimised to perform efficiently at any size, at the expense of being slightly less efficient than they could be for small sizes) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: The Python standard library and PEP8

2009-04-20 Thread Tim Wintle
On Sun, 2009-04-19 at 18:43 +0200, Emmanuel Surleau wrote: > Hi there, > > Exploring the Python standard library, I was surprised to see that several > packages (ConfigParser, logging...) use mixed case for methods all over the > place. I assume that they were written back when the Python stylin

Re: Self function

2009-05-04 Thread Tim Wintle
On Mon, 2009-05-04 at 19:51 +0100, Arnaud Delobelle wrote: > > Bearophile, there is a thread on python-ideas about tail-call > optimization at the moment. Oooh - haven't noticed that (and don't have time to follow it), but has anyone seen the results I got a week or so ago from briefly playing wi

Re: While Statement

2009-05-22 Thread Tim Wintle
On Fri, 2009-05-22 at 13:19 +0200, Andre Engels wrote: > number/total = 998/999 = 0 > number/total*100 = 0*100 = 0 > float(number/total*100) = float(0) = 0.0 > > Change "float(number/total*100)" to "float(number)/total*100" and it > should work: I'd use: (number * 100.)/total - works because

Re: python question

2009-05-22 Thread Tim Wintle
On Fri, 2009-05-22 at 05:51 -0700, Craig wrote: > I use python 2.6.2 and i useing ubuntu 9.04 not windows. What are you trying to install? is it available in Synaptic package manager? If it's a program written in python, then there may be a file called "setup.py". If there is then open a termin

Re: While Statement

2009-05-22 Thread Tim Wintle
On Fri, 2009-05-22 at 09:59 -0400, Dave Angel wrote: > > Tim Wintle wrote: > > On Fri, 2009-05-22 at 13:19 +0200, Andre Engels wrote: > >> Change "float(number/total*100)" to "float(number)/total*100" and it > >> should work: > &g

Re: why do I get this behavior from a while loop?

2009-11-27 Thread Tim Wintle
On Fri, 2009-11-27 at 17:06 +0100, S. Chris Colbert wrote: > This seems strange to me, but perhaps I am just missing something: > I would think that second loop should terminate at 9.9, no? > > I am missing something fundamental? Floating points variables ... http://en.wikipedia.org/wiki/Floati

Re: Recursion head scratcher

2009-12-02 Thread Tim Wintle
On Wed, 2009-12-02 at 02:07 -0500, Joel Madigan wrote: > > that it is possible to make it print the path to the finish in the > order the steps were taken. That is, the algorithm as written > produces: (4,0) (4,1) (3,1) (3,2) (3,3) (2,3) (1,3) (1,2) True > > Rather than (1,2) (1,3) (2,3) (3,3)

Re: Java-to-Python?

2009-12-18 Thread Tim Wintle
On Fri, 2009-12-18 at 15:44 +0100, Virgil Stokes wrote: > I have a rather large Java package for the analysis of networks that I > would like to convert to Python. Many of the classes in the Java package > are "Serializable". > > Any recommendations on Java-to-Python (2.6) would be appreciated.

Re: A way to convert RTF to HTML?

2009-12-27 Thread Tim Wintle
On Sun, 2009-12-27 at 20:10 +, Star Glider wrote: > the problem is that the one of the fields as text in rich text format, > and it needs to be display without the RTF markup, of course. > Is there any way to convert RTF to HTML? Depending on how precisely you need to lay it out you might fin

Re: ANN: Pymazon 0.1beta released.

2010-01-04 Thread Tim Wintle
On Tue, 2009-12-29 at 19:44 +0100, Chris Colbert wrote: > I'm happy to announce the first beta release of Pymazon: a Python > implemented alternative to the Amazon mp3 downloader. > > Pymazon was created specifically to alleviate the issues surrounding > the Linux version of the Amazon mp3 downlo

Re: SimpleXMLRPCServer daemon

2010-01-29 Thread Tim Wintle
On Fri, 2010-01-29 at 07:54 -0800, Thomas Allen wrote: > The second is that when it does crash, I don't know about it...what > would be sufficient as a "keep-alive" script to restart it? I suppose > I could use something like EventMachine (already installed on my > server) to watch the PID file if

Re: Skeletal animation

2009-10-06 Thread Tim Wintle
On Mon, 2009-10-05 at 18:36 +0200, Donn wrote: > see: http://www.panda3d.org/wiki/index.php/Attaching_an_Object_to_a_Joint +1 for Panda 3d. Their Node graph is very intuitive for animating joints, and Panda's API is very nice and clean. TimW -- http://mail.python.org/mailman/listinfo/python-li

Re: Object Relational Mappers are evil (a meditation)

2009-10-16 Thread Tim Wintle
On Fri, 2009-10-16 at 01:01 +0200, Mick Krippendorf wrote: > Maybe my English (and my memory) is just not so good. I'm german, and > here "abnormal" and "anormal" are both negations of "normal", but with > a slight difference in meaning. "anormal" means just "not normal", > whereas the meaning of "

Re: pointless musings on performance

2009-11-24 Thread Tim Wintle
On Tue, 2009-11-24 at 18:25 +, Antoine Pitrou wrote: > Le Tue, 24 Nov 2009 08:58:40 -0800, Paul Boddie a écrit : > > As you > > point out, a lot of this RISC vs. CISC analysis (and inferences > drawn > > from Python bytecode analysis) is somewhat academic: the cost of the > > JUMP_IF_FALSE inst

Re: taking python enterprise level?...

2010-02-25 Thread Tim Wintle
On Thu, 2010-02-25 at 02:26 -0800, simn_stv wrote: > i plan to build an application, a network based application that i > estimate (and seriously hope) would get as many as 100, 000 hits a day > (hehe,...my dad always told me to 'AIM HIGH' ;0), not some 'facebook' > or anything like it, its mainly

Re: taking python enterprise level?...

2010-03-03 Thread Tim Wintle
On Wed, 2010-03-03 at 17:26 +0100, mk wrote: > > So there *may* be some evidence that joins are indeed bad in > practice. > If someone has smth specific/interesting on the subject, please post. I have found joins to cause problems in a few cases - I'm talking about relatively large tables though

Re: taking python enterprise level?...

2010-03-04 Thread Tim Wintle
On Wed, 2010-03-03 at 20:39 +0100, mk wrote: > Hello Tim, > > Pardon the questions but I haven't had the need to use denormalization > yet, so: > IOW you basically merged the tables like follows? > > CREATE TABLE projects ( > client_id BIGINT NOT NULL, > project_id BIGINT NOT NULL, >

Re: taking python enterprise level?...

2010-03-04 Thread Tim Wintle
On Wed, 2010-03-03 at 16:23 -0500, D'Arcy J.M. Cain wrote: > On Wed, 03 Mar 2010 20:39:35 +0100 > mk wrote: > > > If you denormalise the table, and update the first index to be on > > > (client_id, project_id, date) it can end up running far more quickly - > > Maybe. Don't start with denormaliza

Re: Evaluate my first python script, please

2010-03-05 Thread Tim Wintle
On Thu, 2010-03-04 at 10:39 -0800, Pete Emerson wrote: > I am looking for advice along the lines of "an easier way to do this" > or "a more python way" (I'm sure that's asking for trouble!) or > "people commonly do this instead" or "here's a slick trick" or "oh, > interesting, here's my version to

Re: Evaluate my first python script, please

2010-03-05 Thread Tim Wintle
On Fri, 2010-03-05 at 07:53 -0800, Pete Emerson wrote: > Thanks for your response, further questions inline. > > On Mar 4, 11:07 am, Tim Wintle wrote: > > On Thu, 2010-03-04 at 10:39 -0800, Pete Emerson wrote: > > > I am looking for advice along the lines of "an ea

  1   2   >