On Tuesday, March 28, 2017 at 3:09:45 AM UTC-5, loial wrote:
> Can I pass self(or all its variables) to a class?
> Basically, how do I make all the variables defined in self
> in the calling python script available to the python class
> I want to call?
Your question, as presented, is difficult to
On 3/28/2017 4:09 AM, loial wrote:
Can I pass self(or all its variables) to a class?
In Python, every argument to every function is an instance of some
class. The function can access any attribute of the arguments it
receives with arg.attribute.
--
Terry Jan Reedy
--
https://mail.python.o
loial wrote:
> Can I pass self(or all its variables) to a class?
>
> Basically, how do I make all the variables defined in self in the calling
> python script available to the python class I want to call?
Inside a method you can access attributes of an instance as self.whatever:
>>> class A:
..
Can I pass self(or all its variables) to a class?
Basically, how do I make all the variables defined in self in the calling
python script available to the python class I want to call?
--
https://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano writes:
> However, be warned that there are two subtly different models for
> delegation. Here's the one that people seem to forget:
>
> http://code.activestate.com/recipes/519639-true-lieberman-style-delegation-in-python/
Very interesting!
The recipe at that URL works only on P
dieter wrote:
> "Ivan Evstegneev" writes:
>> I have a question about "delegation" coding pattern(I'm working with
>> Python 3.4).
>
> Unlike Java, Python supports "multiple inheritance". This means
> that you need "delegation" much more rarely in Python.
> Python does not have much special suppo
"Ivan Evstegneev" writes:
> I have a question about "delegation" coding pattern(I'm working with Python
> 3.4).
Unlike Java, Python supports "multiple inheritance". This means
that you need "delegation" much more rarely in Python.
Python does not have much special support for delegation: usually,
t; From: Python-list [mailto:python-list-
> bounces+webmailgroups=gmail@python.org] On Behalf Of Steven
> D'Aprano
> Sent: Monday, December 15, 2014 04:01
> To: python-list@python.org
> Subject: Re: Classes - converting external function to class's method.
>
> Thomas 'Poi
Thomas 'PointedEars' Lahn wrote:
> Ivan Evstegneev wrote:
>
>> I have stuck a bit with this example(took this one from the book).
>>
>> Here are a description steps of what I've done till now:
>>
>>
>> Step 1 - creating an empty namespace:
>>
>class rec: pass
>
> IMHO that is not actual
Terry Reedy wrote:
> On 12/14/2014 6:15 PM, Thomas 'PointedEars' Lahn wrote:
>> Ivan Evstegneev wrote:
>>> I have stuck a bit with this example(took this one from the book).
>>>
>>> Here are a description steps of what I've done till now:
>>>
>>> Step 1 - creating an empty namespace:
>>>
>> cl
On 12/14/2014 6:15 PM, Thomas 'PointedEars' Lahn wrote:
Ivan Evstegneev wrote:
I have stuck a bit with this example(took this one from the book).
Here are a description steps of what I've done till now:
Step 1 - creating an empty namespace:
class rec: pass
IMHO that is not actually creat
Ivan Evstegneev wrote:
> I have stuck a bit with this example(took this one from the book).
>
> Here are a description steps of what I've done till now:
>
>
> Step 1 - creating an empty namespace:
>
class rec: pass
IMHO that is not actually creating a namespace; it is just
declaring/def
7;Bob'
> age = 40
> def method(obj):
> return obj.name.upper()
Moreover, regard to the "rec.method = uppername"
As I can understand, in this case Python does make some changes to the
function, but they are implicit.
Am I right?
Sincerely,
Ivan
>
Ivan Evstegneev wrote:
> Hello Everyone,
>
> I have stuck a bit with this example(took this one from the book).
The example you are working on (adding external functions as methods) is
actually a bit more complicated than it seems, as you have discovered. You
have this:
class rec: pass
rec.name
Jean-Michel Pichavant wrote:
Python uses the descriptor protocol which is
basically getters and setters. It's is just hidden by a strange decorator
syntax.
This is about the interface, not the implementation.
"Getters and setters" in this context means designing
the API of your class to have th
Denis McMahon wrote:
On Mon, 03 Nov 2014 06:29:39 +, Dan Sommers wrote:
What's the difference between a Diamond and a Rhombus?
Oops, I was thinking a rhombus was a general parallelogram, my mistake.
Some diamonds are neither rhombuses nor parallelograms:
http://minecraft.gamepedia.co
On Mon, 03 Nov 2014 06:29:39 +, Dan Sommers wrote:
> On Mon, 03 Nov 2014 03:12:32 +, Denis McMahon wrote:
>
>> Quadrilateral
>> Parallelogram
>> Square Rectangle Rhombus Diamond (4 sides eq)
>> Trapezoid
>> Arrowhead
>
> What's the difference between a Diamond and
Jean-Michel Pichavant wrote:
I agree with Steven on that one, while getters/setters are not the preferred
way, they are not utterly wrong.
I'm not saying that they're wrong in general, only that
they're wrong for *Python*.
This matters, because the course in question is purportedly
teaching P
On Tue, Nov 4, 2014 at 12:50 AM, Dennis Lee Bieber
wrote:
> On Mon, 3 Nov 2014 03:12:32 + (UTC), Denis McMahon
> declaimed the following:
>
>>So:
>>
>>Quadrilateral
>>Parallelogram
>>Square
>>Rectangle
>>Rhombus
>>Diamond (4 sides eq)
>>Trapezoid
>>
On Nov 2, 2014 5:31 AM, "Denis McMahon" wrote:
> And perhaps that also addresses the square - rectangle (or circle -
> ellipse) issue - square, rectangle and rhombus are all forms of
> quadrilateral, and perhaps should all inherit a base class Quadrilateral,
> rather than trying (and partially fai
- Original Message -
> From: "Gregory Ewing"
> Steven D'Aprano wrote:
> > Like all good Pythonistas[1], we hate Java and think that
> > getter/setter
> > methods are pointless. But come on, they're not *wrong*,
>
> What's wrong is the statement that getters and setters
> are necessary to
On Mon, 03 Nov 2014 03:12:32 +, Denis McMahon wrote:
> Quadrilateral
> Parallelogram
> Square
> Rectangle
> Rhombus
> Diamond (4 sides eq)
> Trapezoid
> Arrowhead
What's the difference between a Diamond and a Rhombus?
> Is an arrowhead a trapez
On Sun, 02 Nov 2014 11:31:12 -0500, Dennis Lee Bieber wrote:
> On Sun, 2 Nov 2014 12:27:06 + (UTC), Denis McMahon
> declaimed the following:
>
>>On Sun, 02 Nov 2014 21:32:13 +1100, Tim Delaney wrote:
>>> If course, that's probably because rectangles have a multitude of uses
>>> for user int
On 11/02/2014 01:50 AM, Denis McMahon wrote:
[snip]
from math import sqrt
class SquareGeometryError(Exception):
"""The parameters create an illegal geometry for a square"""
pass
class Rectangle:
def __init__(self,length,width):
self.length=length
self.width=wid
On Sun, 02 Nov 2014 21:32:13 +1100, Tim Delaney wrote:
> On 2 November 2014 20:50, Denis McMahon
> wrote:
>
>> The question (I thought) was to write a class for Square that inherited
>> a class Rectangle but imposed on it the additional constraints of a
>> square over a rectangle, namely that le
Steven D'Aprano wrote:
Like all good Pythonistas[1], we hate Java and think that getter/setter
methods are pointless. But come on, they're not *wrong*,
What's wrong is the statement that getters and setters
are necessary to allow the implementation to change
without changing the interface. That
On 2 November 2014 20:50, Denis McMahon wrote:
>
> The question (I thought) was to write a class for Square that inherited a
> class Rectangle but imposed on it the additional constraints of a square
> over a rectangle, namely that length == width.
>
I'm late to the party and this has already be
On Sat, 01 Nov 2014 12:42:10 -0400, Seymore4Head wrote:
> OK Maybe I misunderstood the question.
>
> My answer to you then is ..I don't know. I will have to think about
> it some more.
The question (I thought) was to write a class for Square that inherited a
class Rectangle but imposed on
On Sat, 01 Nov 2014 12:00:46 -0400, Dennis Lee Bieber
wrote:
>On Fri, 31 Oct 2014 19:32:13 -0400, Seymore4Head
> declaimed the following:
>
>>
>>class Rectangle(object):
>>def __init__(self, length, width=None):
>>self.length = length
>>if width is None:
>>self.wid
On Sat, Nov 1, 2014 at 5:12 PM, Ian Kelly wrote:
> On Fri, Oct 31, 2014 at 7:06 PM, Steven D'Aprano
> wrote:
>> And there are times when using getters and setters is the right choice.
>> Properties should only be used for quite lightweight calculations, because
>> attribute access is supposed to
On Fri, Oct 31, 2014 at 7:06 PM, Steven D'Aprano
wrote:
> And there are times when using getters and setters is the right choice.
> Properties should only be used for quite lightweight calculations, because
> attribute access is supposed to be fast. If your calculation is complex,
> time-consuming
Gregory Ewing wrote:
> Seymore4Head wrote:
>> The course is free. You can't beat the price. It is only for a few
>> more weeks.
>
> But if it's teaching you things that are blatantly wrong
> in relation to Python, it may be doing more harm than
> good.
Like all good Pythonistas[1], we hate Jav
Dennis Lee Bieber wrote:
> What you are being taught is NOT PYTHON.
Of course it is. It uses Python syntax, Python terminology, and the Python
compiler. It might not be the preferred Python idiom or best practice, but
it's still Python code.
Exaggeration does not help anyone, it just makes us lo
On Fri, 31 Oct 2014 19:22:13 -0400, Seymore4Head
wrote:
>On Fri, 31 Oct 2014 18:57:31 -0400, Dennis Lee Bieber
> wrote:
>
>>On Fri, 31 Oct 2014 14:18:44 -0400, Seymore4Head
>> declaimed the following:
>>
>>>On Fri, 31 Oct 2014 10:43:19 -0700, Rob Gaddi
>>> wrote:
>>>
>>>
Define a Square class
On Fri, 31 Oct 2014 18:57:31 -0400, Dennis Lee Bieber
wrote:
>On Fri, 31 Oct 2014 14:18:44 -0400, Seymore4Head
> declaimed the following:
>
>>On Fri, 31 Oct 2014 10:43:19 -0700, Rob Gaddi
>> wrote:
>>
>>
>>>Define a Square class, subclassed from Rectangle. Use getters/setters
>>>to enforce that
Seymore4Head wrote:
The course is free. You can't beat the price. It is only for a few
more weeks.
But if it's teaching you things that are blatantly wrong
in relation to Python, it may be doing more harm than
good.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, Nov 1, 2014 at 8:40 AM, Rob Gaddi
wrote:
> For this specific exercise, a Square is a subclass of Rectangle because
> the point of Rectangle is to demonstrate that extraneous get/set
> functions are completely unnecessary in Python. The point of
> Square is to demonstrate that get/set func
On Fri, 31 Oct 2014 14:24:11 -0700 (PDT)
sohcahto...@gmail.com wrote:
> On Friday, October 31, 2014 1:51:23 PM UTC-7, Chris Angelico wrote:
> > On Sat, Nov 1, 2014 at 4:43 AM, Rob Gaddi
> > wrote:
> > > Define a Square class, subclassed from Rectangle. Use getters/setters
> > > to enforce that t
On Sat, Nov 1, 2014 at 8:24 AM, wrote:
> I've never heard of the Circle-Ellipse problem, and my first instinct to
> Rob's post was to ask, why would you want to sub-class Rectangle into a
> Square class? A square is just a special case of a Rectangle. Attempting
> that kind of sub-classing w
On Friday, October 31, 2014 1:51:23 PM UTC-7, Chris Angelico wrote:
> On Sat, Nov 1, 2014 at 4:43 AM, Rob Gaddi
> wrote:
> > Define a Square class, subclassed from Rectangle. Use getters/setters
> > to enforce that the length and width must be equal. Confirm that
> > length and width remain lock
On Sat, Nov 1, 2014 at 4:43 AM, Rob Gaddi
wrote:
> Define a Square class, subclassed from Rectangle. Use getters/setters
> to enforce that the length and width must be equal. Confirm that
> length and width remain locked, and that perimeter() and area() work
> correctly.
Here we go again...
ht
On Fri, 31 Oct 2014 14:41:08 -0400, Joel Goldstick
wrote:
>On Fri, Oct 31, 2014 at 2:31 PM, ast wrote:
>>
>> "Seymore4Head" a écrit dans le message de
>> news:rbf75ah9l1jp9e72gqr0ncu7bau8cnt...@4ax.com...
>>
>>> What material have you used to take you up to classes?
>>
>>
>> It's a french class
On Fri, 31 Oct 2014 14:18:44 -0400, Seymore4Head
wrote:
>On Fri, 31 Oct 2014 10:43:19 -0700, Rob Gaddi
> wrote:
>
>
>>Define a Square class, subclassed from Rectangle. Use getters/setters
>>to enforce that the length and width must be equal. Confirm that
>>length and width remain locked, and th
On Fri, Oct 31, 2014 at 2:31 PM, ast wrote:
>
> "Seymore4Head" a écrit dans le message de
> news:rbf75ah9l1jp9e72gqr0ncu7bau8cnt...@4ax.com...
>
>> What material have you used to take you up to classes?
>
>
> It's a french classroom on the web
> http://openclassrooms.com/courses/apprenez-a-progra
On Fri, 31 Oct 2014 19:31:01 +0100, "ast" wrote:
>
>"Seymore4Head" a écrit dans le message de
>news:rbf75ah9l1jp9e72gqr0ncu7bau8cnt...@4ax.com...
>
>> What material have you used to take you up to classes?
>
>It's a french classroom on the web
>http://openclassrooms.com/courses/apprenez-a-progr
"Seymore4Head" a écrit dans le message de
news:rbf75ah9l1jp9e72gqr0ncu7bau8cnt...@4ax.com...
What material have you used to take you up to classes?
It's a french classroom on the web
http://openclassrooms.com/courses/apprenez-a-programmer-en-python
--
https://mail.python.org/mailman/lis
On Fri, 31 Oct 2014 10:43:19 -0700, Rob Gaddi
wrote:
>Define a Square class, subclassed from Rectangle. Use getters/setters
>to enforce that the length and width must be equal. Confirm that
>length and width remain locked, and that perimeter() and area() work
>correctly.
class Rectangle:
On Fri, 31 Oct 2014 12:39:34 -0500, Zachary Ware
wrote:
>On Fri, Oct 31, 2014 at 12:31 PM, Seymore4Head
> wrote:
>> I run across this page frequently. To me, this is examples. While
>> examples can be quite useful, I don't call this a tutorial. I have
>> found the answer to my question by sear
On Fri, 31 Oct 2014 13:18:00 -0400
Seymore4Head wrote:
> On Sat, 01 Nov 2014 04:06:44 +1100, Steven D'Aprano
> wrote:
>
> >Seymore4Head wrote:
> >
> >> Because the topic of that lesson was getter setter.
> >> I can construct an __init___ but I was practicing get/set.
> >
> >What lesson is that
On 2014-10-31, Seymore4Head wrote:
> On Sat, 01 Nov 2014 04:06:44 +1100, Steven D'Aprano
>>Let's make the class a bit easier to use, at the expense of doing a bit more
>>work up front:
>>
>>class MyClass:
>>def __init__(self, value, message):
>>self.value = value
>>self.messag
On 2014-10-31, Seymore4Head wrote:
> On Fri, 31 Oct 2014 15:49:43 + (UTC), Grant Edwards
> wrote:
>
>>On 2014-10-31, Ian Kelly wrote:
>>> On Fri, Oct 31, 2014 at 8:05 AM, Seymore4Head
>>> wrote:
Because the topic of that lesson was getter setter.
I can construct an __init___ but I
On Fri, 31 Oct 2014 13:31:44 -0400
Seymore4Head wrote:
> On Sat, 1 Nov 2014 04:02:33 +1100, Chris Angelico
> wrote:
>
> >On Sat, Nov 1, 2014 at 3:47 AM, Seymore4Head
> > wrote:
> >> inbuilt tutorial?
> >>
> >> The course is free. You can't beat the price. It is only for a few
> >> more weeks.
On Fri, Oct 31, 2014 at 12:31 PM, Seymore4Head
wrote:
> I run across this page frequently. To me, this is examples. While
> examples can be quite useful, I don't call this a tutorial. I have
> found the answer to my question by searching this page several times,
> but the biggest problem with t
Seymore4Head :
> In this class, we will follow the practice of accessing the contents
> of objects using methods known as getters and setters.
The biggest problem in this OO disease is that it makes you think of
objects as data containers instead of dynamic agents.
An object is defined through i
On Sat, 1 Nov 2014 04:02:33 +1100, Chris Angelico
wrote:
>On Sat, Nov 1, 2014 at 3:47 AM, Seymore4Head
> wrote:
>> inbuilt tutorial?
>>
>> The course is free. You can't beat the price. It is only for a few
>> more weeks.
>>
>> Trying to learn from reading the Internet has no set direction. I
>
On Sat, 01 Nov 2014 04:06:44 +1100, Steven D'Aprano
wrote:
>Seymore4Head wrote:
>
>> Because the topic of that lesson was getter setter.
>> I can construct an __init___ but I was practicing get/set.
>
>What lesson is that? Using getters/setters is discouraged in Python.
>
>> This stuff is coming
On 10/31/2014 12:31 PM, Seymore4Head wrote:
In this class, we will follow the practice of accessing the contents
of objects using methods known as getters and setters. While not
required by Python, this practice encourages the user of the class to
manipulates class objects solely via class metho
Seymore4Head wrote:
> Because the topic of that lesson was getter setter.
> I can construct an __init___ but I was practicing get/set.
What lesson is that? Using getters/setters is discouraged in Python.
> This stuff is coming to me slowly. I need to rinse and repeat quite a
> few more times,
On Sat, Nov 1, 2014 at 3:47 AM, Seymore4Head
wrote:
> inbuilt tutorial?
>
> The course is free. You can't beat the price. It is only for a few
> more weeks.
>
> Trying to learn from reading the Internet has no set direction. I
> need a little nudge. More like a shove.
https://docs.python.org/
On Fri, 31 Oct 2014 10:05:03 +0100, "ast" wrote:
>
>"Seymore4Head" a écrit dans le message de
>news:51755at03r0bidjqh3qf0hhpvjr8756...@4ax.com...
>> class pet:
>>def set_age(self,age):
>>self.age=age
>>def get_age(self):
>>return self.age
>> pax=pet
>> pax.set_age(4)
>>
On Sat, 1 Nov 2014 03:37:29 +1100, Chris Angelico
wrote:
>On Sat, Nov 1, 2014 at 3:31 AM, Seymore4Head
> wrote:
>[presumably quoting his course material]
>> In this class, we will follow the practice of accessing the contents
>> of objects using methods known as getters and setters. While not
>>
On Sat, Nov 1, 2014 at 3:31 AM, Seymore4Head
wrote:
[presumably quoting his course material]
> In this class, we will follow the practice of accessing the contents
> of objects using methods known as getters and setters. While not
> required by Python, this practice encourages the user of the clas
On Fri, 31 Oct 2014 15:49:43 + (UTC), Grant Edwards
wrote:
>On 2014-10-31, Ian Kelly wrote:
>> On Fri, Oct 31, 2014 at 8:05 AM, Seymore4Head
>> wrote:
>>> Because the topic of that lesson was getter setter.
>>> I can construct an __init___ but I was practicing get/set.
>>
>> Doesn't sound l
On 2014-10-31, Ian Kelly wrote:
> On Fri, Oct 31, 2014 at 8:05 AM, Seymore4Head
> wrote:
>> Because the topic of that lesson was getter setter.
>> I can construct an __init___ but I was practicing get/set.
>
> Doesn't sound like a very good lesson to me.
It's not. It's teaching java or C++ or s
On Fri, Oct 31, 2014 at 8:05 AM, Seymore4Head
wrote:
> Because the topic of that lesson was getter setter.
> I can construct an __init___ but I was practicing get/set.
Doesn't sound like a very good lesson to me. Getters and setters are
the Java way of doing things. The Pythonic way is to just u
On Fri, 31 Oct 2014 09:59:30 GMT, alister
wrote:
>On Thu, 30 Oct 2014 17:34:57 -0400, Seymore4Head wrote:
>
>> On Thu, 30 Oct 2014 14:28:19 -0700, Larry Hudson
>> wrote:
>>
>>>On 10/30/2014 01:16 PM, Seymore4Head wrote:
class pet:
def set_age(self,age):
self.age=age
On 31/10/2014 09:05, ast wrote:
"Seymore4Head" a écrit dans le message de
news:51755at03r0bidjqh3qf0hhpvjr8756...@4ax.com...
class pet:
def set_age(self,age):
self.age=age
def get_age(self):
return self.age
pax=pet
pax.set_age(4)
Traceback (most recent call last):
File "C
On Fri, 31 Oct 2014 10:05:03 +0100, "ast" wrote:
>
>"Seymore4Head" a écrit dans le message de
>news:51755at03r0bidjqh3qf0hhpvjr8756...@4ax.com...
>> class pet:
>>def set_age(self,age):
>>self.age=age
>>def get_age(self):
>>return self.age
>> pax=pet
>> pax.set_age(4)
>>
On Thu, 30 Oct 2014 17:34:57 -0400, Seymore4Head wrote:
> On Thu, 30 Oct 2014 14:28:19 -0700, Larry Hudson
> wrote:
>
>>On 10/30/2014 01:16 PM, Seymore4Head wrote:
>>> class pet:
>>> def set_age(self,age):
>>> self.age=age
>>> def get_age(self):
>>> return self.age
>>
On Fri, Oct 31, 2014 at 8:18 PM, ast wrote:
>
> But this means that a method can create a new
> attribute not previously created with __init__.
> Is that correct ?
That's always the case. There's nothing special about __init__ for
creating attributes.
ChrisA
--
https://mail.python.org/mailman/l
"ast" a écrit dans le message de
news:545350c3$0$23449$426a7...@news.free.fr...
I am a beginner too, but I find it strange that your
pet class has no __init__ method to construct
instances
It works anyway because __init__ is taken in the
parent Class, probably Object.
But this means that a
"Seymore4Head" a écrit dans le message de
news:51755at03r0bidjqh3qf0hhpvjr8756...@4ax.com...
class pet:
def set_age(self,age):
self.age=age
def get_age(self):
return self.age
pax=pet
pax.set_age(4)
Traceback (most recent call last):
File "C:\Functions\test.py", line 18, i
On Thursday, October 30, 2014 2:37:54 PM UTC-7, Seymore4Head wrote:
> On Thu, 30 Oct 2014 14:28:19 -0700, Larry Hudson
> wrote:
>
> >On 10/30/2014 01:16 PM, Seymore4Head wrote:
> >> class pet:
> >> def set_age(self,age):
> >> self.age=age
> >> def get_age(self):
> >> r
On Thu, 30 Oct 2014 14:28:19 -0700, Larry Hudson
wrote:
>On 10/30/2014 01:16 PM, Seymore4Head wrote:
>> class pet:
>> def set_age(self,age):
>> self.age=age
>> def get_age(self):
>> return self.age
>> pax=pet
>> pax.set_age(4)
>>
>> Traceback (most recent call last):
>
On 10/30/2014 01:16 PM, Seymore4Head wrote:
class pet:
def set_age(self,age):
self.age=age
def get_age(self):
return self.age
pax=pet
pax.set_age(4)
Traceback (most recent call last):
File "C:\Functions\test.py", line 18, in
pax.set_age(4)
TypeError: set_age(
On Thu, 30 Oct 2014 13:34:04 -0700, Rob Gaddi
wrote:
>On Thu, 30 Oct 2014 16:16:51 -0400
>Seymore4Head wrote:
>
>> class pet:
>> def set_age(self,age):
>> self.age=age
>> def get_age(self):
>> return self.age
>> pax=pet
>> pax.set_age(4)
>>
>> Traceback (most recent cal
On Thu, 30 Oct 2014 13:33:01 -0700 (PDT), sohcahto...@gmail.com wrote:
>On Thursday, October 30, 2014 1:19:57 PM UTC-7, Seymore4Head wrote:
>> class pet:
>> def set_age(self,age):
>> self.age=age
>> def get_age(self):
>> return self.age
>> pax=pet
>> pax.set_age(4)
>>
>>
On Thursday, October 30, 2014 1:19:57 PM UTC-7, Seymore4Head wrote:
> class pet:
> def set_age(self,age):
> self.age=age
> def get_age(self):
> return self.age
> pax=pet
> pax.set_age(4)
>
> Traceback (most recent call last):
> File "C:\Functions\test.py", line 18, in
>
On Thu, 30 Oct 2014 16:16:51 -0400
Seymore4Head wrote:
> class pet:
> def set_age(self,age):
> self.age=age
> def get_age(self):
> return self.age
> pax=pet
> pax.set_age(4)
>
> Traceback (most recent call last):
> File "C:\Functions\test.py", line 18, in
> pax.se
On Tue, Oct 28, 2014 at 3:08 PM, Terry Reedy wrote:
>> It's inconsistent only because the default sys.ps2 is those dots,
>> which aren't necessary in Idle. You could make it consistent by simply
>> changing sys.ps2.
>
>
> Nope. User code is executed in the user process. Its only effect on the
>
On 10/26/2014 11:28 PM, Seymore4Head wrote:
I am going to be flexible on IDLE in the near future, but I wanted to
try it the old fashion way. I already know using IDLE is better, but
I am not sure using IDLE will invoke Python 2 and I am not sure how to
change that at the moment.
Currently, I
On 10/26/2014 11:24 PM, Chris Angelico wrote:
On Mon, Oct 27, 2014 at 2:18 PM, Rustom Mody wrote:
On Monday, October 27, 2014 8:40:48 AM UTC+5:30, Chris Angelico wrote:
You can get block-by-block history by using Idle. I find that fairly
convenient for manipulating class/function definitions
On Sun, 26 Oct 2014 23:32:08 -0400, Seymore4Head
wrote:
>On Mon, 27 Oct 2014 14:06:11 +1100, Ben Finney
> wrote:
>
>>Seymore4Head writes:
>>
>>> I am trying to learn classes.
>>> I am currently using Python 2.7 at the command line.
>>
>>(I think you mean the interactive Python interpreter, or
On Mon, Oct 27, 2014 at 10:17 PM, alister
wrote:
> Notepad+ is also often suggested along with many other programmer editors/
> Integrated development environments (IDE).
That would be Notepad++, and yes, it's fairly well recommended. It's
based on the same edit component as SciTE, another good e
On Sun, 26 Oct 2014 23:32:08 -0400, Seymore4Head wrote:
> On Mon, 27 Oct 2014 14:06:11 +1100, Ben Finney
> wrote:
>
>>Seymore4Head writes:
>>
>>> I am trying to learn classes.
>>> I am currently using Python 2.7 at the command line.
>>
>>(I think you mean the interactive Python interpreter, o
- Original Message -
> From: "Seymore4Head"
> To: python-list@python.org
> Sent: Monday, 27 October, 2014 3:27:18 AM
> Subject: Classes and the command line
>
> I am trying to learn classes.
> I am currently using Python 2.7 at the command line.
> If you try to type commands at the comman
On Mon, 27 Oct 2014 14:10:01 +1100, Chris Angelico
wrote:
>On Mon, Oct 27, 2014 at 2:06 PM, Ben Finney wrote:
>> Right. There is line-by-line history, and editing enabled with the
>> readline plug-in. (This is an advantage of using a programmer-friendly
>> operating system, which MS Windows sa
On Mon, 27 Oct 2014 14:06:11 +1100, Ben Finney
wrote:
>Seymore4Head writes:
>
>> I am trying to learn classes.
>> I am currently using Python 2.7 at the command line.
>
>(I think you mean the interactive Python interpreter, or just the
>Python shell.)
>
>Since you are learning Python, I will
On Monday, October 27, 2014 8:48:52 AM UTC+5:30, Rustom Mody wrote:
> On Monday, October 27, 2014 8:40:48 AM UTC+5:30, Chris Angelico wrote:
> > On Mon, Oct 27, 2014 at 2:06 PM, Ben Finney wrote:
> > > Right. There is line-by-line history, and editing enabled with the
> > > "readline" plug-in. (Th
Your message showed up as unavailable on my server I have to cut and
paste Google Groups to reply. (I am going to change news servers
probably tomorrow to try to fix that) So the quoting is going to be
bad.
Why not idle?
And if in general you are at python 3, why 2.7 here?
There are enough
On Mon, Oct 27, 2014 at 2:18 PM, Rustom Mody wrote:
> On Monday, October 27, 2014 8:40:48 AM UTC+5:30, Chris Angelico wrote:
>> On Mon, Oct 27, 2014 at 2:06 PM, Ben Finney wrote:
>> > Right. There is line-by-line history, and editing enabled with the
>> > "readline" plug-in. (This is an advantage
On Monday, October 27, 2014 8:40:48 AM UTC+5:30, Chris Angelico wrote:
> On Mon, Oct 27, 2014 at 2:06 PM, Ben Finney wrote:
> > Right. There is line-by-line history, and editing enabled with the
> > "readline" plug-in. (This is an advantage of using a programmer-friendly
> > operating system, whic
On Mon, Oct 27, 2014 at 2:06 PM, Ben Finney wrote:
> Right. There is line-by-line history, and editing enabled with the
> “readline” plug-in. (This is an advantage of using a programmer-friendly
> operating system, which MS Windows sadly is not.)
You can get block-by-block history by using Idle.
On Monday, October 27, 2014 8:00:04 AM UTC+5:30, Seymore4Head wrote:
> I am trying to learn classes.
> I am currently using Python 2.7 at the command line.
Why not idle?
And if in general you are at python 3, why 2.7 here?
There are enough factor to learn ( and get confused)!
Please dont add new o
Seymore4Head writes:
> I am trying to learn classes.
> I am currently using Python 2.7 at the command line.
(I think you mean “the interactive Python interpreter”, or just “the
Python shell”.)
Since you are learning Python, I will strongly recommend you ignore
Python 2 unless it becomes unavoid
On 2013-04-15, Peter Otten <__pete...@web.de> wrote:
> Jason Friedman wrote:
>>> NwInvDb = NetworkInventoryDatabase, yes you are correct, it
>>> creates the database handle and makes it ready for use.
>>
>> I am interested in opinions. I for one dislike abbreviations
>> on the theory that program
Jason Friedman wrote:
>> NwInvDb = NetworkInventoryDatabase, yes you are correct, it creates the
> database handle and makes it ready for use.
>
> I am interested in opinions. I for one dislike abbreviations on the
> theory
> that programs are read more than they are written. I would probably u
On 15/04/2013 02:38, Jason Friedman wrote:
> NwInvDb = NetworkInventoryDatabase, yes you are correct, it creates
the database handle and makes it ready for use.
I am interested in opinions. I for one dislike abbreviations on the
theory that programs are read more than they are written. I woul
> NwInvDb = NetworkInventoryDatabase, yes you are correct, it creates the
database handle and makes it ready for use.
I am interested in opinions. I for one dislike abbreviations on the theory
that programs are read more than they are written. I would probably use
this variable name:
network_in
On 2013-04-09 11:20, Morten Guldager wrote:
'Aloha Friends!
I'm about to write an API against a huge propitiatory Oracle based network
inventory database. The database have many different concepts stored in it's
tables, can one concept can span over multiple tables.
I would like to write a clas
1 - 100 of 281 matches
Mail list logo