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

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 ver

Re: How to begin

2014-02-14 Thread Terry Reedy
On 2/13/2014 7:57 PM, Ben Finney wrote: Ryan Gonzalez 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 read that. It is

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 selen

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 call

Re:Python version problem for rpm

2014-02-14 Thread Dave Angel
anju tiwari 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 python 2.7, I don’t wa

Re: A curious bit of code...

2014-02-14 Thread Dave Angel
Terry Reedy 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 key[-1:]

Re: Working with the set of real numbers

2014-02-14 Thread Dave Angel
Chris Angelico 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 kill yo

Re: Newcomer Help

2014-02-14 Thread David Robinow
On Thu, Feb 13, 2014 at 11:32 AM, Larry Martell 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 against these jerks.

Re: A curious bit of code...

2014-02-14 Thread Roy Smith
In article , Dave Angel wrote: > Terry Reedy 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:] ==

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 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 would claim that _is_ the r

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. -- https://mail.python.org/mailman/listinf

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 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? > > Thank you. > Cl

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 a

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 causin

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

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

2014-02-14 Thread Marko Rauhamaa
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? Here's some advice from a very experienced

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

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 variabl

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 tro

Re: Emacs python-mode.el bug #1207470

2014-02-14 Thread Frank Stutzman
Andreas R?hler wrote: > Re-opened the ticket mentioned. Please subscribe there, so you may get the > bug-mail. I've subscribed at launchpad and have given you a few more details there. Much appreciate you taking the time to look at this. -- Frank Stutzman -- https://mail.python.org/mailm

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

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 having

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 contai

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

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 Pytho

Re: Explanation of list reference

2014-02-14 Thread Marko Rauhamaa
dave em : > 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[

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 winn

Re: Explanation of list reference

2014-02-14 Thread Ian Kelly
On Fri, Feb 14, 2014 at 11:54 AM, dave em 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 cheese = s

Re: Explanation of list reference

2014-02-14 Thread Ian Kelly
On Fri, Feb 14, 2014 at 12:56 PM, Marko Rauhamaa 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 value. The

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 li

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

Re: Explanation of list reference

2014-02-14 Thread Marko Rauhamaa
Ian Kelly : > 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, the "everythi

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 ques

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 7:58 AM, Marko Rauhamaa 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 have lit

Re: Explanation of list reference

2014-02-14 Thread Marko Rauhamaa
Marko Rauhamaa : > 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 example

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

Re: Explanation of list reference

2014-02-14 Thread Marko Rauhamaa
Chris Angelico : > 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 successfully withou

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 pa

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 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 persons james_bond = Secr

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

2014-02-14 Thread Dave Angel
Nick Timkovich 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 data in biggen():     Â

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 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 profiling, it > seems like w

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

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 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 as the positive >> i

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

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 figu

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 wrote: > Ryan Gonzalez 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 *im

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

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

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
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 whether its two operands are exactly the same >> object, nothing more and

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

2014-02-14 Thread Roy Smith
In article , Ryan Gonzalez 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 --find-links packages metar==1.4.0 Exception in thread Thread-1: Traceback

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 te

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
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 numbers have an L after them :) > As against > x = 2*3 6 i

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 exp

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

2014-02-14 Thread Roy Smith
In article , Nick Timkovich 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 around, a la C's `static` functions. > Many thanks! It's not quite lik

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

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 wrot

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
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 L after them :) > > Nice point! > And only sharpens what I am saying --

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 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 very large an

Re: Explanation of list reference

2014-02-14 Thread Ben Finney
Marko Rauhamaa writes: > Chris Angelico : > > 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 "everything is a reference

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%7D&cjsku=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

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

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 3:24 PM, Rustom Mody 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 identical. Are they d

Re: Question on using FP numbers in python 2

2014-02-14 Thread Grant Edwards
On 2014-02-15, Gene Heskett 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 start part way down

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

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, 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 your code for you. > th

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

Re: Explanation of list reference

2014-02-14 Thread Ian Kelly
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 space-time coordinates of > 2 objects are all equal then the objects are

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 wrote: > Not extract, but let you get & look at the code, its the top entry on this > page: > > Code_Generators#Counterbore_Software> Interesting. At the top of the file, it says GPL3 or l

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 4:20 PM, Ian Kelly wrote: > On Fri, Feb 14, 2014 at 9:24 PM, Rustom Mody 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 > implementation detail. The defini

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

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 wrote: > > Not extract, but let you get & look at the code, its the top entry on > > this page: > > > > > Code_Generators

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 4:36 PM, Steven D'Aprano 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 said, but I'm not sure I like th

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 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 version was,

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 s

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

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 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 with the same identi

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 5:07 PM, Rustom Mody 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 and virtual memory

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 t

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

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 a

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 > 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)`.

Re: Explanation of list reference

2014-02-14 Thread Steven D'Aprano
On Sat, 15 Feb 2014 15:37:20 +1100, Chris Angelico wrote: [...] > This is why dice exist in a variety of colors [1]. Indistinguishable yet > distinct dice... Since they have different colours, they can be distinguished and aren't indistinguishable. One might also distinguish three dice by posit

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 5:48 PM, Steven D'Aprano wrote: > On Sat, 15 Feb 2014 17:07:17 +1100, Chris Angelico wrote: > >> On Sat, Feb 15, 2014 at 4:36 PM, Steven D'Aprano >> wrote: >>> References can be names like `mystring`, or list items `mylist[0]`, or >>> items in mappings `mydict["key"]`, or

  1   2   >