NameError: name 'pyver' is not defined

2014-03-05 Thread שולמית מירל
Hello, We have python 2.6 & 3.2 installed on Sun solaris. When running py utility, we get the below error: "NameError: global name 'execfile' is not defined" > p4convert-cvs.py EXCEPTION: [Errno 17] File exists: './LOGS' Traceback (most recent call last): File "p4convert-cvs.py", line 134, in

Re: Python programming

2014-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2014 20:19:56 -0800, Beowulf wrote: > Once you master one language it is easy to understand other. Depends on the languages. Learning Forth doesn't make it easier to learn Perl. Learning Pascal doesn't make Smalltalk easier. -- Steven -- https://mail.python.org/mailman/listi

Re: Diagnose a segfault in ipython/readline

2014-03-05 Thread Felix Yan
On Wednesday, March 05, 2014 20:15:31 Ned Deily wrote: > The current > assumption is that Python 2.7.6+, 3.3.5, and 3.4.0 have no problems with > readline 6.3. Thank you. I just gave a try to 3.4.0b2 with readline 6.3, and still get the same segfault. Not sure the version is new enough though.

Re: Python programming

2014-03-05 Thread Roy Smith
In article , Dan Sommers wrote: > On Wed, 05 Mar 2014 20:19:56 -0800, Beowulf wrote: > > > Once you master one language it is easy to understand other ... > > Once you master one language, the next one is hard. After that, they > get easier. And then you get to PHP. -- https://mail.python.o

Re: Python programming

2014-03-05 Thread Dan Sommers
On Wed, 05 Mar 2014 20:19:56 -0800, Beowulf wrote: > Once you master one language it is easy to understand other ... Once you master one language, the next one is hard. After that, they get easier. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python programming

2014-03-05 Thread Beowulf
Once you master one language it is easy to understand other. I mastered C in my younger years, writing signal handlers and thread on Solaris and AIX. It it not the syntax, that comes easy, it is building the correct algorithm that matters. The best way to learn is make some thing useful that y

Re: Diagnose a segfault in ipython/readline

2014-03-05 Thread Ned Deily
In article <2114014.zHAFJyoHbS@felix-arch>, Felix Yan wrote: > I'm getting a reproducible crash in ipython, but not sure what upstream it > should belong to. > > The crash happens with python 2.7.6/3.3.4, with readline 6.3. > > Steps to reproduce: > > - run ipython > - input some random char

Re: Python programming

2014-03-05 Thread 88888 Dihedral
On Thursday, February 13, 2014 11:30:27 PM UTC+8, Neil Cerutti wrote: > On 2014-02-12, Tim Delaney wrote: > > > OK - it's degenerated into one of these threads - I'm going to > > > participate. > > > > Me, too! > > > > I wrote lots of programs, strictly for fun, on every personal > > comp

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Roy Smith
In article <5317e640$0$29985$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Wed, 05 Mar 2014 21:31:51 -0500, Roy Smith wrote: > > > In article <53176225$0$29987$c3e8da3$54964...@news.astraweb.com>, > > Steven D'Aprano wrote: > > > >> Physics is the fundamental science, at l

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Grant Edwards
On 2014-03-06, Roy Smith wrote: > In article <53176225$0$29987$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> Physics is the fundamental science, at least according to the >> physicists, and Real Soon Now they'll have a Theory Of Everything, >> something small enough to print

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Chris Angelico
On Thu, Mar 6, 2014 at 2:06 PM, Steven D'Aprano wrote: > They ask a computer programmer to adjudicate who is right, so he writes a > program to print out all the primes: > > 1 is prime > 1 is prime > 1 is prime > 1 is prime > 1 is prime And he claimed that he was correct, because he had - as is k

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2014 21:31:51 -0500, Roy Smith wrote: > In article <53176225$0$29987$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> Physics is the fundamental science, at least according to the >> physicists, and Real Soon Now they'll have a Theory Of Everything, >> something

Diagnose a segfault in ipython/readline

2014-03-05 Thread Felix Yan
Hi, I'm getting a reproducible crash in ipython, but not sure what upstream it should belong to. The crash happens with python 2.7.6/3.3.4, with readline 6.3. Steps to reproduce: - run ipython - input some random char sequence that you never inputed (like "ae3r0gka03k0k23"), don't press Enter

Re: Reference

2014-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2014 22:23:46 +0200, Marko Rauhamaa wrote: > Steven D'Aprano : > >> There is no metaphysical implication from Python's "is" operator. If >> the operator had precisely the same behaviour, but was called "same", >> as in: >> >> a same b >> => returns True if a and b are the same obje

Re: Python programming

2014-03-05 Thread Albert van der Horst
In article , Roy Smith wrote: >In article , > Grant Edwards wrote: > >> On 2014-02-13, Dennis Lee Bieber wrote: >> >> >An S-100 wire-wrap board. >> >> Yup, been there done that! > >Never did S-100, but I did do a custom Unibus card (wirewrap). > >You know you're working with a Real Computer

Re: How security holes happen

2014-03-05 Thread 88888 Dihedral
On Wednesday, March 5, 2014 8:52:31 AM UTC+8, Andrew Cooper wrote: > On 03/03/2014 22:19, Cameron Simpson wrote: > > > On 03Mar2014 09:17, Neal Becker wrote: > > >> Charles R Harris Wrote in message: > > >>> > > >> > > >> Imo the lesson here is never write in low level c. Use modern > > >>

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Roy Smith
In article <53176225$0$29987$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Physics is the fundamental science, at least according to the physicists, > and Real Soon Now they'll have a Theory Of Everything, something small > enough to print on a tee-shirt, which will explain eve

Re: Reference

2014-03-05 Thread alex23
On 6/03/2014 10:52 AM, Marko Rauhamaa wrote: I was just saying talking about id() as a memory address isn't all that bad. It's a bit like rolling down your power windows or turning up the volume, when there's nothing to roll or turn. There's no risk of getting your program wrong. Unless you're

Re: How security holes happen

2014-03-05 Thread Mark H. Harris
On Wednesday, March 5, 2014 7:40:05 PM UTC-6, MRAB wrote: > > The 6502 came from MOS Technology. Motorola made the 6800. Well, not exactly. The MOS 6502 is to the Motorola 6800 what the Zilog Z80 was to the Intel 8080. The same engineers who designed the 6800 moved out and then designed

Re: Origin of 'self'

2014-03-05 Thread Westley Martínez
Why did C++ use this? I don't really like this. It doesn't sound right. I think it's because I have trouble saying the th sound without getting my mouth full of spit. Thankfully you don't often need to use this in C++ like you do with self in Python. -- https://mail.python.org/mailman/listinfo

Re: How security holes happen

2014-03-05 Thread MRAB
On 2014-03-06 01:24, Mark H. Harris wrote: On Wednesday, March 5, 2014 6:24:52 PM UTC-6, Dennis Lee Bieber wrote: I must have had a deprived life... The only "debug" on a home system I ever used was the one in LS-DOS. And even then, it was only because an OS update disk arrived with a bad secto

test

2014-03-05 Thread Mark H. Harris
test please disregard -- https://mail.python.org/mailman/listinfo/python-list

Re: How security holes happen

2014-03-05 Thread Mark H. Harris
On Wednesday, March 5, 2014 6:24:52 PM UTC-6, Dennis Lee Bieber wrote: > I must have had a deprived life... > > The only "debug" on a home system I ever used was the one in LS-DOS. > And even then, it was only because an OS update disk arrived with a bad > sector and could not be copie

Re: Reference

2014-03-05 Thread Ben Finney
Marko Rauhamaa writes: > Ben Finney : > > > Then this does not count as a leaky abstraction. All you're saying is > > that the ‘id(foo)’ result is a representation of the object identity, > > which is entirely at the level of the abstraction. Nothing is leaked. > > I wasn't making a point about a

Re: Reference

2014-03-05 Thread Marko Rauhamaa
Ben Finney : > Marko Rauhamaa writes: >> When I talk about an object's memory address, I'm not referring to >> what might be revealed by gdb, for example. That is, I'm not talking >> about the process's virtual address space, nor am I talking about the >> physical address on the address bus. I ca

Re: Reference

2014-03-05 Thread Chris Angelico
On Thu, Mar 6, 2014 at 11:35 AM, Steven D'Aprano wrote: > On Thu, 06 Mar 2014 08:26:22 +1100, Chris Angelico wrote: > >> Where's the complaints about circularity now? You're saying "But of >> course id() returns the address, as long as we define the address as >> 'whatever id() returns'.". Unimpea

Re: script uses up all memory

2014-03-05 Thread Larry Martell
On Wed, Mar 5, 2014 at 7:33 PM, Chris Angelico wrote: > On Thu, Mar 6, 2014 at 11:20 AM, Larry Martell > wrote: >> On Wed, Mar 5, 2014 at 5:39 PM, Chris Angelico wrote: >>> On Thu, Mar 6, 2014 at 9:27 AM, Larry Martell >>> wrote: I have a script that forks off other processes and attempt

Re: Reference

2014-03-05 Thread Steven D'Aprano
On Thu, 06 Mar 2014 08:26:22 +1100, Chris Angelico wrote: > On Thu, Mar 6, 2014 at 8:14 AM, Marko Rauhamaa wrote: >> When I talk about an object's memory address, I'm not referring to what >> might be revealed by gdb, for example. That is, I'm not talking about >> the process's virtual address sp

Re: script uses up all memory

2014-03-05 Thread Chris Angelico
On Thu, Mar 6, 2014 at 11:20 AM, Larry Martell wrote: > On Wed, Mar 5, 2014 at 5:39 PM, Chris Angelico wrote: >> On Thu, Mar 6, 2014 at 9:27 AM, Larry Martell >> wrote: >>> I have a script that forks off other processes and attempts to manage >>> them. Here is a stripped down version of the scr

Re: script uses up all memory

2014-03-05 Thread Larry Martell
On Wed, Mar 5, 2014 at 5:39 PM, Chris Angelico wrote: > On Thu, Mar 6, 2014 at 9:27 AM, Larry Martell wrote: >> I have a script that forks off other processes and attempts to manage >> them. Here is a stripped down version of the script: >> >> self.sleepTime = 300 > > That's not a stand-a

Re: Program Python

2014-03-05 Thread Tim Chase
On 2014-03-05 22:41, Luciano Trespidi wrote: > I'm very grateful if anyone can helpme to find a good program to > develop in python lenguage. Thanks This reminds me of the old joke: Q: Why are you scratching yourself? A: Because I'm the only one who knows where I itch! The best place to find

Re: Reference

2014-03-05 Thread Terry Reedy
On 3/5/2014 3:46 PM, Marko Rauhamaa wrote: Grant Edwards : Wrong. If the two objects are not the same, then they will have different ID values. If the ID values are the same, then you've only got one object. Ok, that circularity again. Every deductive system starts with some undefined terms

Re: ANN: Python Job Board - Call for volunteers

2014-03-05 Thread Dan Stromberg
I hope this means there'll soon be an option to restrict ads seen by some form of postal code or phone area code (with telecommute hopefully being an optional wildcard). On Thu, Feb 27, 2014 at 6:59 AM, M.-A. Lemburg wrote: > [Please help spread the word by forwarding to other relevant mailing li

Re: script uses up all memory

2014-03-05 Thread Chris Angelico
On Thu, Mar 6, 2014 at 9:27 AM, Larry Martell wrote: > I have a script that forks off other processes and attempts to manage > them. Here is a stripped down version of the script: > > self.sleepTime = 300 That's not a stand-alone script. What environment is it running in? Can you reproduc

Re: How to create an instance of a python class from C++

2014-03-05 Thread Gene Heskett
On Wednesday 05 March 2014 17:09:53 Grant Edwards did opine: > On 2014-03-05, Alister wrote: > >>> Why are you creating an ABC? > >> > >> Because it was the first binary computer that did calculations with > >> electronic switching elements (gates), and it would be really cool to > >> have one!

script uses up all memory

2014-03-05 Thread Larry Martell
I have a script that forks off other processes and attempts to manage them. Here is a stripped down version of the script: self.sleepTime = 300 self.procs = {} self.startTimes = {} self.cmd = ['python', '/usr/local/motor/motor/app/some_other_script.py'] whi

Re: Reference

2014-03-05 Thread Marko Rauhamaa
Chris Angelico : > On Thu, Mar 6, 2014 at 8:14 AM, Marko Rauhamaa wrote: >> When I talk about an object's memory address, I'm not referring to >> what might be revealed by gdb, for example. That is, I'm not talking >> about the process's virtual address space, nor am I talking about the >> physic

Re: Program Python

2014-03-05 Thread Ben Finney
Luciano Trespidi writes: > I'm very grateful if anyone can helpme to find a good program to develop in > python lenguage. > Thanks The best program to use for developing in the Python language is the Python interpreter :-) Beyond which, you may be interested in the Python community's “tutor” f

Re: Reference

2014-03-05 Thread Mark Lawrence
On 05/03/2014 21:33, Tim Chase wrote: On 2014-03-05 23:14, Marko Rauhamaa wrote: When I talk about an object's memory address, I'm not referring to what might be revealed by gdb, for example. That is, I'm not talking about the process's virtual address space, nor am I talking about the physical

Program Python

2014-03-05 Thread Luciano Trespidi
I'm very grateful if anyone can helpme to find a good program to develop in python lenguage. Thanks Inviato da: Ernesto Luciano Trespidi Email: keple...@hotmail.com Tel. 3299255463 -- https://mail.python.org/mailman/listinfo/python-list

Re: Reference

2014-03-05 Thread Ben Finney
Marko Rauhamaa writes: > Ben Finney : > > > A reference-compliant implementation can contradict your inference (by > > returning an object identity that is *not* the object's memory > > address). Any code you've written based on that false inference will > > break. > > > > The fault will be yours

Re: Reference

2014-03-05 Thread Mark Lawrence
On 05/03/2014 20:46, Marko Rauhamaa wrote: I think the discussion spawned from the problem of teaching programming students the right idea of values and objects. A teacher would like to bring in advanced concepts last, but Python seems to force you to get them at the very beginning. Nonsense,

Re: Reference

2014-03-05 Thread Tim Chase
On 2014-03-05 23:14, Marko Rauhamaa wrote: > When I talk about an object's memory address, I'm not referring to > what might be revealed by gdb, for example. That is, I'm not > talking about the process's virtual address space, nor am I talking > about the physical address on the address bus. I can

Re: Reference

2014-03-05 Thread Chris Angelico
On Thu, Mar 6, 2014 at 8:14 AM, Marko Rauhamaa wrote: > When I talk about an object's memory address, I'm not referring to what > might be revealed by gdb, for example. That is, I'm not talking about > the process's virtual address space, nor am I talking about the physical > address on the addres

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Oscar Benjamin
On 5 March 2014 17:43, Steven D'Aprano wrote: > On Wed, 05 Mar 2014 12:21:37 +, Oscar Benjamin wrote: >> >> The argument that the sum of all natural numbers comes to -1/12 is just >> some kind of hoax. I don't think *anyone* seriously believes it. > > You would be wrong. I suggest you read the

Re: Reference

2014-03-05 Thread Marko Rauhamaa
Ben Finney : > A reference-compliant implementation can contradict your inference (by > returning an object identity that is *not* the object's memory > address). Any code you've written based on that false inference will > break. > > The fault will be yours, for inferring an assertion that isn't

Re: Reference

2014-03-05 Thread Ben Finney
Marko Rauhamaa writes: > Grant Edwards : > > > Wrong. If the two objects are not the same, then they will have > > different ID values. If the ID values are the same, then you've only > > got one object. > > Ok, that circularity again. Yes, it's circular. In an abstract system like a programming

Re: Reference

2014-03-05 Thread Ben Finney
Marko Rauhamaa writes: > Say I implement Python. Say I returned a random number for id(), how > would that violate the language spec? You could do that, certainly. So long as that randomly-chosen integer was always the same for every object, and never the same for any other concurrently-existing

Re: Reference

2014-03-05 Thread Ben Finney
Marko Rauhamaa writes: > Steven D'Aprano : > > Both the Jython and CPython id() functions are compliant with the > > language definition. The Jython id() function is better, because it > > doesn't encourage people to mistakenly and foolishly imagine that > > id() equals address. > > I agree with

Re: Reference

2014-03-05 Thread Marko Rauhamaa
Grant Edwards : > Wrong. If the two objects are not the same, then they will have > different ID values. If the ID values are the same, then you've only > got one object. Ok, that circularity again. Say I implement Python. Say I returned a random number for id(), how would that violate the langu

Re: ANN: Python Job Board - Call for volunteers

2014-03-05 Thread James Mills
I'd like to volunteer! On Mar 5, 2014 7:13 PM, "M.-A. Lemburg" wrote: > [Please help spread the word by forwarding to other relevant mailing lists, > user groups, etc. world-wide; thanks :-)] > > Dear Python Community, > > for many years, the Python Job board ( > http://legacy.python.org/communi

Re: Reference

2014-03-05 Thread Marko Rauhamaa
Steven D'Aprano : > The id() function in Python is not defined as returning the address of > the object. It might as well. If I said id() returns the address of the object in the Python VM's virtual address space, you couldn't call my bluff. Say id() returned the intantiation sequence number. I

Re: Reference

2014-03-05 Thread Grant Edwards
On 2014-03-05, Marko Rauhamaa wrote: > Set theory obeys the so-called extensionality principle: if two > objects are indistinguishable in every way, they are one and the same > object. Fermions in particle physics are the same way: if two > fermions' quantum states coincide, they are one and the

Re: Reference

2014-03-05 Thread Marko Rauhamaa
Steven D'Aprano : > There is no metaphysical implication from Python's "is" operator. If the > operator had precisely the same behaviour, but was called "same", as in: > > a same b > => returns True if a and b are the same object > => returns False if a and b are not the same object > > would you

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Grant Edwards
On 2014-03-05, Chris Kaynor wrote: > On Wed, Mar 5, 2014 at 9:43 AM, Steven D'Aprano < > steve+comp.lang.pyt...@pearwood.info> wrote: > >> At one time, Euler summed an infinite series and got -1, from which he >> concluded that -1 was (in some sense) larger than infinity. I don't know >> what just

Re: How security holes happen

2014-03-05 Thread Chris Angelico
On Thu, Mar 6, 2014 at 5:42 AM, Steven D'Aprano wrote: > On Wed, 05 Mar 2014 16:54:59 +0200, Marko Rauhamaa wrote: > >> I don't think Lisp was really originally designed. > > The history of Lisp is described here in detail: > > http://www-formal.stanford.edu/jmc/history/lisp/lisp.html > > Like all

Re: How security holes happen

2014-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2014 16:54:59 +0200, Marko Rauhamaa wrote: > I don't think Lisp was really originally designed. The history of Lisp is described here in detail: http://www-formal.stanford.edu/jmc/history/lisp/lisp.html Like all complex systems, it did not appear fully-formed in a flash of inspi

Re: Reference

2014-03-05 Thread Ben Finney
Rustom Mody writes: > On Wednesday, March 5, 2014 11:50:46 AM UTC+5:30, Ben Finney wrote: > > So, what machine represenatation is leaked? > > > I'll re-iterate that "memory location of the object" isn't a valid > > response. There is no necessary relation between the memory location of > > the ob

Re: Reference

2014-03-05 Thread Steven D'Aprano
On Tue, 04 Mar 2014 22:03:36 -0800, Rustom Mody wrote: > On Wednesday, March 5, 2014 10:36:37 AM UTC+5:30, Steven D'Aprano wrote: >> On Tue, 04 Mar 2014 19:36:38 -0800, Rustom Mody wrote: > >> > Python's 'is' leaks >> > the machine abstraction. 'id' does it legitimately (somewhat), 'is' >> > does

Re: Reference

2014-03-05 Thread Steven D'Aprano
On Tue, 04 Mar 2014 21:47:21 -0800, Rustom Mody wrote: > On Wednesday, March 5, 2014 10:36:37 AM UTC+5:30, Steven D'Aprano wrote: >> On Tue, 04 Mar 2014 19:36:38 -0800, Rustom Mody wrote: > >> > Python's 'is' leaks >> > the machine abstraction. 'id' does it legitimately (somewhat), 'is' >> > does

Re: Reference

2014-03-05 Thread Tim Chase
On 2014-03-05 09:40, Rustom Mody wrote: > Every object has an identity, a type and a value. An object's > identity never changes once it has been created; you may think of > it as the object's address in memory. The 'is' operator compares > the identity of two objects; the id() function returns an

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Chris Kaynor
On Wed, Mar 5, 2014 at 9:43 AM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > At one time, Euler summed an infinite series and got -1, from which he > concluded that -1 was (in some sense) larger than infinity. I don't know > what justification he gave, but the way I think of it

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Chris Angelico
On Thu, Mar 6, 2014 at 4:43 AM, Steven D'Aprano wrote: > Physics is the fundamental science, at least according to the physicists, > and Real Soon Now they'll have a Theory Of Everything, something small > enough to print on a tee-shirt, which will explain everything. At least > in principle. Eve

Re: Working with the set of real numbers

2014-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2014 12:50:06 +, Mark Lawrence wrote: > On 05/03/2014 12:21, Oscar Benjamin wrote: >> >> Why the dig at physicists? I think most physicists would be able to >> tell you that the sum of all natural numbers is not -1/12. In fact most >> people with very little background in mathem

Re: Reference

2014-03-05 Thread Rustom Mody
On Wednesday, March 5, 2014 11:50:46 AM UTC+5:30, Ben Finney wrote: > Rustom Mody writes: > > That python is a hll means that machine reprs are intended to be abstracted > > away. 'is' fails to do that -- proof of that being the discrepancy between > > is and == > That's your proof? That is a non

Re: find and replace string in binary file

2014-03-05 Thread Emile van Sebille
On 3/5/2014 1:59 AM, loial wrote: Unfortunately I have to use python 2.6 for this Did you try it? Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2014 12:21:37 +, Oscar Benjamin wrote: > On 5 March 2014 07:52, Steven D'Aprano wrote: >> On Tue, 04 Mar 2014 23:25:37 -0500, Roy Smith wrote: >> >>> I stopped paying attention to mathematicians when they tried to >>> convince me that the sum of all natural numbers is -1/12. >>

Re: How to create an instance of a python class from C++

2014-03-05 Thread Grant Edwards
On 2014-03-05, Alister wrote: >> >>> Why are you creating an ABC? >> >> Because it was the first binary computer that did calculations with >> electronic switching elements (gates), and it would be really cool to >> have one! The ABC also pioneered the use of capciators as regenerative >> storage

Re: How to create an instance of a python class from C++

2014-03-05 Thread Alister
On Wed, 05 Mar 2014 16:08:00 +, Grant Edwards wrote: > On 2014-03-05, Ian Kelly wrote: >> On Tue, Mar 4, 2014 at 5:14 PM, Bill wrote: >>> Hello: >>> >>> I can't figure out how to create an instance of a python class from >>> 'C++': >>> >>> ( I am relatively new to Python so excuse some of th

Re: How security holes happen

2014-03-05 Thread Mark H. Harris
On Wednesday, March 5, 2014 9:47:40 AM UTC-6, Steven D'Aprano wrote: > Seriously, Lisp is not only one of the oldest high-level languages > around, being almost as old as Fortran and Cobol, but it was one of the > biggest languages of the 1970s and even into the 80s. Lisp was specified by Joh

Re: How to create an instance of a python class from C++

2014-03-05 Thread Grant Edwards
On 2014-03-05, Ian Kelly wrote: > On Tue, Mar 4, 2014 at 5:14 PM, Bill wrote: >> Hello: >> >> I can't figure out how to create an instance >> of a python class from 'C++': >> >> ( I am relatively new to Python so excuse some of the following. ) >> >> In a .py file I create an ABC and then special

Re: How security holes happen

2014-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2014 00:48:40 +0200, Marko Rauhamaa wrote: > Ethan Furman : > >> Okay, that looks totally cool. Maybe I'll finally get a handle on LISP! >> :) > > Lisp is conceptually simpler than Python, but awe-inspiring. One day, it > will overtake Python, I believe. That day was 25 years ago

Re: How security holes happen

2014-03-05 Thread Grant Edwards
On 2014-03-04, Marko Rauhamaa wrote: > Ethan Furman : > >> Okay, that looks totally cool. Maybe I'll finally get a handle on >> LISP! :) > > Lisp is conceptually simpler than Python, but awe-inspiring. One day, it > will overtake Python, I believe. Seriously? LISP had a _30_year_head_start_ yet

Re: How security holes happen

2014-03-05 Thread Chris Angelico
On Thu, Mar 6, 2014 at 1:11 AM, Mark H. Harris wrote: > My first IBM machine was the famous PCjr... booted directly into cartridge > BASIC, or would optionally boot DOS 2.1 from 5" floppy, where I could > run, you guessed it BASICA, using the cartridge rom, or I could optionally > run DEBUG.COM a

Re: How security holes happen

2014-03-05 Thread Marko Rauhamaa
Neil Cerutti : > Personally, I think it hasn't taken off because special forms are > harder to remember than syntax. And there are, like, *way* more than > mammals needs. It hasn't taken off yet, but even mammals can evolve. > Well, that or lisp's designers severely underestimated how much we >

Re: Reference

2014-03-05 Thread Tim Chase
On 2014-03-05 17:26, Ben Finney wrote: > > "Jython is an imitation of Cpython and does a good job but not > > quite as in the case of 'id'" > > Wrong. Jython and CPython both adhere to the guarantees of object > identity. Both implementations follow the language reference, and > neither implemen

Re: How security holes happen

2014-03-05 Thread Neil Cerutti
On 2014-03-05, Dennis Lee Bieber wrote: > On Wed, 05 Mar 2014 00:48:40 +0200, Marko Rauhamaa > declaimed the following: >>Ethan Furman : >>> Okay, that looks totally cool. Maybe I'll finally get a >>> handle on LISP! :) >> >> Lisp is conceptually simpler than Python, but awe-inspiring. >> One day

Re: How security holes happen

2014-03-05 Thread Mark H. Harris
On Wednesday, March 5, 2014 2:26:12 AM UTC-6, Steven D'Aprano wrote: > On Wed, 05 Mar 2014 08:37:42 +0200, Marko Rauhamaa wrote: > > > If you had tried Python 30 years ago, you'd give it up for any serious > > work because it would be so slow and consume so much memory. > > /facepalm > > Python i

Re: How to create an instance of a python class from C++

2014-03-05 Thread Bill
> > So far, so good. The object that was passed in was the "Derived" > class object. Since you presumably only want class objects to be > passed in, you might want to check that here using PyType_Check. > Yes. Will do. > > > PyTypeObject *typ = class_decl->ob_type; > > In Python, y

Re: Reference

2014-03-05 Thread Antoon Pardon
Op 04-03-14 16:25, Chris Angelico schreef: > On Wed, Mar 5, 2014 at 2:19 AM, Jerry Hill wrote: >> Out of curiosity, do you think we should be doing truth checking with >> 'is'? True and False are singletons, and it seems to me that the >> justification for idenity versus equality should be just

Re: Working with the set of real numbers

2014-03-05 Thread Dave Angel
Dave Angel Wrote in message: > Oscar Benjamin Wrote in message: >> On 4 March 2014 23:20, Dave Angel wrote: >>> >>> If anyone is curious, I'll be glad to describe the algorithm; >>> I've never seen it published, before or since. I got my >>> inspiration from a method used in mechanical,

Re: Working with the set of real numbers

2014-03-05 Thread Dave Angel
Oscar Benjamin Wrote in message: > On 4 March 2014 23:20, Dave Angel wrote: >> >> One problem with complexity claims is that it's easy to miss some >> contributing time eaters. I haven't done any measuring on modern >> machines nor in python, but I'd assume that multiplies take >> *much* long

Re: Working with the set of real numbers

2014-03-05 Thread Mark Lawrence
On 05/03/2014 12:21, Oscar Benjamin wrote: Why the dig at physicists? I think most physicists would be able to tell you that the sum of all natural numbers is not -1/12. In fact most people with very little background in mathematics can tell you that. I'll put that one to the test tomorrow mo

Re: Reference

2014-03-05 Thread Chris Angelico
On Wed, Mar 5, 2014 at 11:35 PM, Mark Lawrence wrote: >> if the_list is None: >> >> >> Marko >> > > Really great thinking, test the name the_list, which strangely enough tells > me that this beast is a list, in the same way that THIS_IS_A_CONSTANT is a > constant, to see if it's None. Congrat

Re: find and replace string in binary file

2014-03-05 Thread Mark Lawrence
On 05/03/2014 09:59, loial wrote: I'm pleased to see that you have answers. In return would you please read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing, thanks. -- My fellow Pythonistas, ask not what our language can do for you, as

Re: Reference

2014-03-05 Thread Mark Lawrence
On 05/03/2014 06:23, Marko Rauhamaa wrote: Rustom Mody : * ... which summarizes my objection in this thread: Python's 'is' leaks the machine abstraction. 'id' does it legitimately (somewhat), 'is' does it illegitimately I agree that the Python data model can be exceedingly challenging to a be

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Oscar Benjamin
On 5 March 2014 07:52, Steven D'Aprano wrote: > On Tue, 04 Mar 2014 23:25:37 -0500, Roy Smith wrote: > >> I stopped paying attention to mathematicians when they tried to convince >> me that the sum of all natural numbers is -1/12. > > I'm pretty sure they did not. Possibly a physicist may have tri

Re: Reference

2014-03-05 Thread Mark Lawrence
On 05/03/2014 06:28, alex23 wrote: On 5/03/2014 4:10 PM, Rustom Mody wrote: A python programmer who needs/wants to think of same/is in this sense should probably be using C or assembly Any programmer who is obsessing about some idea of philosophical purity should probably not be using Python.

Re: Reference

2014-03-05 Thread Mark Lawrence
On 05/03/2014 06:10, Rustom Mody wrote: On Wednesday, March 5, 2014 11:31:04 AM UTC+5:30, alex23 wrote: On 5/03/2014 3:47 PM, Rustom Mody wrote: That python is a hll means that machine reprs are intended to be abstracted away. 'is' fails to do that -- proof of that being the discrepancy between

Re: Functional programming

2014-03-05 Thread Marko Rauhamaa
Chris Angelico : > C++ has something very like this, with the 'auto' keyword. It's not > particularly useful for the examples you give, but can be much more so > when you have templates, iterators, and so on - where the exact type > declaration might be a couple dozen characters of pure syntactic

Re: Functional programming

2014-03-05 Thread Chris Angelico
On Wed, Mar 5, 2014 at 10:28 PM, BartC wrote: > But I agree that in many cases, an initialised declaration *could* often be > used to infer the likely type without too much trouble: > > var x=2 # integer > var y=3.0 # real > var z="A" # probably, a C-style string pointer ('char*') > > (And

Re:find and replace string in binary file

2014-03-05 Thread Dave Angel
loial Wrote in message: > How do I read a binary file, find/identify a character string and replace it > with another character string and write out to another file? > > Its the finding of the string in a binary file that I am not clear on. > > Any help appreciated > I see from another messa

Re: Working with the set of real numbers

2014-03-05 Thread Oscar Benjamin
On 4 March 2014 23:20, Dave Angel wrote: > > One problem with complexity claims is that it's easy to miss some > contributing time eaters. I haven't done any measuring on modern > machines nor in python, but I'd assume that multiplies take > *much* longer for large integers, and that divides ar

Re: Functional programming

2014-03-05 Thread BartC
"Steven D'Aprano" wrote in message news:5315eec0$0$29985$c3e8da3$54964...@news.astraweb.com... On Tue, 04 Mar 2014 13:30:04 +, BartC wrote: Isn't creating classes in Python similar to creating types elsewhere? Depends on the type: I suppose you can draw an analogy between records or str

Re: Working with the set of real numbers

2014-03-05 Thread Ned Batchelder
On 3/5/14 4:00 AM, wxjmfa...@gmail.com wrote: Mathematics? The Flexible String Representation is a very nice example of a mathematical absurdity. jmf PS Do not even think to expect to contradict me. Hint: sheet of paper and pencil. Reminder to everyone: JMF makes no sense when he talks about

Re: find and replace string in binary file

2014-03-05 Thread loial
Thanks Emile. Unfortunately I have to use python 2.6 for this On Wednesday, 5 March 2014 00:13:00 UTC, emile wrote: > On 03/04/2014 02:44 PM, Chris Angelico wrote: > > > On Wed, Mar 5, 2014 at 12:18 AM, Peter Otten <__pete...@web.de> wrote: > > >> loial wrote: > > >> > > >>> How do I read a

Re: Functional programming

2014-03-05 Thread Antoon Pardon
Op 04-03-14 16:18, Steven D'Aprano schreef: > Depends on the type: I suppose you can draw an analogy between records or > structs and classes with no methods. > > But I'm not talking about creating types, I'm talking about type > declarations. > > int x=2; # 2 is an int? Who would have guessed!

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread wxjmfauth
Mathematics? The Flexible String Representation is a very nice example of a mathematical absurdity. jmf PS Do not even think to expect to contradict me. Hint: sheet of paper and pencil. -- https://mail.python.org/mailman/listinfo/python-list

Re: How security holes happen

2014-03-05 Thread Marko Rauhamaa
Steven D'Aprano : > On Wed, 05 Mar 2014 08:37:42 +0200, Marko Rauhamaa wrote: >> If you had tried Python 30 years ago, you'd give it up for any >> serious work because it would be so slow and consume so much memory. > > /facepalm > > Python is only 23 years old, Some explorers roamed in Siberia a

Re: Functional programming

2014-03-05 Thread Antoon Pardon
Op 04-03-14 12:47, Steven D'Aprano schreef: > On Tue, 04 Mar 2014 11:56:07 +0100, Antoon Pardon wrote: > >> Op 04-03-14 09:56, Steven D'Aprano schreef: If you explicitly say that this is an int, then yes, that should be disallowed; >>> It's that "explicitly" part that doesn't follow

  1   2   >