Re: should "self" be changed?

2015-06-03 Thread Steven D'Aprano
On Wednesday 03 June 2015 03:19, Marko Rauhamaa wrote: > Steven D'Aprano : > >> On Fri, 29 May 2015 12:00 pm, Steven D'Aprano wrote: >> >> [...] >>> in a language where classes are >>> themselves values, there is no reason why a class must be instantiated, >>> particularly if you're only using a

Re: should "self" be changed?

2015-06-02 Thread Ian Kelly
On Tue, Jun 2, 2015 at 11:19 AM, Marko Rauhamaa wrote: > Steven D'Aprano : > >> On Fri, 29 May 2015 12:00 pm, Steven D'Aprano wrote: >> >> [...] >>> in a language where classes are >>> themselves values, there is no reason why a class must be instantiated, >>> particularly if you're only using a s

Re: should "self" be changed?

2015-06-02 Thread Marko Rauhamaa
Steven D'Aprano : > On Fri, 29 May 2015 12:00 pm, Steven D'Aprano wrote: > > [...] >> in a language where classes are >> themselves values, there is no reason why a class must be instantiated, >> particularly if you're only using a single instance of the class. Anyone >> ever come across a named

Re: should "self" be changed?

2015-06-02 Thread Steven D'Aprano
On Fri, 29 May 2015 12:00 pm, Steven D'Aprano wrote: [...] > in a language where classes are > themselves values, there is no reason why a class must be instantiated, > particularly if you're only using a single instance of the class. Anyone > ever come across a named design pattern that involves

Re: should "self" be changed?

2015-05-30 Thread zipher
On Thursday, May 28, 2015 at 11:59:36 AM UTC-5, Marko Rauhamaa wrote: > Ian Kelly : > > I think I would be more inclined to use enums. This has the advantages > > of not creating a new set of state classes for every connection > > instance and that each state is a singleton instance, allowing thing

Re: should "self" be changed?

2015-05-30 Thread zipher
On Wednesday, May 27, 2015 at 8:00:49 AM UTC-5, Todd wrote: > On Wed, May 27, 2015 at 2:40 PM, zipher wrote: > On Wednesday, May 27, 2015 at 6:30:16 AM UTC-5, Ben Finney wrote: > > > Steven D'Aprano writes: > > > > > > > On Wednesday 27 May 2015 14:39, Ben Finney wrote: > > > > > > > > > Tha

Re: should "self" be changed?

2015-05-30 Thread zipher
On Wednesday, May 27, 2015 at 2:39:21 AM UTC-5, Marko Rauhamaa wrote: > Chris Angelico : > > > Using some other name in place of "self" should definitely remain > > *possible*, but not commonly done. > > You are effectively making the argument that Python has made a mistake > by not giving "self"

Re: should "self" be changed?

2015-05-30 Thread zipher
On Wednesday, May 27, 2015 at 12:48:02 AM UTC-5, Steven D'Aprano wrote: > 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. > >

Re: should "self" be changed?

2015-05-30 Thread zipher
On Tuesday, May 26, 2015 at 11:40:20 PM UTC-5, 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. Ben, he asked for it. Stop assuming. > That kind of homophobic slur is ina

Re: should "self" be changed?

2015-05-28 Thread Steven D'Aprano
On Fri, 29 May 2015 12:00 pm, Steven D'Aprano wrote: > I haven't studied this in close detail, but first impressions is that this > is not well-written Python code. The obvious problems that come to mind: Well, first impressions can be misleading... I wrote the above, thinking that there were mor

Re: should "self" be changed?

2015-05-28 Thread Steven D'Aprano
On Fri, 29 May 2015 01:01 am, Marko Rauhamaa wrote: > Anssi Saari : > >> Do you have an example of state pattern using nested classes and >> python? With a quick look I didn't happen to find one in any language. > > Here's an sampling from my mail server: I haven't studied this in close detail

Re: should "self" be changed?

2015-05-28 Thread Chris Angelico
On Fri, May 29, 2015 at 2:59 AM, Marko Rauhamaa wrote: > When I have coded state machines for C or Java, I have noticed that > nothing beats enums and switch statements performance-wise, and > expressively, they're not that bad, either. Python doesn't have a switch > statement, so the natural thin

Re: should "self" be changed?

2015-05-28 Thread Marko Rauhamaa
Ian Kelly : > On Thu, May 28, 2015 at 9:01 AM, Marko Rauhamaa wrote: >> Anssi Saari : >> >>> Do you have an example of state pattern using nested classes and >>> python? With a quick look I didn't happen to find one in any >>> language. >> >> Here's an sampling from my mail server: > > I think I

Re: should "self" be changed?

2015-05-28 Thread Ian Kelly
On Thu, May 28, 2015 at 9:01 AM, Marko Rauhamaa wrote: > Anssi Saari : > >> Do you have an example of state pattern using nested classes and >> python? With a quick look I didn't happen to find one in any language. > > Here's an sampling from my mail server: I think I would be more inclined to us

Re: should "self" be changed?

2015-05-28 Thread Marko Rauhamaa
Anssi Saari : > Do you have an example of state pattern using nested classes and > python? With a quick look I didn't happen to find one in any language. Here's an sampling from my mail server: class SMTPServerConnection(Se

Re: should "self" be changed?

2015-05-28 Thread Anssi Saari
Marko Rauhamaa writes: > 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>. Do you have an exa

Re: should "self" be changed?

2015-05-27 Thread Terry Reedy
On 5/27/2015 2:32 AM, Chris Angelico wrote: 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

Re: should "self" be changed?

2015-05-27 Thread Grant Edwards
On 2015-05-27, Todd wrote: > On Wed, May 27, 2015 at 2:40 PM, zipher wrote: > >> [some stupid crap] > > If your goal is to get people to stop calling you a troll, you are > going about it the wrong way. If it isn't, why are you even here? > Please remember the first rule of holes: if you find yo

Re: should "self" be changed?

2015-05-27 Thread Todd
On Wed, May 27, 2015 at 2:40 PM, zipher wrote: > On Wednesday, May 27, 2015 at 6:30:16 AM UTC-5, Ben Finney wrote: > > Steven D'Aprano writes: > > > > > On Wednesday 27 May 2015 14:39, Ben Finney wrote: > > > > > > > That kind of homophobic slur is inappropriate from anyone in this > > > > commu

Re: should "self" be changed?

2015-05-27 Thread zipher
On Wednesday, May 27, 2015 at 6:30:16 AM UTC-5, Ben Finney wrote: > Steven D'Aprano writes: > > > On Wednesday 27 May 2015 14:39, Ben Finney wrote: > > > > > That kind of homophobic slur is inappropriate from anyone in this > > > community. Kindly cut it out altogether. > > > > I look forward to

Re: should "self" be changed?

2015-05-27 Thread Ben Finney
Steven D'Aprano writes: > On Wednesday 27 May 2015 14:39, Ben Finney wrote: > > > That kind of homophobic slur is inappropriate from anyone in this > > community. Kindly cut it out altogether. > > I look forward to the day when people would read the earlier insult > and be perplexed as to why it

Re: should "self" be changed?

2015-05-27 Thread Chris Angelico
On Wed, May 27, 2015 at 5:39 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> Using some other name in place of "self" should definitely remain >> *possible*, but not commonly done. > > You are effectively making the argument that Python has made a mistake > by not giving "self" a special, langua

Re: should "self" be changed?

2015-05-27 Thread Marko Rauhamaa
Chris Angelico : > Using some other name in place of "self" should definitely remain > *possible*, but not commonly done. You are effectively making the argument that Python has made a mistake by not giving "self" a special, language-level status. Marko -- https://mail.python.org/mailman/listi

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

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