Re: Splitting numeric litterals

2010-07-16 Thread bart.c
"Steven D'Aprano" wrote in message news:4c4069de$0$11101$c3e8...@news.astraweb.com... On Fri, 16 Jul 2010 14:49:21 +0100, MRAB wrote: Not only that, but it only takes 73 digits to write out the total number of particles in the entire universe: 10

Re: Easy questions from a python beginner

2010-07-12 Thread bart.c
"Steven D'Aprano" wrote in message news:4c3aedd5$0$28647$c3e8...@news.astraweb.com... On Mon, 12 Jul 2010 09:48:04 +0100, bart.c wrote: That's interesting. So in Python, you can't tell what local variables a function has just by looking at it's code: def foo(d

Re: Easy questions from a python beginner

2010-07-12 Thread bart.c
"MRAB" wrote in message news:mailman.591.1278900548.1673.python-l...@python.org... Alf P. Steinbach /Usenet wrote: def foo(): print( blah ) blah = "this is both an assignment and a declaration causing it to exist" foo() Clearly when the exception is raised, referring to the

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-11 Thread bart.c
"rantingrick" wrote in message news:1b285203-33f6-41fb-8321-381c154bc...@w12g2000yqj.googlegroups.com... Let me tell you folks about a recent case of culo rojo i experianced whilst creating a customized bin packer with Python. First i want to say that i actually like the fact that i can do thi

Re: Python -- floating point arithmetic

2010-07-07 Thread bart.c
david mainzer wrote: sum = 0.0 for i in range(10): ... sum += 0.1 ... sum 0.99989 But thats looks a little bit wrong for me ... i must be a number greater then 1.0 because 0.1 = 0.155511151231257827021181583404541015625000 in python ... if i print i

Re: Python -- floating point arithmetic

2010-07-07 Thread bart.c
david mainzer wrote: sum = 0.0 for i in range(10): ... sum += 0.1 ... sum 0.99989 But thats looks a little bit wrong for me ... i must be a number greater then 1.0 because 0.1 = 0.155511151231257827021181583404541015625000 in python ... if i print i

Re: Lua is faster than Fortran???

2010-07-04 Thread bart.c
"sturlamolden" wrote in message news:daa07acb-d525-4e32-91f0-16490027c...@w12g2000yqj.googlegroups.com... I was just looking at Debian's benchmarks. It seems LuaJIT is now (on median) beating Intel Fortran! C (gcc) is running the benchmarks faster by less than a factor of two. Consider that

Re: List of lists surprising behaviour

2010-06-18 Thread bart.c
"Steven D'Aprano" wrote in message news:4c1b8ac6$0$14148$c3e8...@news.astraweb.com... On Fri, 18 Jun 2010 12:07:38 +0100, bart.c wrote: (Although I have an issue with the way that that append works. I tried it in another, simpler language (which always does deep copies): L:=(

Re: List of lists surprising behaviour

2010-06-18 Thread bart.c
Lie Ryan wrote: On 06/18/10 20:00, bart.c wrote: (I don't know if Python allows circular references, but that would give problems anyway: how would you even print out such a list?) Python uses ellipsis to indicate recursive list: a = [1, 2, 3] a.append(a) a [1, 2, 3, [...]] Ok, pe

Re: List of lists surprising behaviour

2010-06-18 Thread bart.c
Benjamin Kaplan wrote: On Thu, Jun 17, 2010 at 4:20 PM, bart.c wrote: I don't know how Python does things, but an object should either specify a special way of duplicating itself, or lend itself to some standard way of doing so. (So for a list, it's just a question of copying the d

Re: List of lists surprising behaviour

2010-06-17 Thread bart.c
"J Kenneth King" wrote in message news:87wrtxh0dq@agentultra.com... candide writes: Let's the following code : t=[[0]*2]*3 t [[0, 0], [0, 0], [0, 0]] t[0][0]=1 t [[1, 0], [1, 0], [1, 0]] Rather surprising, isn't it ? Not at all, actually. The code is clearly trying to set only

Re: GUIs - A Modest Proposal

2010-06-09 Thread bart.c
"Steven D'Aprano" wrote in message news:4c101fbc$0$28644$c3e8...@news.astraweb.com... On Wed, 09 Jun 2010 04:16:23 -0700, ant wrote: 1 Although a few advocates of Tkinter have spoken in favour of it, most seem to think that: It's not particularly elegant, either in its use or its implem

Re: GUIs - A Modest Proposal

2010-06-08 Thread bart.c
"Grant Edwards" wrote in message news:hullf3$hl...@reader1.panix.com... On 2010-06-08, Kevin Walzer wrote: Since Tk already provides a basic GUI toolset, and Python can interface with it more directly than it can with other toolkits (PyGui -> PyGtk -> Gtk -> Xlib), Compare that to this: