Re: should "self" be changed?

2015-05-26 Thread Chris Angelico
On Wed, May 27, 2015 at 3:23 PM, Steven D'Aprano wrote: > On Wednesday 27 May 2015 06:45, Mark Lawrence wrote: > >> Apart from breaking all the tools that rely on "self" being spelt "self" >> this looks like an excellent idea. > > Tools which rely on self being spelled "self" are already broken. I

Re: should "self" be changed?

2015-05-26 Thread Steven D'Aprano
On Wednesday 27 May 2015 14:39, Ben Finney wrote: > zipher writes: > >> Arrgh. Sorry, that was meant privately... > > I'm glad we saw it publicly, so that we get more of an idea how you > treat people. > > That kind of homophobic slur is inappropriate from anyone in this > community. Kindly c

Re: should "self" be changed?

2015-05-26 Thread Steven D'Aprano
On Wednesday 27 May 2015 06:45, Mark Lawrence wrote: > Apart from breaking all the tools that rely on "self" being spelt "self" > this looks like an excellent idea. Tools which rely on self being spelled "self" are already broken. It's a convention, nothing more, and there are various good reaso

Re: should "self" be changed?

2015-05-26 Thread Steven D'Aprano
On Wednesday 27 May 2015 05:46, Marko Rauhamaa wrote: > Python's practice works. However, a small problem is presented by nested > classes: > > class Connection: > def __init__(self): > class Idle: > def signal_start(self): > # how to re

Re: should "self" be changed?

2015-05-26 Thread Steven D'Aprano
On Wednesday 27 May 2015 02:37, zipher wrote: > Would it be prudent to rid the long-standing "argument" (pun unintended) > about self and the ulterior spellings of it, by changing it into a symbol > rather than a name? No. > Something like: > > class MyClass(object): > > def __init__(@):

Re: OpenCV with Python (cv or cv2)

2015-05-26 Thread IronManMark20
On Tuesday, May 26, 2015 at 6:52:00 AM UTC-7, Markos wrote: > Hi, > > I want to use OpenCV with Python. > > I installed version 2.4.9 > (http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/) > > in debian Squeeze running Python 2.6.6. Using the tutorial: > h

Re: should "self" be changed?

2015-05-26 Thread Ben Finney
zipher writes: > Arrgh. Sorry, that was meant privately... I'm glad we saw it publicly, so that we get more of an idea how you treat people. That kind of homophobic slur is inappropriate from anyone in this community. Kindly cut it out altogether. -- \ “Always do right. This will grat

Re: should "self" be changed?

2015-05-26 Thread zipher
On Tuesday, May 26, 2015 at 11:57:44 AM UTC-5, Laura Creighton wrote: > In a message of Tue, 26 May 2015 09:37:29 -0700, zipher writes: > >Would it be prudent to rid the long-standing "argument" (pun unintended) > >about self and the ulterior spellings of it, by changing it into a symbol > >rathe

Re: should "self" be changed?

2015-05-26 Thread zipher
On Tuesday, May 26, 2015 at 9:48:25 PM UTC-5, zipher wrote: > On Tuesday, May 26, 2015 at 12:28:31 PM UTC-5, Mark Lawrence wrote: > > On 26/05/2015 17:37, zipher wrote: > > > Would it be prudent to rid the long-standing "argument" (pun unintended) > > > about self and the ulterior spellings of it,

Re: should "self" be changed?

2015-05-26 Thread zipher
On Tuesday, May 26, 2015 at 11:57:44 AM UTC-5, Laura Creighton wrote: > In a message of Tue, 26 May 2015 09:37:29 -0700, zipher writes: > >Would it be prudent to rid the long-standing "argument" (pun unintended) > >about self and the ulterior spellings of it, by changing it into a symbol > >rathe

Re: should "self" be changed?

2015-05-26 Thread zipher
On Tuesday, May 26, 2015 at 12:28:31 PM UTC-5, Mark Lawrence wrote: > On 26/05/2015 17:37, zipher wrote: > > Would it be prudent to rid the long-standing "argument" (pun unintended) > > about self and the ulterior spellings of it, by changing it into a symbol > > rather than a name? > > Yes, how

PyDev 4.1.0 Released

2015-05-26 Thread Fabio Zadrozny
What is PyDev? --- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details on

Re: Array of Functions

2015-05-26 Thread Gary Herron
On 05/26/2015 05:43 PM, richard_riehle wrote: I realized that I mentioned earlier that I found a solution to my original question, but that I never posted an example of the solution. So, here is a simplified example for anyone who is interested. def fArray(fselect, fparm = 1): def A

Re: Array of Functions

2015-05-26 Thread Laura Creighton
In a message of Tue, 26 May 2015 19:43:31 -0500, richard_riehle writes: >I realized that I mentioned earlier that I found a solution to my original >question, but that I never posted an example of the solution. So, here is a >simplified example for anyone who is interested. > >def fArray(fselec

Re: Array of Functions

2015-05-26 Thread richard_riehle
I realized that I mentioned earlier that I found a solution to my original question, but that I never posted an example of the solution. So, here is a simplified example for anyone who is interested. def fArray(fselect, fparm = 1): def A1(p = fparm): if p == 1:

Re: OpenCV with Python (cv or cv2)

2015-05-26 Thread Thomas 'PointedEars' Lahn
Rustom Mody wrote: > On Tuesday, May 26, 2015 at 9:19:35 PM UTC+5:30, Thomas 'PointedEars' Lahn > wrote: >> Markos wrote: >> ^^ >> Please append your last name. > > No more required than an affidavit proving PointedEars is your legal name In addition to this utter nonsense, do you have anyth

Re: should "self" be changed?

2015-05-26 Thread Tim Chase
On 2015-05-26 21:45, Mark Lawrence wrote: >> class MyClass(object): >> def __init__(ስ): >> ስ.dummy = None > > Apart from breaking all the tools that rely on "self" being spelt > "self" this looks like an excellent idea. Though to be fair, they *are* broken tools if they rely on "self"

Re: should "self" be changed?

2015-05-26 Thread Vito De Tullio
Mark Lawrence wrote: >> def __init__(ስ): >> ስ.dummy = None > Apart from breaking all the tools that rely on "self" being spelt "self" > this looks like an excellent idea. too bad for the tools: using the name "self" is just a convention, not a rule. -- By ZeD -- https://mail.pyt

Re: different types of inheritence...

2015-05-26 Thread Ian Kelly
On Tue, May 26, 2015 at 2:52 PM, Michael Torrie wrote: > On 05/26/2015 08:57 AM, zipher wrote: >> Comprende? I'm not trying to be cryptic here. This is a bit of OOP >> theory to be discussed. > > No, sorry. Maybe an actual example (with use case) would spur discussion. Better yet, ignore the t

Re: different types of inheritence...

2015-05-26 Thread Michael Torrie
On 05/26/2015 08:57 AM, zipher wrote: > Comprende? I'm not trying to be cryptic here. This is a bit of OOP > theory to be discussed. No, sorry. Maybe an actual example (with use case) would spur discussion. -- https://mail.python.org/mailman/listinfo/python-list

Re: should "self" be changed?

2015-05-26 Thread Mark Lawrence
On 26/05/2015 21:26, garabik-news-2005...@kassiopeia.juls.savba.sk wrote: zipher wrote: Would it be prudent to rid the long-standing "argument" (pun unintended) about self and the ulterior spellings of it, by changing it into a symbol rather than a name? Something like: class MyClass(object):

Re: should "self" be changed?

2015-05-26 Thread Marko Rauhamaa
Ned Batchelder : > I would find it much clearer to not use a nested class at all, and > instead to pass the object into the constructor: Nested classes are excellent and expressing the state pattern http://en.wikipedia.org/wiki/State_pattern>. Marko -- https://mail.python.org/mailman/listinfo/

Re: should "self" be changed?

2015-05-26 Thread garabik-news-2005-05
zipher wrote: > Would it be prudent to rid the long-standing "argument" (pun > unintended) about self and the ulterior spellings of it, by changing > it into a symbol rather than a name? > > Something like: > > class MyClass(object): > > def __init__(@): > @.dummy = None Believe

Re: should "self" be changed?

2015-05-26 Thread Ned Batchelder
On Tuesday, May 26, 2015 at 3:47:20 PM UTC-4, Marko Rauhamaa wrote: > zipher : > > > Would it be prudent to rid the long-standing "argument" (pun > > unintended) about self and the ulterior spellings of it, by changing > > it into a symbol rather than a name? > > > > Something like: > > > > class

Re: should "self" be changed?

2015-05-26 Thread Marko Rauhamaa
zipher : > Would it be prudent to rid the long-standing "argument" (pun > unintended) about self and the ulterior spellings of it, by changing > it into a symbol rather than a name? > > Something like: > > class MyClass(object): > > def __init__(@): > @.dummy = None > > OR, even better

Re: should "self" be changed?

2015-05-26 Thread random832
On Tue, May 26, 2015, at 12:57, Laura Creighton wrote: > Guido did. :) > http://neopythonic.blogspot.se/2008/10/why-explicit-self-has-to-stay.html It's worth noting that the "dynamically modify a class" argument (and to some extent the decorator argument) misses Javascript's solution - _any_ func

Re: should "self" be changed?

2015-05-26 Thread Chris Angelico
On Wed, May 27, 2015 at 3:28 AM, Mark Lawrence wrote: > Yes, how about you taking a permanent holiday rather than bother this list > with more of your nonsense? No need to be nasty about it. The suggestion is a plausible one, it just happens to not fit Python's philosophy. The best response is to

Re: should "self" be changed?

2015-05-26 Thread Mark Lawrence
On 26/05/2015 17:37, zipher wrote: Would it be prudent to rid the long-standing "argument" (pun unintended) about self and the ulterior spellings of it, by changing it into a symbol rather than a name? Something like: class MyClass(object): def __init__(@): @.dummy = None OR, e

Re: OpenCV with Python (cv or cv2)

2015-05-26 Thread Rustom Mody
On Tuesday, May 26, 2015 at 9:19:35 PM UTC+5:30, Thomas 'PointedEars' Lahn wrote: > Markos wrote: > ^^ > Please append your last name. No more required than an affidavit proving PointedEars is your legal name -- https://mail.python.org/mailman/listinfo/python-list

Re: should "self" be changed?

2015-05-26 Thread Laurent Pointal
zipher wrote: > Would it be prudent to rid the long-standing "argument" (pun unintended) > about self and the ulterior spellings of it, by changing it into a symbol > rather than a name? > > Something like: > > class MyClass(object): > > def __init__(@): > @.dummy = None Just seein

Re: should "self" be changed?

2015-05-26 Thread Laura Creighton
In a message of Tue, 26 May 2015 09:37:29 -0700, zipher writes: >Would it be prudent to rid the long-standing "argument" (pun unintended) about >self and the ulterior spellings of it, by changing it into a symbol rather >than a name? > >Something like: > >class MyClass(object): > >def __ini

should "self" be changed?

2015-05-26 Thread zipher
Would it be prudent to rid the long-standing "argument" (pun unintended) about self and the ulterior spellings of it, by changing it into a symbol rather than a name? Something like: class MyClass(object): def __init__(@): @.dummy = None OR, even better, getting *rid of it* in t

Re: SyntaxError on progress module

2015-05-26 Thread Chris Angelico
On Wed, May 27, 2015 at 1:59 AM, Mark Lawrence wrote: > On 26/05/2015 16:48, alb wrote: >> >> Hi everyone, >> >> I've installed the 'progress' module (ver 1.2) and I have the following >> error when used: >> >>File >> "/home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/pyt

Re: SyntaxError on progress module

2015-05-26 Thread Mark Lawrence
On 26/05/2015 16:48, alb wrote: Hi everyone, I've installed the 'progress' module (ver 1.2) and I have the following error when used: File "/home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/python3.2/site-packages/progress/bar.py", line 48 empty_fill = u'∙'

Re: OpenCV with Python (cv or cv2)

2015-05-26 Thread Thomas 'PointedEars' Lahn
Markos wrote: ^^ Please append your last name. > I want to use OpenCV with Python. > > I installed version 2.4.9 > (http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/) > in debian Squeeze running Python 2.6.6. Using the tutorial: > http://indranilsinharoy.

SyntaxError on progress module

2015-05-26 Thread alb
Hi everyone, I've installed the 'progress' module (ver 1.2) and I have the following error when used: File "/home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/python3.2/site-packages/progress/bar.py", line 48 empty_fill = u'∙' ^ SyntaxError: inv

Re: different types of inheritence...

2015-05-26 Thread zipher
> Apart from object composition or mix-in style, I want to illustrate something > regarding the "arrow" of inheritance. > > class super_dict(dict): > > def __init__(self, init={}, default_value=0, collision_function=None): >*expands what dict can do* > > def get_default(self):

Re: OpenCV with Python (cv or cv2)

2015-05-26 Thread Laura Creighton
In a message of Tue, 26 May 2015 10:24:30 -0300, Markos writes: >Hi, > >I want to use OpenCV with Python. > >I installed version 2.4.9 >(http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/) > >in debian Squeeze running Python 2.6.6. Using the tutorial: >http:/

Re: a more precise distance algorithm

2015-05-26 Thread random832
On Tue, May 26, 2015, at 09:40, random...@fastmail.us wrote: > On Mon, May 25, 2015, at 15:21, ravas wrote: > > Is this valid? Does it apply to python? > > Any other thoughts? :D > > The math.hypot function uses the C library's function which should deal > with such concerns internally. There is a

OpenCV with Python (cv or cv2)

2015-05-26 Thread Markos
Hi, I want to use OpenCV with Python. I installed version 2.4.9 (http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/) in debian Squeeze running Python 2.6.6. Using the tutorial: http://indranilsinharoy.com/2012/11/01/installing-opencv-on-linux/ (I tried t

Re: a more precise distance algorithm

2015-05-26 Thread random832
On Mon, May 25, 2015, at 15:21, ravas wrote: > Is this valid? Does it apply to python? > Any other thoughts? :D The math.hypot function uses the C library's function which should deal with such concerns internally. There is a fallback version in case the C library does not have this function, in P

Re: Json Comaprision

2015-05-26 Thread pra devOPS
Hey all thanks for the answers, I am done wiht the same . Sorry fore delayed replied On Wed, May 6, 2015 at 9:27 AM, John Gordon wrote: > In pra devOPS < > siv.dev...@gmail.com> writes: > > > I wanted to compare two json files ignoring few of the keys in the json > > files. > > > Can anybody

Re: Creating a reliable sandboxed Python environment

2015-05-26 Thread marco . nawijn
On Tuesday, May 26, 2015 at 4:24:32 AM UTC+2, davi...@gmail.com wrote: > I am writing a web service that accepts Python programs as input, runs the > provided program with some profiling hooks, and returns various information > about the program's runtime behavior. To do this in a safe manner, I

Re: Creating a reliable sandboxed Python environment

2015-05-26 Thread Ned Batchelder
On Monday, May 25, 2015 at 10:24:32 PM UTC-4, davi...@gmail.com wrote: > I am writing a web service that accepts Python programs as input, runs the > provided program with some profiling hooks, and returns various information > about the program's runtime behavior. To do this in a safe manner, I

Re: Creating a reliable sandboxed Python environment

2015-05-26 Thread Laura Creighton
In a message of Tue, 26 May 2015 09:53:56 +0200, Laura Creighton writes: >In a message of Tue, 26 May 2015 17:10:30 +1000, "Steven D'Aprano" writes: >>My sense is that the only way to safely sandbox Python is to create your own >>Python implementation designed with security in mind. You can't get

Re: Creating a reliable sandboxed Python environment

2015-05-26 Thread Laura Creighton
In a message of Tue, 26 May 2015 17:10:30 +1000, "Steven D'Aprano" writes: >My sense is that the only way to safely sandbox Python is to create your own >Python implementation designed with security in mind. You can't get there >starting from CPython. Maybe Jython? You get there starting with Py

Re: Documentaion of dunder methods

2015-05-26 Thread Mark Lawrence
On 26/05/2015 04:30, Rustom Mody wrote: On Tuesday, May 26, 2015 at 8:48:11 AM UTC+5:30, Steven D'Aprano wrote: On Tue, 26 May 2015 12:17 pm, Steven D'Aprano wrote: In other words, dunder methods are reserved for use by the core developers for the use of the Python interpreter. Er, that's ea

Re: Documentaion of dunder methods

2015-05-26 Thread Steven D'Aprano
On Tuesday 26 May 2015 14:34, Ian Kelly wrote: >> Apart from PEP 8, is this documented anywhere in the official >> documentation? If so, I have been unable to find it. > > https://docs.python.org/3/reference/lexical_analysis.html#reserved- classes-of-identifiers That's the bunny! Thanks for th

Re: Creating a reliable sandboxed Python environment

2015-05-26 Thread Steven D'Aprano
On Tuesday 26 May 2015 12:24, davidf...@gmail.com wrote: > I am writing a web service that accepts Python programs as input, runs the > provided program with some profiling hooks, and returns various > information about the program's runtime behavior. To do this in a safe > manner, I need to be ab