rJSmin 1.0.8

2014-02-14 Thread André Malo
Hello World, I'm pleased to announce version 1.0.8 of rJSmin. About rJSmin rJSmin is a javascript minifier written in python. The minifier is based on the semantics of jsmin.c by Douglas Crockford. The module is a re-implementation aiming for speed, so it can be used at runtime

rCSSmin 1.0.3

2014-02-14 Thread André Malo
Hello World, I'm pleased to announce version 1.0.3 of rCSSmin. About rCSSmin = rCSSmin is a CSS minifier written in python based on the semantics of the YUI compressor, which itself is based on the rule list by Isaac Schlueter. This module is a re-implementation aiming for speed

ReportLab 3.0 release - Python 2.7 / 3.3+ compatible

2014-02-14 Thread Andy Robinson
I am happy to announce the release of ReportLab 3.0. This is an extensive internal rewrite which runs under Python 2.7 and Python 3.3+. However, we believe we have preserved the API, so that applications should not need changing. Packages are available on http://pypi.python.org/ in all popular

Re: Pythonwin forum?

2014-02-14 Thread Tim Golden
On 14/02/2014 03:17, John Doe wrote: What's the best place for asking questions about the Pythonwin IDE? I'm a novice programmer, so in an effort to be more clear I'm talking about the program at this path on my hard drive... C:\Python27\Lib\site-packages\pythonwin\Pythonwin.exe It

Python version problem for rpm

2014-02-14 Thread anju tiwari
Hi all, I have two version of python 2.4 and 2.7. By default python version is 2.4 . I want to install need to install some rpm which needs python 2.7 interpreter. how can I enable 2.7 interpreter for only those packages which are requiring python 2.7, I don't want to change my default python

Re: How to begin

2014-02-14 Thread Terry Reedy
On 2/13/2014 7:57 PM, Ben Finney wrote: Ryan Gonzalez rym...@gmail.com writes: Read the Python reference. I know it's long, but it saves you trouble of accidentally reinventing the wheel. Hmm, the language reference is targeted at people *implementing* Python, This is the first time I have

IronPython + Selenium2Library + Visual Studio + Robot Framwork

2014-02-14 Thread nw . rabea
Hi All, I already familiar with the python, selenium2library and robot framwork. But i don't know how to connect those things with the ironpython in visual studio. How to integrate pyhton with selenium2library in visual studio by using ironpython, is there a special dll to make import to

Re: Working with the set of real numbers

2014-02-14 Thread Gregory Ewing
Devin Jeanpierre wrote: There is no way to iterate over all the reals one at a time, no matter how fast you execute instructions. If you could, it would be trivial to show that the reals have the same cardinality as the positive integers: correspond n with the whatever is returned by the nth

Re:Python version problem for rpm

2014-02-14 Thread Dave Angel
anju tiwari anjutiwa...@gmail.com Wrote in message: I have two version of python 2.4 and 2.7. By default python version is 2.4 . I want to install need to install some rpm which needs python 2.7 interpreter. how can I enable 2.7 interpreter for only those packages which are requiring

Re: A curious bit of code...

2014-02-14 Thread Dave Angel
Terry Reedy tjre...@udel.edu Wrote in message: On 2/13/2014 1:37 PM, forman.si...@gmail.com wrote: I ran across this and I thought there must be a better way of doing it, but then after further consideration I wasn't so sure. if key[:1] + key[-1:] == '': ... if key[:1] == '' and

Re: Working with the set of real numbers

2014-02-14 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Fri, Feb 14, 2014 at 5:37 PM, Gregory Ewing If it's a quantum computer, it may be able to execute all branches of the iteration in parallel. But it would only have a probability of returning the right answer (in other cases it would

Re: Newcomer Help

2014-02-14 Thread David Robinow
On Thu, Feb 13, 2014 at 11:32 AM, Larry Martell larry.mart...@gmail.com wrote: 18) If you're on AOL, don't worry about anything I've said here. You're already a fucking laughing stock, and there's no hope for you. Ah, the email bigots. That's why I keep an AOL address around for occasional use

Re: A curious bit of code...

2014-02-14 Thread Roy Smith
In article mailman.6914.1392380171.18130.python-l...@python.org, Dave Angel da...@davea.name wrote: Terry Reedy tjre...@udel.edu Wrote in message: On 2/13/2014 1:37 PM, forman.si...@gmail.com wrote: I ran across this and I thought there must be a better way of doing it, but then after

Re: Working with the set of real numbers

2014-02-14 Thread Rustom Mody
On Friday, February 14, 2014 12:14:31 PM UTC+5:30, Chris Angelico wrote: Oh, that's fine, he's not my cat anyway. Go ahead, build it. Now Now! I figured you were the cat out here! -- https://mail.python.org/mailman/listinfo/python-list

Re: Working with the set of real numbers

2014-02-14 Thread Grant Edwards
On 2014-02-14, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: If it's a quantum computer, it may be able to execute all branches of the iteration in parallel. But it would only have a probability of returning the right answer (in other cases it would kill your cat). I know somebody who

Best practices to overcome python's dynamic data type nature

2014-02-14 Thread Sam
Dynamic data type has pros and cons. It is easier to program but also easier to create bugs. What are the best practices to reduce bugs caused by Python's dynamic data-type characteristic? Can the experienced Python programmers here advise? Thank you. --

error handling in multithreaded extension callbacks

2014-02-14 Thread Connor
Hi, In my extension I'm calling python functions as callbacks from a thread generated in an external module. This works very well, but I'm not sure about the error handling. 1. Normally the python interpreter exits if it runs on an unhandled error. Is this the preferred standard behavior for

Re:Best practices to overcome python's dynamic data type nature

2014-02-14 Thread Dave Angel
Sam lightai...@gmail.com Wrote in message: Dynamic data type has pros and cons. It is easier to program but also easier to create bugs. What are the best practices to reduce bugs caused by Python's dynamic data-type characteristic? Can the experienced Python programmers here advise?

Re: Best practices to overcome python's dynamic data type nature

2014-02-14 Thread Mark Lawrence
On 14/02/2014 16:10, Sam wrote: Dynamic data type has pros and cons. It is easier to program but also easier to create bugs. What are the best practices to reduce bugs caused by Python's dynamic data-type characteristic? Can the experienced Python programmers here advise? Thank you. Bugs

Emacs python-mode.el bug #1207470

2014-02-14 Thread Frank Stutzman
According to https://bugs.launchpad.net/python-mode/+bug/1207470 this bug was fixed in version 6.1.2 of python-mode.el. I am trying to run 6.1.3 and am running into it. I back dated to 6.1.2 and still see it there. I am running GNU Emacs 23.3.1. Its possible that something I'm doing it

Re: Best practices to overcome python's dynamic data type nature

2014-02-14 Thread Mark Lawrence
On 14/02/2014 16:42, Dave Angel wrote: Sam lightai...@gmail.com Wrote in message: Dynamic data type has pros and cons. It is easier to program but also easier to create bugs. What are the best practices to reduce bugs caused by Python's dynamic data-type characteristic? Can the experienced

Re: Best practices to overcome python's dynamic data type nature

2014-02-14 Thread Marko Rauhamaa
Sam lightai...@gmail.com: Dynamic data type has pros and cons. It is easier to program but also easier to create bugs. What are the best practices to reduce bugs caused by Python's dynamic data-type characteristic? Can the experienced Python programmers here advise? Here's some advice from a

Re: Best practices to overcome python's dynamic data type nature

2014-02-14 Thread Ethan Furman
On 02/14/2014 08:10 AM, Sam wrote: Dynamic data type has pros and cons. It is easier to program but also easier to create bugs. What are the best practices to reduce bugs caused by Python's dynamic data-type characteristic? Can the experienced Python programmers here advise? Unit tests.

Re: Best practices to overcome python's dynamic data type nature

2014-02-14 Thread Gary Herron
On 02/14/2014 08:10 AM, Sam wrote: Dynamic data type has pros and cons. It is easier to program but also easier to create bugs. What are the best practices to reduce bugs caused by Python's dynamic data-type characteristic? Can the experienced Python programmers here advise? Thank you. The

Re: Emacs python-mode.el bug #1207470

2014-02-14 Thread Andreas Röhler
Am 14.02.2014 17:38, schrieb Frank Stutzman: According to https://bugs.launchpad.net/python-mode/+bug/1207470 this bug was fixed in version 6.1.2 of python-mode.el. I am trying to run 6.1.3 and am running into it. I back dated to 6.1.2 and still see it there. I am running GNU Emacs 23.3.1.

Re: Best practices to overcome python's dynamic data type nature

2014-02-14 Thread Ethan Furman
On 02/14/2014 08:54 AM, Marko Rauhamaa wrote: Here's some advice from a very experienced programmer: become a very experienced programmer. +1 QOTW -- https://mail.python.org/mailman/listinfo/python-list

Explanation of list reference

2014-02-14 Thread dave em
Hello, Background: My twelve y/o son and I are still working our way through Invent Your Own Computer Games with Python, 2nd Edition. (We finished the Khan Academy Javascript Tutorials is the extent of our experience) He is asking a question I am having trouble answering which is how a

Re: Explanation of list reference

2014-02-14 Thread Jussi Piitulainen
dave em writes: He is asking a question I am having trouble answering which is how a variable containing a value differs from a variable containing a list or more specifically a list reference. My quite serious answer is: not at all. In particular, a list is a value. All those pointers to

Re: Explanation of list reference

2014-02-14 Thread Ned Batchelder
On 2/14/14 1:08 PM, dave em wrote: Hello, Background: My twelve y/o son and I are still working our way through Invent Your Own Computer Games with Python, 2nd Edition. (We finished the Khan Academy Javascript Tutorials is the extent of our experience) He is asking a question I am having

Re: Explanation of list reference

2014-02-14 Thread dave em
On Friday, February 14, 2014 11:26:13 AM UTC-7, Jussi Piitulainen wrote: dave em writes: He is asking a question I am having trouble answering which is how a variable containing a value differs from a variable containing a list or more specifically a list reference. My

Re: Explanation of list reference

2014-02-14 Thread Ryan Gonzalez
On 02/14/2014 12:08 PM, dave em wrote: Hello, Background: My twelve y/o son and I are still working our way through Invent Your Own Computer Games with Python, 2nd Edition. (We finished the Khan Academy Javascript Tutorials is the extent of our experience) He is asking a question I am

Re: Explanation of list reference

2014-02-14 Thread Denis McMahon
On Fri, 14 Feb 2014 10:54:29 -0800, dave em wrote: On Friday, February 14, 2014 11:26:13 AM UTC-7, Jussi Piitulainen wrote: dave em writes: He is asking a question I am having trouble answering which is how a variable containing a value differs from a variable containing a list

Re: Best practices to overcome python's dynamic data type nature

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 3:54 AM, Marko Rauhamaa ma...@pacujo.net wrote: Sam lightai...@gmail.com: Dynamic data type has pros and cons. It is easier to program but also easier to create bugs. What are the best practices to reduce bugs caused by Python's dynamic data-type characteristic? Can

Re: Best practices to overcome python's dynamic data type nature

2014-02-14 Thread Thomas Heller
Am 14.02.2014 17:32, schrieb Ethan Furman: On 02/14/2014 08:10 AM, Sam wrote: Dynamic data type has pros and cons. It is easier to program but also easier to create bugs. What are the best practices to reduce bugs caused by Python's dynamic data-type characteristic? Can the experienced

Re: Explanation of list reference

2014-02-14 Thread Marko Rauhamaa
dave em daveandem2...@gmail.com: Case 1: Example of variable with a specific value from P 170 of IYOCGWP spam = 42 cheese = spam spam = 100 spam 100 cheese 42 Case 2: Example of variable with a list reference from p 170 spam = [0, 1, 2, 3, 4, 5] cheese = spam cheese[1] = 'Hello!'

Re: A curious bit of code...

2014-02-14 Thread forman . simon
On Thursday, February 13, 2014 7:26:48 PM UTC-8, Ned Batchelder wrote: On 2/13/14 9:45 PM, forman.si...@gmail.com wrote: For the record I wasn't worried about the performance. ;-) It was for Tkinter event strings not markup tags. I'm glad this was the time winner! key

Re: Explanation of list reference

2014-02-14 Thread Ian Kelly
On Fri, Feb 14, 2014 at 11:54 AM, dave em daveandem2...@gmail.com wrote: Thanks for your quick response. I'm still not sure we understand. The code below illustrates the concept we are trying to understand. Case 1: Example of variable with a specific value from P 170 of IYOCGWP spam = 42

Re: Explanation of list reference

2014-02-14 Thread Ian Kelly
On Fri, Feb 14, 2014 at 12:56 PM, Marko Rauhamaa ma...@pacujo.net wrote: There are two fundamentally different kinds of values in Python: small values and big values. A variable can only hold a small value. A list element can only hold a small value. A dictionary entry can only hold a small

Re: Python programming

2014-02-14 Thread ngangsia akumbo
wow wow Thanks for the contutions Thanks guys, many more are welcome -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of list reference

2014-02-14 Thread Jussi Piitulainen
dave em writes: On Friday, February 14, 2014 11:26:13 AM UTC-7, Jussi Piitulainen wrote: dave em writes: He is asking a question I am having trouble answering which is how a variable containing a value differs from a variable containing a list or more specifically a list reference.

Re: Explanation of list reference

2014-02-14 Thread Ned Batchelder
On 2/14/14 3:17 PM, Ian Kelly wrote: On Fri, Feb 14, 2014 at 12:56 PM, Marko Rauhamaa ma...@pacujo.net wrote: There are two fundamentally different kinds of values in Python: small values and big values. A variable can only hold a small value. A list element can only hold a small value. A

Re: Explanation of list reference

2014-02-14 Thread Marko Rauhamaa
Ian Kelly ian.g.ke...@gmail.com: This is nonsense. Python the language makes no such distinction between big and small values. *All* objects in CPython are stored internally on the heap. Other implementations may use different memory management schemes. You're right, of course. Conceptually,

Re: A curious bit of code...

2014-02-14 Thread Mark Lawrence
On 14/02/2014 20:04, forman.si...@gmail.com wrote: On Thursday, February 13, 2014 7:26:48 PM UTC-8, Ned Batchelder wrote: On 2/13/14 9:45 PM, forman.si...@gmail.com wrote: For the record I wasn't worried about the performance. ;-) It was for Tkinter event strings not markup tags.

Unitest mock issue

2014-02-14 Thread Joseph L. Casale
I am trying to patch a method of a class thats proving to be less than trivial. The module I am writing a test for, ModuleA imports another ModuleB and instantiates a class from this. Problem is, ModuleA incorporates multiprocessing queues and I suspect I am missing the patch as the object in

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 7:58 AM, Marko Rauhamaa ma...@pacujo.net wrote: Say you write: 1 + 2 You may not find it most intuitive to follow through the object instantiation and reference manipulation implicit in the everything is a reference model when you think you understand numbers but

Re: Explanation of list reference

2014-02-14 Thread Marko Rauhamaa
Marko Rauhamaa ma...@pacujo.net: You're right, of course. Conceptually, the everything is a reference and the small/big distinction are equivalent (produce the same outcomes). The question is, which model is easier for a beginner to grasp. In fact, if you adjust my annotations to the given

Re: Explanation of list reference

2014-02-14 Thread Terry Reedy
On 2/14/2014 1:08 PM, dave em wrote: He is asking a question I am having trouble answering which is how a variable containing a value differs from a variable containing a list or more specifically a list reference. I tried the to explain as best I can remember is that a variable is assigned to

Re: better and user friendly IDE recommended?

2014-02-14 Thread Martin Schöön
Den 2014-02-14 skrev Rustom Mody rustompm...@gmail.com: On Friday, February 14, 2014 2:57:13 AM UTC+5:30, Martin Schöön wrote: Den 2013-09-17 skrev rusi On Wednesday, September 11, 2013 7:44:04 PM UTC+5:30, mnishpsyched wrote: Just saw this http://www.youtube.com/watch?v=1-dUkyn_fZA

Re: Explanation of list reference

2014-02-14 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: be careful of simplifications that will cause problems down the line. Sure. Let it be said, though, that sometimes you learn through inaccuracies, a technique used intentionally by Knuth's TeXBook, for example. In fact, you get through highschool mathematics

Re: A curious bit of code...

2014-02-14 Thread Simon Forman
On Friday, February 14, 2014 1:01:48 PM UTC-8, Mark Lawrence wrote: [snip] Pleased to have you on board, as I'm know that Terry Reedy et al can do with a helping hand. But please note you appear to be using google groups, hence the double line spacing above and trying to reply to

Generator using item[n-1] + item[n] memory

2014-02-14 Thread Nick Timkovich
I have a Python 3.x program that processes several large text files that contain sizeable arrays of data that can occasionally brush up against the memory limit of my puny workstation. From some basic memory profiling, it seems like when using the generator, the memory usage of my script balloons

Re: Explanation of list reference

2014-02-14 Thread pecore
dave em daveandem2...@gmail.com writes: He is asking a question I am having trouble answering which is how a variable containing a value differs from a variable containing a list or more specifically a list reference. s/list/mutable object/ # Mr Bond and Mr Tont are two different ob^H^H

Re:Generator using item[n-1] + item[n] memory

2014-02-14 Thread Dave Angel
Nick Timkovich prometheus...@gmail.com Wrote in message: def biggen():     sizes = 1, 1, 10, 1, 1, 10, 10, 1, 1, 10, 10, 20, 1, 1, 20, 20, 1, 1     for size in sizes:         data = [1] * int(size * 1e6)         #time.sleep(1)         yield data def consumer():     for

Re: Generator using item[n-1] + item[n] memory

2014-02-14 Thread Ian Kelly
On Fri, Feb 14, 2014 at 3:27 PM, Nick Timkovich prometheus...@gmail.com wrote: I have a Python 3.x program that processes several large text files that contain sizeable arrays of data that can occasionally brush up against the memory limit of my puny workstation. From some basic memory

A curious bit of code...

2014-02-14 Thread Simon Forman
(Apologies if this results in a double-post.) On Friday, February 14, 2014 1:01:48 PM UTC-8, Mark Lawrence wrote: [snip] Pleased to have you on board, as I'm know that Terry Reedy et al can do with a helping hand. But please note you appear to be using google groups, hence the double

Re: Explanation of list reference

2014-02-14 Thread Ned Batchelder
On 2/14/14 4:43 PM, Marko Rauhamaa wrote: Chris Angelicoros...@gmail.com: be careful of simplifications that will cause problems down the line. Sure. Let it be said, though, that sometimes you learn through inaccuracies, a technique used intentionally by Knuth's TeXBook, for example. In fact,

Re: Working with the set of real numbers

2014-02-14 Thread Devin Jeanpierre
On Fri, Feb 14, 2014 at 3:30 AM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Devin Jeanpierre wrote: There is no way to iterate over all the reals one at a time, no matter how fast you execute instructions. If you could, it would be trivial to show that the reals have the same cardinality

Re: Explanation of list reference

2014-02-14 Thread dave em
All, Thanks for the excellent explanations and for sharing your knowledge. I definitely have a better understanding than I did this morning. Best regards, Dave -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 8:43 AM, Marko Rauhamaa ma...@pacujo.net wrote: Unfortunately neither the everything is a reference model nor the small/big model help you predict the value of an is operator in the ambiguous cases. Can you give an example of an ambiguous case? Fundamentally, the 'is'

How to turn a package into something pip can install

2014-02-14 Thread Roy Smith
I want to use (https://github.com/timetric/python-metar). Our deployment process more or less requires that it be installed via pip. We maintain our own cache of packages and install using: pip install --no-index --quiet --find-links packages --requirement requirements.txt What I can't

Re: How to begin

2014-02-14 Thread Ryan Gonzalez
Ack, I meant that, not the whole reference. On Thu, Feb 13, 2014 at 6:57 PM, Ben Finney ben+pyt...@benfinney.id.auwrote: Ryan Gonzalez rym...@gmail.com writes: Read the Python reference. I know it's long, but it saves you trouble of accidentally reinventing the wheel. Hmm, the language

Re: Explanation of list reference

2014-02-14 Thread Rustom Mody
On Saturday, February 15, 2014 6:27:33 AM UTC+5:30, Chris Angelico wrote: On Sat, Feb 15, 2014 at 8:43 AM, Marko Rauhamaa wrote: Unfortunately neither the everything is a reference model nor the small/big model help you predict the value of an is operator in the ambiguous cases. Can you

Re: How to turn a package into something pip can install

2014-02-14 Thread Ryan Gonzalez
python setup.py sdist On Fri, Feb 14, 2014 at 7:47 PM, Roy Smith r...@panix.com wrote: I want to use (https://github.com/timetric/python-metar). Our deployment process more or less requires that it be installed via pip. We maintain our own cache of packages and install using: pip install

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 12:55 PM, Rustom Mody rustompm...@gmail.com wrote: On Saturday, February 15, 2014 6:27:33 AM UTC+5:30, Chris Angelico wrote: Can you give an example of an ambiguous case? Fundamentally, the 'is' operator tells you whether its two operands are exactly the same object,

Re: How to turn a package into something pip can install

2014-02-14 Thread Roy Smith
In article mailman.6949.1392429645.18130.python-l...@python.org, Ryan Gonzalez rym...@gmail.com wrote: python setup.py sdist OK, I run that and I get a metar-1.4.0.tar.gz under dist. If I move that tarfile to my packages directory, and run pip, I get: $ pip install --no-index --quiet

Re: Explanation of list reference

2014-02-14 Thread Rustom Mody
On Saturday, February 15, 2014 7:38:39 AM UTC+5:30, Chris Angelico wrote: On Sat, Feb 15, 2014 at 12:55 PM, Rustom Mody wrote: On Saturday, February 15, 2014 6:27:33 AM UTC+5:30, Chris Angelico wrote: Can you give an example of an ambiguous case? Fundamentally, the 'is' operator tells you

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 1:34 PM, Rustom Mody rustompm...@gmail.com wrote: At what level can you explain the following? x = 1234567 * 1234567 x 1524155677489L Well, for a start, I'd use Python 3, so there's no need to explain why some numbers have an L after them :) As against x = 2*3 6

Re: Generator using item[n-1] + item[n] memory

2014-02-14 Thread Nick Timkovich
Ah, I think I was equating `yield` too closely with `return` in my head. Whereas `return` results in the destruction of the function's locals, `yield` I should have known keeps them around, a la C's `static` functions. Many thanks! -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of list reference

2014-02-14 Thread Rustom Mody
On Saturday, February 15, 2014 8:12:14 AM UTC+5:30, Chris Angelico wrote: On Sat, Feb 15, 2014 at 1:34 PM, Rustom Mody wrote: At what level can you explain the following? x = 1234567 * 1234567 x 1524155677489L Well, for a start, I'd use Python 3, so there's no need to explain why some

Re: Generator using item[n-1] + item[n] memory

2014-02-14 Thread Roy Smith
In article mailman.6952.1392433921.18130.python-l...@python.org, Nick Timkovich prometheus...@gmail.com wrote: Ah, I think I was equating `yield` too closely with `return` in my head. Whereas `return` results in the destruction of the function's locals, `yield` I should have known keeps them

Question on using FP numbers in python 2

2014-02-14 Thread Gene Heskett
Greetings; Is there something I can search for and fix in some python code that is giving me bogus answers that get good only when there is a valid digit to the left of the decimal point? Cheers, Gene -- There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo.

Re: Generator using item[n-1] + item[n] memory

2014-02-14 Thread Nick Timkovich
OK, now the trick; adding `data = None` inside the generator works, but in my actual code I wrap my generator inside of `enumerate()`, which seems to obviate the fix. Can I get it to play nice or am I forced to count manually. Is that a feature? On Fri, Feb 14, 2014 at 9:21 PM, Roy Smith

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 2:14 PM, Rustom Mody rustompm...@gmail.com wrote: On Saturday, February 15, 2014 8:12:14 AM UTC+5:30, Chris Angelico wrote: Well, for a start, I'd use Python 3, so there's no need to explain why some numbers have an L after them :) Nice point! And only sharpens what I

Re: Question on using FP numbers in python 2

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 2:25 PM, Gene Heskett ghesk...@wdtv.com wrote: Is there something I can search for and fix in some python code that is giving me bogus answers that get good only when there is a valid digit to the left of the decimal point? Interesting. I'd look for anything that mixes

Re: Explanation of list reference

2014-02-14 Thread Ben Finney
Marko Rauhamaa ma...@pacujo.net writes: Chris Angelico ros...@gmail.com: Distinguishing small values from big values leads to the obvious question: Which is which? And why doesn't this work? This is related to the recent id(string) question on this forum. Unfortunately neither the

Re: Best practices to overcome python's dynamic data type nature

2014-02-14 Thread flebber
Here's a great resource http://www.anrdoezrs.net/click-7079286-11260198?url=http%3A%2F%2Fshop.oreilly.com%2Fproduct%2F0636920029533.do%3Fcmp%3Daf-code-book-product_cj_9781449367794_%7BPID%7Dcjsku=0636920029533 Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of list reference

2014-02-14 Thread Rustom Mody
On Saturday, February 15, 2014 9:03:36 AM UTC+5:30, Chris Angelico wrote: On Sat, Feb 15, 2014 at 2:14 PM, Rustom Mody wrote: On Saturday, February 15, 2014 8:12:14 AM UTC+5:30, Chris Angelico wrote: Well, for a start, I'd use Python 3, so there's no need to explain why some numbers have an

Re: Question on using FP numbers in python 2

2014-02-14 Thread Steven D'Aprano
On Fri, 14 Feb 2014 22:25:59 -0500, Gene Heskett wrote: Greetings; Is there something I can search for and fix in some python code that is giving me bogus answers that get good only when there is a valid digit to the left of the decimal point? Er, yes? Anything which involves floating

I'm trying to do this code, can somebody help me

2014-02-14 Thread pabloeruggeri
1)Given the variables x , y , and z , each associated with an int , write a fragment of code that assigns the smallest of these to min this is what I have def main(): x = eval ( input (dame el numero X)) y = eval ( input (dame el numero Y)) z = eval ( input (dame el numero Z)) if(xy

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 3:24 PM, Rustom Mody rustompm...@gmail.com wrote: I could have three six-sided dice, all made from the same mould, and yet each one is a separate object. If I hold all three in my hand and toss them onto the table, can I recognize which one is which? No, they're

Re: Question on using FP numbers in python 2

2014-02-14 Thread Grant Edwards
On 2014-02-15, Gene Heskett ghesk...@wdtv.com wrote: Is there something I can search for and fix in some python code that is giving me bogus answers that get good only when there is a valid digit to the left of the decimal point? Yes. Search for incorrectly written code and fix it. I'd

Re: Question on using FP numbers in python 2

2014-02-14 Thread Gene Heskett
On Friday 14 February 2014 23:37:53 Chris Angelico did opine: On Sat, Feb 15, 2014 at 2:25 PM, Gene Heskett ghesk...@wdtv.com wrote: Is there something I can search for and fix in some python code that is giving me bogus answers that get good only when there is a valid digit to the left of

Re: I'm trying to do this code, can somebody help me

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 3:27 PM, pabloerugg...@gmail.com wrote: 1)Given the variables x , y , and z , each associated with an int , write a fragment of code that assigns the smallest of these to min This is homework. Please be honest about it; we will help you to learn, but we won't write

Re: Question on using FP numbers in python 2

2014-02-14 Thread Gene Heskett
On Friday 14 February 2014 23:47:26 Steven D'Aprano did opine: On Fri, 14 Feb 2014 22:25:59 -0500, Gene Heskett wrote: Greetings; Is there something I can search for and fix in some python code that is giving me bogus answers that get good only when there is a valid digit to the left

Re: Explanation of list reference

2014-02-14 Thread Ian Kelly
On Fri, Feb 14, 2014 at 9:24 PM, Rustom Mody rustompm...@gmail.com wrote: In the case of physical objects like dice there is a fairly unquestionable framing that makes identity straightforward -- 4-dimensional space-time coordiantes. If the space-time coordinates of 2 objects are all equal

Re: Question on using FP numbers in python 2

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 4:07 PM, Gene Heskett ghesk...@wdtv.com wrote: Not extract, but let you get look at the code, its the top entry on this page: http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_LinuxCNC_G- Code_Generators#Counterbore_Software Interesting. At the top of the file, it says

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 4:20 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Fri, Feb 14, 2014 at 9:24 PM, Rustom Mody rustompm...@gmail.com wrote: To start with we say two objects are identical if they have the same memory address. This is false. It happens to hold for CPython, but that's an

Re: Explanation of list reference

2014-02-14 Thread Steven D'Aprano
On Fri, 14 Feb 2014 12:31:56 -0600, Ryan Gonzalez wrote: On 02/14/2014 12:08 PM, dave em wrote: Hello, Background: My twelve y/o son and I are still working our way through Invent Your Own Computer Games with Python, 2nd Edition. (We finished the Khan Academy Javascript Tutorials is the

Re: Question on using FP numbers in python 2

2014-02-14 Thread Gene Heskett
On Saturday 15 February 2014 00:43:53 Chris Angelico did opine: On Sat, Feb 15, 2014 at 4:07 PM, Gene Heskett ghesk...@wdtv.com wrote: Not extract, but let you get look at the code, its the top entry on this page: http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_LinuxCNC_G-

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 4:36 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: References can be names like `mystring`, or list items `mylist[0]`, or items in mappings `mydict[key]`, or attributes `myobject.attr`, or even expressions `x+y*(1-z)`. I agree with most of what you've

Re: Question on using FP numbers in python 2

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 4:50 PM, Gene Heskett ghesk...@wdtv.com wrote: I'm afraid I can't really help more, as I don't speak CNC. Actually, the output is RS-274-D, originally from NIST. But it has developed some pretty distinct accents in the 20 some years its been in the wild. The NIST

Re: Explanation of list reference

2014-02-14 Thread Rustom Mody
On Saturday, February 15, 2014 10:50:35 AM UTC+5:30, Ian wrote: On Fri, Feb 14, 2014 at 9:24 PM, Rustom Mody wrote: In the case of physical objects like dice there is a fairly unquestionable framing that makes identity straightforward -- 4-dimensional space-time coordiantes. If the

Re: Explanation of list reference

2014-02-14 Thread Steven D'Aprano
On Fri, 14 Feb 2014 19:00:36 -0500, Ned Batchelder wrote: On 2/14/14 4:43 PM, Marko Rauhamaa wrote: Chris Angelicoros...@gmail.com: be careful of simplifications that will cause problems down the line. Sure. Let it be said, though, that sometimes you learn through inaccuracies, a technique

Re: Explanation of list reference

2014-02-14 Thread Steven D'Aprano
On Fri, 14 Feb 2014 17:55:52 -0800, Rustom Mody wrote: My own preference: No is operator; only id when we deliberately need to poke into the implementation. Of course I am in a miniscule minority I guess on that :-) If I have understood you, I think that's a poor way of looking at it. We

Re: Explanation of list reference

2014-02-14 Thread Ben Finney
Rustom Mody rustompm...@gmail.com writes: Then you are obliged to provide some other way of understanding object-identity How about: Every object has an identity, which is unique among all concurrently-existing objects. The ‘is’ operator queries whether two references are referring to objects

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 5:07 PM, Rustom Mody rustompm...@gmail.com wrote: Nice point! I earlier talked of the macro problems of identity, viz across machines. You are bringing up a more 'micro' angle, viz gc. An even more micro (or lower level) example would be the mismatch between physical

Re: Explanation of list reference

2014-02-14 Thread Rustom Mody
On Saturday, February 15, 2014 11:45:00 AM UTC+5:30, Steven D'Aprano wrote: On Fri, 14 Feb 2014 17:55:52 -0800, Rustom Mody wrote: My own preference: No is operator; only id when we deliberately need to poke into the implementation. Of course I am in a miniscule minority I guess on that

Re: Explanation of list reference

2014-02-14 Thread Rustom Mody
On Saturday, February 15, 2014 11:49:38 AM UTC+5:30, Ben Finney wrote: Rustom Mody writes: Then you are obliged to provide some other way of understanding object-identity How about: Every object has an identity, which is unique among all concurrently-existing objects. The 'is' operator

Re: Explanation of list reference

2014-02-14 Thread Steven D'Aprano
On Fri, 14 Feb 2014 20:24:20 -0800, Rustom Mody wrote: In the case of physical objects like dice there is a fairly unquestionable framing that makes identity straightforward -- 4-dimensional space-time coordiantes. If the space-time coordinates of 2 objects are all equal then the objects are

Re: Explanation of list reference

2014-02-14 Thread Steven D'Aprano
On Sat, 15 Feb 2014 17:07:17 +1100, Chris Angelico wrote: On Sat, Feb 15, 2014 at 4:36 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: References can be names like `mystring`, or list items `mylist[0]`, or items in mappings `mydict[key]`, or attributes `myobject.attr`, or

  1   2   >