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 than

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 order -

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: 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't

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: 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 miles.r...@gmail.com 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 [

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: 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 exactly

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

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

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 use

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: python philosophical question - strong vs duck typing

2012-01-04 Thread Tim Wintle
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: 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 ... where

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: 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

Re: can't decompress data; zlib not available

2011-11-13 Thread Tim Wintle
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: 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 --

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 ros...@gmail.com On Fri, Nov 11, 2011 at 12:58 AM, Jerry Zhang jerry.scofi...@gmail.com wrote: Cls_a: def __init__(self): self.at1 = 1 Cls_b:

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 defining

Re: Questions about GIL and web services from a n00b

2011-04-15 Thread Tim Wintle
(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: Fun python 3.2 one-liner

2011-04-05 Thread Tim Wintle
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: 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: why memoizing is faster

2011-03-25 Thread Tim Wintle
On Fri, 2011-03-25 at 09:49 +0100, Andrea Crotti wrote: Terry Reedy tjre...@udel.edu 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):

Re: Creating Long Lists

2011-02-23 Thread Tim Wintle
On Wed, 2011-02-23 at 13:57 +, Jorgen Grahn wrote: If that's the *only* such use, I'd experiment with writing them as sortable text to file, and run GNU sort (the Unix utility) on the file. It seems to have a clever file-backed sort algorithm. +1 - and experiment with the different flags

Re: Python fails on math

2011-02-22 Thread Tim Wintle
happening) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems of Symbol Congestion in Computer Languages

2011-02-21 Thread Tim Wintle
- although I suppose that if production never starts because the improvements are done to a spec, rather than the product, it would be a massive hindrance. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Use the Source Luke

2011-01-30 Thread Tim Wintle
with would feel comfortable reading C - so for the other half reading C source code probably isn't going to help them understand exactly what's going on (although in the long run it might help them a lot) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python documentation too difficult for beginners

2010-11-02 Thread Tim Wintle
On Tue, 2010-11-02 at 04:23 -0700, jk wrote: This (http://epydoc.sourceforge.net/stdlib/) is what I'm talking about. Aaaarrr Why aren't the official docs like this, Because not everyone likes documentation like that. Personally I far prefer the existing documentation to the

Re: ANN: stats 0.1a calculator statistics for Python

2010-10-18 Thread Tim Wintle
On Sun, 2010-10-17 at 17:10 +, Steven D'Aprano wrote: I am pleased to announce the first public release of stats for Python. http://pypi.python.org/pypi/stats Quick comment on your sum() function: http://docs.python.org/library/math.html#math.fsum (in 2.6 and above) should do the same

Re: Speed-up for loops

2010-09-03 Thread Tim Wintle
On Fri, 2010-09-03 at 08:52 +0200, Ulrich Eckhardt wrote: Tim Wintle wrote: [..] under the hood, cpython does something like this (in psudo-code) itterator = xrange(imax) while 1: next_attribute = itterator.next try: i = next_attribute() except: break

Re: Speed-up for loops

2010-09-02 Thread Tim Wintle
On Thu, 2010-09-02 at 12:02 +0200, Michael Kreim wrote: Hi, I was comparing the speed of a simple loop program between Matlab and Python. Unfortunately my Python Code was much slower and I do not understand why. The main reason is that, under the hood, cpython does something like this (in

Re: Speed-up for loops

2010-09-02 Thread Tim Wintle
On Thu, 2010-09-02 at 16:13 +0200, Roland Koebler wrote: Hi, Are there any ways to speed up the for/xrange loop? You can use psyco. Assuming you've got a 32-bit machine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is python not written in C++ ?

2010-08-02 Thread Tim Wintle
On Sun, 2010-08-01 at 20:01 -0400, Terry Reedy wrote: Not every C programmer knows or wants to learn C++. I think Terry is the only person that's mentioned this - but I'd like to give extra support to it - I for one prefer C to C++ (as someone that writes quite a lot of C extension modules).

Re: multitask http server (single-process multi-connection HTTP server)

2010-07-13 Thread Tim Wintle
On Mon, 2010-07-12 at 23:28 +, Luke Kenneth Casson Leighton wrote: On Mon, Jul 12, 2010 at 10:13 PM, geremy condra debat...@gmail.com wrote: On Mon, Jul 12, 2010 at 4:59 PM, lkcl luke.leigh...@gmail.com wrote: there probably exist perfectly good web frameworks that are capable of doing

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Tim Wintle
On Thu, 2010-06-24 at 21:52 -0500, Peng Yu wrote: http://psyco.sourceforge.net/ The above package can improve python program on 32 bit library. But I need to run on 64 bit library. Is there any other module that can help improving the performance of python on 64 bit? As I understand it,

Re: use python as a calculator

2010-06-24 Thread Tim Wintle
On Thu, 2010-06-24 at 09:33 -0700, ilovesss2004 wrote: On Jun 24, 5:50 pm, Tim Harig user...@ilthio.net wrote: On 2010-06-24, ilovesss2004 yyiillu...@gmail.com wrote: If I run 1.0/10**10 python will return 0 Python 2.6.4 (r264:75706, Dec 11 2009, 23:02:59) [GCC 3.4.6] on linux2

Re: Question about NNTPLib

2010-06-08 Thread Tim Wintle
On Tue, 2010-06-08 at 08:24 -0700, Anthony Papillion wrote: resp, count, first, last, name = server.group('comp.lang.python') resp, items = server.xover(first, last) for subject in items: resp, subject = server.xhdr('subject', first, last) print subject While the

Re: OT: Meaning of monkey

2010-03-26 Thread Tim Wintle
On Fri, 2010-03-26 at 12:08 -0400, Mel wrote: Somewhere on the Internet there's a particularly brilliant pop song called Code Monkey. http://www.jonathancoulton.com/2006/04/14/thing-a-week-29-code-monkey/ (he's linked to the mp3 from there) --

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: short-circuiting any/all ?

2010-03-22 Thread Tim Wintle
On Mon, 2010-03-22 at 14:45 +, kj wrote: I have a list of items L, and a test function is_invalid that checks the validity of each item. To check that there are no invalid items in L, I could check the value of any(map(is_invalid, L)). But this approach is suboptimal in the sense that, no

Re: Visual Python programming and decompilers?

2010-03-12 Thread Tim Wintle
On Thu, 2010-03-11 at 20:38 +0200, Ludolph wrote: I decided I can use byteplay3 http://pypi.python.org/pypi/byteplay/ to disassemble the code to workable objects, It even allows me to rebuild the objects to bytecode. So if I define patterns on how python interrupts the source code to

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 do the same

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 tim.win...@teamrubber.com wrote: 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

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, cost

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 mrk...@gmail.com 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

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-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 for

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 it

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 downloader

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 find

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. I

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) (3,2)

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: snip I would think that second loop should terminate at 9.9, no? I am missing something fundamental? Floating points variables ...

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 instruction

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 abnormal is

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 --

Re: Entry Level Python Jobs

2009-09-02 Thread Tim Wintle
On Wed, 2009-09-02 at 08:31 -0700, JonathanB wrote: I am a self-taught Python programmer with a liberal arts degree (Cross-cultural studies). I have been programming for several years now and would like to get a job as a python programmer. Unfortunately most of the job posts I have seen are

Re: Excel edit using python

2009-08-19 Thread Tim Wintle
/python-list/2009-June/716845.html Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: missing 'xor' Boolean operator

2009-07-15 Thread Tim Wintle
On Wed, 2009-07-15 at 02:02 -0700, Jonathan Gardner wrote: On Jul 14, 4:48 pm, Ethan Furman et...@stoneleaf.us wrote: A whole family of supers. :) All the things binary operators can do, Lisp does with 0, 1, 2, or more arguments. +1 n-ary operators are great, but binary operators are

Dict ordering [was: Re: MySQLdb and ordering of column names in list returned by keys() w/ a DictCursor]

2009-07-02 Thread Tim Wintle
On Thu, 2009-07-02 at 10:32 -0500, Wells Oliver wrote: for row in cursor.fetchall(): print row.keys() What I get is: ['league', 'BB', 'HR', 'IP', 'K', 'H', 'player_id', 'ER'] Neither alphabetical nor the order in which they were specified in the query nor... any seeming order I can

Re: No trees in the stdlib?

2009-06-29 Thread Tim Wintle
On Sat, 2009-06-27 at 06:03 +0100, João Valverde wrote: To answer the question of what I need the BSTs for, without getting into too many boring details it is to merge and sort IP blocklists, that is, large datasets of ranges in the form of (IP address, IP address, string). snip As an

Re: Pythonic way to overwrite a file

2009-06-18 Thread Tim Wintle
to kill the program half way through and found it had died half way through processing a file and lost my code! Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: command line of a process.exe on another host

2009-06-12 Thread Tim Wintle
On Thu, 2009-06-11 at 23:18 +0100, Harry wrote: HI , I have number of process run on different windows servers which run's with different command line parameters. for example process.exe -inputddd statusurl: http://sss.com ., These parameters can vary from host to host. using Psexec I know

Re: install older Python version parallel

2009-06-12 Thread Tim Wintle
On Fri, 2009-06-12 at 00:30 -0700, edexter wrote: I suspect you want to install python 2.4 and then reinstall 2.6 I did that in windows and I don't understand why it wouldn't work in linux It won't normally work on linux these days because most distributions of gnu/linux need python to run the

Re: unladen swallow: python and llvm

2009-06-08 Thread Tim Wintle
On Sun, 2009-06-07 at 16:40 -0600, Brian wrote: On Fri, Jun 5, 2009 at 3:29 AM, Nick Craig-Wood n...@craig-wood.com wrote: It is an interesting idea for a number of reasons, the main one as far as I'm concerned is that it is more of a port of CPython to a new

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 int *

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

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: I'd use: (number * 100.)/total - works because int * float

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 with

Re: Python interpreter speed

2009-04-20 Thread Tim Wintle
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 styling

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... elif...

Re: Too early implementation

2009-04-18 Thread Tim Wintle
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
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
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 jumps) Tim Wintle -- http

Re: binary file compare...

2009-04-17 Thread Tim Wintle
critical software it's crazy. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

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 consequence!) just because of a new syntax for a single special

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 be

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-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 also.

Re: python needs leaning stuff from other language

2009-04-03 Thread Tim Wintle
that the object: mylist[a:b:c] return an iterator that is non-assignable appears to fix this non-orthogonality as far as I can immediately see (although I am *very* tired, and haven't thought it through far enough!) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

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

2009-04-03 Thread Tim Wintle
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: 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 add

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: snip 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 'First

Re: pygame and socket.recv

2009-04-01 Thread Tim Wintle
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 one to the other. Tim Wintle -- http

Re: Another of those is issues.

2009-03-20 Thread Tim Wintle
checking the method on the class definition. Seem to remember Raymond Hettinger pointing to the code that does this as part of his descriptor tutorial talk at europython - but I can't find the slides to reference. hope that helps, Tim Wintle -- http://mail.python.org/mailman/listinfo/python

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 gagsl-...@yahoo.com.ar 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,

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 instead of raising

Re: Memory efficient tuple storage

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

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: 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 know.

Re: Chandler, Python, speed

2009-03-08 Thread Tim Wintle
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's open IMO. 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 --path-list %s %(disc_num,temp_list

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

2009-03-07 Thread Tim Wintle
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
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 haven't used it for anything proper yet. Tim Wintle -- http

  1   2   >