Why should __prepare__ be explicitly decorated as a @classmethod?

2014-05-17 Thread Shriramana Sharma
Hello. I did search for this but couldn't find the info anywhere else, so I'm asking here. Please point out if I've missed some other source of the same info: https://docs.python.org/3/reference/datamodel.html#basic-customization documents that __new__ is special-cased so that while it is actual

Re: Python and Math

2014-05-17 Thread Bill Cunningham
"Steven D'Aprano" wrote in message news:53783c5f$0$29977$c3e8da3 > You say you want to learn a *second* language, but you don't say what > your first language is. Nor do you say what sort of mathematics you wish > to do, or at what level. Depending on what you want to do, you might be > best of

Re: Python and Math

2014-05-17 Thread Bill Cunningham
"Rustom Mody" wrote in message news:09bbda59-9c37-44b0-acfc-0571d4fe8...@googlegroups.com... > What does the word 'mathematical' connote for you? > On the whole the term is so wide that its hard to answer without some > more context. > > For example there's numpy,scipy for numerical and scienti

Re: Python and Math

2014-05-17 Thread Steven D'Aprano
On Sat, 17 May 2014 23:13:11 -0400, Bill Cunningham wrote: > Does Python have good mathematical capabilities? I am interested in > learning a second language for mathematical purposes. I am considering > looking at python, perl, fortran, Adas out. It looked too complicated to > learn. Perl looked

Re: Python and Math

2014-05-17 Thread Gary Herron
On 05/17/2014 08:13 PM, Bill Cunningham wrote: Does Python have good mathematical capabilities? I am interested in learning a second language for mathematical purposes. I am considering looking at python, perl, fortran, Adas out. It looked too complicated to learn. Perl looked easy and I hav

Re: Problem building 3.5 on Windows

2014-05-17 Thread Joseph L. Casale
Mark, Excuse the format of this post, stuck on the road only with an iPhone but in the event it helps, http://blog.vrplumber.com/b/2014/02/12/step-2-get-amd64-compatible-vs-2010/ may be useful. Jlc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and Math

2014-05-17 Thread Chris Angelico
On Sun, May 18, 2014 at 1:13 PM, Bill Cunningham wrote: > Does Python have good mathematical capabilities? I am interested in > learning a second language for mathematical purposes. I am considering > looking at python, perl, fortran, Adas out. It looked too complicated to > learn. Perl looked

Re: using a new computer and bringing needed libraries to it

2014-05-17 Thread Rustom Mody
On Sunday, May 18, 2014 5:47:05 AM UTC+5:30, Ned Batchelder wrote: > On 5/17/14 7:53 PM, CM wrote: > > > If I want to switch my work from one computer to a new one, and I > > have lots of various libraries installed on the original computer, > > what's the best way to switch that all to the new c

Re: Python and Math

2014-05-17 Thread Rustom Mody
On Sunday, May 18, 2014 8:43:11 AM UTC+5:30, Bill Cunningham wrote: > Does Python have good mathematical capabilities? I am interested in > > learning a second language for mathematical purposes. I am considering > > looking at python, perl, fortran, Adas out. It looked too complicated to > >

Python and Math

2014-05-17 Thread Bill Cunningham
Does Python have good mathematical capabilities? I am interested in learning a second language for mathematical purposes. I am considering looking at python, perl, fortran, Adas out. It looked too complicated to learn. Perl looked easy and I haven't really looked into python. Bill -- htt

Pip requirements: Machine-readable configuration versus human-audience documentation (was: using a new computer and bringing needed libraries to it)

2014-05-17 Thread Ben Finney
Ned Batchelder writes: > Make a list of the packages you need. Put it in a file called > requirements.txt. Then install them with: > > $ pip install -r requirements.txt > > Keep that file up-to-date as you add new requirements. Since these requirements are specifically for Python, more spe

Re: using a new computer and bringing needed libraries to it

2014-05-17 Thread Chris Angelico
On Sun, May 18, 2014 at 10:17 AM, Ned Batchelder wrote: > Make a list of the packages you need. Put it in a file called > requirements.txt. Then install them with: > > $ pip install -r requirements.txt > > Keep that file up-to-date as you add new requirements. +1. And the "keep up-to-date"

Re: using a new computer and bringing needed libraries to it

2014-05-17 Thread Terry Reedy
On 5/17/2014 7:53 PM, CM wrote: If I want to switch my work from one computer to a new one, and I have lots of various libraries installed on the original computer, what's the best way to switch that all to the new computer? I'm hoping there is some simple way like just copying the Python/Lib/si

Re: Can't figure out 'instance has no attribute' error

2014-05-17 Thread Gary Herron
On 05/17/2014 04:56 PM, varun...@gmail.com wrote: Hello Friends, I am working on this code but I kind of get the same error over and over again. Could any of you help me fix this part of the error? It's an indentation error: In the following the three function defs for __init__, addNode and

Re: Can't figure out 'instance has no attribute' error

2014-05-17 Thread Rhodri James
On Sun, 18 May 2014 00:56:42 +0100, wrote: Hello Friends, I am working on this code but I kind of get the same error over and over again. Could any of you help me fix this part of the error? Shuffling your post around to make an explanation easier, the traceback is: srva@hades:~$ python

Re: using a new computer and bringing needed libraries to it

2014-05-17 Thread Ned Batchelder
On 5/17/14 7:53 PM, CM wrote: If I want to switch my work from one computer to a new one, and I have lots of various libraries installed on the original computer, what's the best way to switch that all to the new computer? I'm hoping there is some simple way like just copying the Python/Lib/s

Re: Can't figure out 'instance has no attribute' error

2014-05-17 Thread Ned Batchelder
On 5/17/14 7:56 PM, varun...@gmail.com wrote: Hello Friends, I am working on this code but I kind of get the same error over and over again. Could any of you help me fix this part of the error? File RW1: class PHY_NETWORK: def __init__(self, nodes, edges): self.nodes = nodes

Can't figure out 'instance has no attribute' error

2014-05-17 Thread varun7rs
Hello Friends, I am working on this code but I kind of get the same error over and over again. Could any of you help me fix this part of the error? File RW1: class PHY_NETWORK: def __init__(self, nodes, edges): self.nodes = nodes self.edges = edges def addN

using a new computer and bringing needed libraries to it

2014-05-17 Thread CM
If I want to switch my work from one computer to a new one, and I have lots of various libraries installed on the original computer, what's the best way to switch that all to the new computer? I'm hoping there is some simple way like just copying the Python/Lib/site-packages folder, but I'm als

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Robert Kern
On 2014-05-17 13:07, Steven D'Aprano wrote: On Sat, 17 May 2014 09:57:06 +0100, Robert Kern wrote: On 2014-05-17 02:07, Steven D'Aprano wrote: On Fri, 16 May 2014 14:46:23 +, Grant Edwards wrote: At least in the US, there doesn't seem to be such a thing as "placing a work into the public

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Robert Kern
On 2014-05-17 15:15, Steven D'Aprano wrote: On Sat, 17 May 2014 10:29:00 +0100, Robert Kern wrote: One can state many things, but that doesn't mean they have legal effect. The US Code has provisions for how works become copyrighted automatically, how they leave copyright automatically at the en

Re: Problem building 3.5 on Windows

2014-05-17 Thread Mark Lawrence
On 17/05/2014 20:08, Chris Angelico wrote: On Sun, May 18, 2014 at 5:06 AM, Mark Lawrence wrote: Solved as you got me looking in a different direction. It certainly helps if you have an up to date version of the SDK :) Hah. I don't know which versions of Visual Studio Express go with which v

Re: Problem building 3.5 on Windows

2014-05-17 Thread Chris Angelico
On Sun, May 18, 2014 at 5:06 AM, Mark Lawrence wrote: > Solved as you got me looking in a different direction. It certainly helps > if you have an up to date version of the SDK :) Hah. I don't know which versions of Visual Studio Express go with which versions of Python, but I know there is a st

Re: Problem building 3.5 on Windows

2014-05-17 Thread Mark Lawrence
On 17/05/2014 18:05, Chris Angelico wrote: On Sun, May 18, 2014 at 2:59 AM, Mark Lawrence wrote: 1>..\PC\make_versioninfo.c(1): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory What stupid thing have I forgotten, apart from switching to *nix? :) Well, apart f

Re: PEP 8 : Maximum line Length :

2014-05-17 Thread Rustom Mody
On Saturday, May 17, 2014 7:36:19 PM UTC+5:30, Roy Smith wrote: > > Mark Lawrence wrote: > > > Now translate E=mc^2 into Java. > > > > > > > I can't do that as I simply don't understand it. What has the > > Marylebone Cricket Club got to do with E? > > A wicket looks like an E on its side.

Re: Loading modules from files through C++

2014-05-17 Thread Stefan Behnel
Roland Plüss, 17.05.2014 18:28: > On 05/17/2014 05:49 PM, Stefan Behnel wrote: >> Roland Plüss, 17.05.2014 17:28: >>> On 05/17/2014 04:01 PM, Stefan Behnel wrote: Roland Plüss, 17.05.2014 15:49: > On 05/17/2014 03:26 PM, Stefan Behnel wrote: >> Roland Plüss, 17.05.2014 15:00: >>> O

Re: Problem building 3.5 on Windows

2014-05-17 Thread Chris Angelico
On Sun, May 18, 2014 at 2:59 AM, Mark Lawrence wrote: > 1>..\PC\make_versioninfo.c(1): fatal error C1083: Cannot open include file: > 'stdio.h': No such file or directory > > What stupid thing have I forgotten, apart from switching to *nix? :) Well, apart from that... I'd guess you have a pathing

Problem building 3.5 on Windows

2014-05-17 Thread Mark Lawrence
First time in months I've tried building, first time I've ever had a problem that I can't solve for myself. I'm using Visual C++ 2010 Express. 1>-- Build started: Project: make_versioninfo, Configuration: Debug Win32 -- 1> make_versioninfo.c 1>..\PC\make_versioninfo.c(1): fatal error

Re: Loading modules from files through C++

2014-05-17 Thread Roland Plüss
On 05/17/2014 05:49 PM, Stefan Behnel wrote: > Roland Plüss, 17.05.2014 17:28: >> On 05/17/2014 04:01 PM, Stefan Behnel wrote: >>> Roland Plüss, 17.05.2014 15:49: On 05/17/2014 03:26 PM, Stefan Behnel wrote: > Roland Plüss, 17.05.2014 15:00: >> On 05/17/2014 01:58 PM, Stefan Behnel wr

Re: Loading modules from files through C++

2014-05-17 Thread Stefan Behnel
Roland Plüss, 17.05.2014 17:28: > On 05/17/2014 04:01 PM, Stefan Behnel wrote: >> Roland Plüss, 17.05.2014 15:49: >>> On 05/17/2014 03:26 PM, Stefan Behnel wrote: Roland Plüss, 17.05.2014 15:00: > On 05/17/2014 01:58 PM, Stefan Behnel wrote: >> Roland Plüss, 17.05.2014 02:27: >>> I

Re: Loading modules from files through C++

2014-05-17 Thread Roland Plüss
On 05/17/2014 04:01 PM, Stefan Behnel wrote: > Hi, > > please avoid top-posting. > > > Roland Plüss, 17.05.2014 15:49: >> On 05/17/2014 03:26 PM, Stefan Behnel wrote: >>> Roland Plüss, 17.05.2014 15:00: On 05/17/2014 01:58 PM, Stefan Behnel wrote: > Roland Plüss, 17.05.2014 02:27: >>

Re: Values and objects

2014-05-17 Thread Albert van der Horst
In article <536decca$0$29980$c3e8da3$54964...@news.astraweb.com>, >Personally, I don't imagine that there ever could be a language where >variables were first class values *exactly* the same as ints, strings, >floats etc. Otherwise, how could you tell the difference between a >function which opera

Re: PEP 8 : Maximum line Length :

2014-05-17 Thread Mark Lawrence
On 17/05/2014 15:06, Roy Smith wrote: In article , Mark Lawrence wrote: On 17/05/2014 13:52, Albert van der Horst wrote: Now translate E=mc^2 into Java. I can't do that as I simply don't understand it. What has the Marylebone Cricket Club got to do with E? A wicket looks like an E on

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Steven D'Aprano
On Sat, 17 May 2014 10:29:00 +0100, Robert Kern wrote: > One can state many things, but that doesn't mean they have legal effect. > The US Code has provisions for how works become copyrighted > automatically, how they leave copyright automatically at the end of > specific time periods, how some wo

Re: PEP 8 : Maximum line Length :

2014-05-17 Thread Roy Smith
In article , Mark Lawrence wrote: > On 17/05/2014 13:52, Albert van der Horst wrote: > > > > Now translate E=mc^2 into Java. > > > > I can't do that as I simply don't understand it. What has the > Marylebone Cricket Club got to do with E? A wicket looks like an E on its side. Does that help

Re: PEP 8 : Maximum line Length :

2014-05-17 Thread Mark Lawrence
On 17/05/2014 13:52, Albert van der Horst wrote: Now translate E=mc^2 into Java. I can't do that as I simply don't understand it. What has the Marylebone Cricket Club got to do with E? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our languag

Re: Loading modules from files through C++

2014-05-17 Thread Stefan Behnel
Hi, please avoid top-posting. Roland Plüss, 17.05.2014 15:49: > On 05/17/2014 03:26 PM, Stefan Behnel wrote: >> Roland Plüss, 17.05.2014 15:00: >>> On 05/17/2014 01:58 PM, Stefan Behnel wrote: Roland Plüss, 17.05.2014 02:27: > I'm using Python in an embedded situation. In particular I h

Re: PEP 8 : Maximum line Length :

2014-05-17 Thread Roy Smith
In article , Chris Angelico wrote: > On Sat, May 17, 2014 at 10:52 PM, Albert van der Horst > wrote: > > That may be tong-in-cheek but mathematicians do exactly that. We > > use roman, greek and hebrew alphabets in normal italics and boldface > > and then some special characters for element-of,

Re: PEP 8 : Maximum line Length :

2014-05-17 Thread Roy Smith
In article , Tim Chase wrote: > On 2014-05-17 12:52, Albert van der Horst wrote: > > Now translate E=mc^2 into Java. > > I suspect it would be something like > > public class Einstein { > private double mass=0, energy=0; > public class Relativity implements IEquation { > Relativity(do

Re: Loading modules from files through C++

2014-05-17 Thread Roland Plüss
I'm willing to go to Py3 but only if the solution to the problem is simpler than getting it fixed in Py2. So some questions first: - does this importlib stuff you showed there apply to C++ land (I need to fully drive it from C++ not Python code)? - is the C++ land of Py3 similar to Py2 or totally

Re: PEP 8 : Maximum line Length :

2014-05-17 Thread Tim Chase
On 2014-05-17 12:52, Albert van der Horst wrote: > Now translate E=mc^2 into Java. I suspect it would be something like public class Einstein { private double mass=0, energy=0; public class Relativity implements IEquation { Relativity(double mass) { set_mass(mass); } public

Re: Loading modules from files through C++

2014-05-17 Thread Stefan Behnel
Roland Plüss, 17.05.2014 15:00: > On 05/17/2014 01:58 PM, Stefan Behnel wrote: >> Roland Plüss, 17.05.2014 02:27: >>> I'm using Python in an embedded situation. In particular I have to load >>> python scripts through a memory interface so regular python module >>> loading can not be used. I got wor

Re: PEP 8 : Maximum line Length :

2014-05-17 Thread Chris Angelico
On Sat, May 17, 2014 at 10:52 PM, Albert van der Horst wrote: > That may be tong-in-cheek but mathematicians do exactly that. We > use roman, greek and hebrew alphabets in normal italics and boldface > and then some special characters for element-of, logical-or, integral signs, > triangles and wha

Re: Help with changes in traceback stack from Python 2.7 to Python 3.x

2014-05-17 Thread Albert van der Horst
In article , Andrew Konstantaras wrote: >-=-=-=-=-=- > >I guess I am missing something big as I am looking for a shorthand way >of doing the following: > > dctA = dict(x=x, y=y, ... n=n) > >This is, as I understand it a very natural way of using a dictionary. >It seems that this syntax

Re: Loading modules from files through C++

2014-05-17 Thread Roland Plüss
That doesn't work in 2.x, doesn't it? On 05/17/2014 01:58 PM, Stefan Behnel wrote: > Roland Plüss, 17.05.2014 02:27: >> I'm using Python in an embedded situation. In particular I have to load >> python scripts through a memory interface so regular python module >> loading can not be used. I got wo

Re: PEP 8 : Maximum line Length :

2014-05-17 Thread Albert van der Horst
In article , Chris Angelico wrote: >On Fri, May 16, 2014 at 12:17 AM, wrote: >> One another trick is to drop spaces around keywords >> > 9and 12345or 99if 'a'in'a' else or 77 >> 12345 >> >> and pray, the tools from those who are wasting their time in >> writing code

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Steven D'Aprano
On Sat, 17 May 2014 09:57:06 +0100, Robert Kern wrote: > On 2014-05-17 02:07, Steven D'Aprano wrote: >> On Fri, 16 May 2014 14:46:23 +, Grant Edwards wrote: >> >>> At least in the US, there doesn't seem to be such a thing as "placing >>> a work into the public domain". The copyright holder ca

Re: Loading modules from files through C++

2014-05-17 Thread Stefan Behnel
Roland Plüss, 17.05.2014 02:27: > I'm using Python in an embedded situation. In particular I have to load > python scripts through a memory interface so regular python module > loading can not be used. I got working so far a module loader object > I've added using C++ to sys.meta_path . Now I'm tot

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Ben Finney
Chris Angelico writes: > On Sat, May 17, 2014 at 6:57 PM, Robert Kern wrote: > > There is such a thing as the public domain in the US, and there are works in > > it, but there isn't really such a thing as "placing a work" there > > voluntarily, as Grant says. A work either is or isn't in the pub

Bug in Decimal??

2014-05-17 Thread Stefan Krah
> I'll follow up directly with the author of mpdecimal, as this is > somewhat serious on a language that's so widely used as python. > But please test it and confirm, am I seeing ghost digits? This has already been settled on libmpdec-devel, but for the list: As Mark Dickinson has already explai

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Robert Kern
On 2014-05-17 05:19, Marko Rauhamaa wrote: Steven D'Aprano : On Fri, 16 May 2014 14:46:23 +, Grant Edwards wrote: At least in the US, there doesn't seem to be such a thing as "placing a work into the public domain". The copyright holder can transfer ownershipt to soembody else, but there

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Chris Angelico
On Sat, May 17, 2014 at 6:57 PM, Robert Kern wrote: > There is such a thing as the public domain in the US, and there are works in > it, but there isn't really such a thing as "placing a work" there > voluntarily, as Grant says. A work either is or isn't in the public domain. > The author has no c

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Robert Kern
On 2014-05-17 02:07, Steven D'Aprano wrote: On Fri, 16 May 2014 14:46:23 +, Grant Edwards wrote: At least in the US, there doesn't seem to be such a thing as "placing a work into the public domain". The copyright holder can transfer ownershipt to soembody else, but there is no "public doma

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Mark Lawrence
On 17/05/2014 05:19, Marko Rauhamaa wrote: The sole copyright holder can simply state: "this work is in the Public Domain," or: "all rights relinquished," or some such. Ultimately, everything is decided by the courts, of course. For examples see all the Python PEPs. -- My fellow Pythonistas,