r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Julieta Shem writes:
>>r...@zedat.fu-berlin.de (Stefan Ram) writes:
>>>Later, I looked at a book in a bookstore; it was a book
>>>about programming by Barbara Liskov that came out after the
>>>LSP was already mentioned often, and as far as I could se
Greg Ewing writes:
> On 4/11/22 1:29 am, Julieta Shem wrote:
>> Perhaps I can reduce the
>> class Pair to just being a pair as we know it, made of two things, then
>> we create a class called Sequence, which is really a composition of
>> Pairs, comes with a length method and we derive Stack from
On 5/11/22 4:25 am, Chris Angelico wrote:
Maybe it's one of those terms that is useless for actual coding
(because practicality beats purity), but good for discussions?
I'm not sure it's much good for discussions, either. I don't
really care whether a language is "purely OO" or not, whatever
th
On Sat, 5 Nov 2022 at 02:18, Greg Ewing wrote:
>
> On 4/11/22 12:50 am, Chris Angelico wrote:
> > In Python, everything is an object. Doesn't that equally mean that
> > Python is purely OOP?
>
> Depends on what you mean by "purely oop". To me it sug
On Sat, 5 Nov 2022 at 02:21, Greg Ewing wrote:
>
> > r...@zedat.fu-berlin.de (Stefan Ram) writes [that Barbara Liskov said]:
> >
> >> |If for each object o1 of type S there is an object o2 of
> >> |type T such that for all programs P defined in terms of T,
> >> |the behavior of P is unchanged when
On 4/11/22 7:51 am, Julieta Shem wrote:
(The empty documentation seems to satisfy the principle.)
All the more reason to document your classes!
More seriously, there's always at least a (possibly fuzzily) implied
contract, because of the names you choose for things if nothing else.
--
Greg
-
r...@zedat.fu-berlin.de (Stefan Ram) writes [that Barbara Liskov said]:
|If for each object o1 of type S there is an object o2 of
|type T such that for all programs P defined in terms of T,
|the behavior of P is unchanged when o1 is substituted for o2
|then S is a subtype of T.
That seems over
On 4/11/22 12:50 am, Chris Angelico wrote:
In Python, everything is an object. Doesn't that equally mean that
Python is purely OOP?
Depends on what you mean by "purely oop". To me it suggests a
language in which dynamically-dispatched methods are the only
form of code. Pytho
On 4/11/22 1:29 am, Julieta Shem wrote:
Perhaps I can reduce the
class Pair to just being a pair as we know it, made of two things, then
we create a class called Sequence, which is really a composition of
Pairs, comes with a length method and we derive Stack from it.
That sounds better. But be
https://www.oreilly.com/library/view/beginning-c-30/9780470261293/9780470261293_a_short_history_of_object-oriented_progr.html
--
https://mail.python.org/mailman/listinfo/python-list
On 03/11/2022 18:29, Chris Angelico wrote:
> On Fri, 4 Nov 2022 at 05:21, Julieta Shem wrote:
>>
>> Chris Angelico writes:
>>
>>> On Thu, 3 Nov 2022 at 21:44, Alan Gauld wrote:
>>>> Also Python is not a purely OOP language, in that you can write
>&g
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Julieta Shem writes:
>>I'll definitely look up the Liskov
>>substitution principle and try to understand it.
>
> I found the LSP to be very confusing:
>
> First, it's was hard for me to actually get a clear sou
y change.
> So this clearly violates the Open-Closed-Principle!
>
> 3. Comments
>
> So, this would suggest to use procedural programming when
> one foresees the need to add more object-specific procedures
> later and object-oriented programming when one foresees the
On Fri, 4 Nov 2022 at 05:21, Julieta Shem wrote:
>
> Chris Angelico writes:
>
> > On Thu, 3 Nov 2022 at 21:44, Alan Gauld wrote:
> >> Also Python is not a purely OOP language, in that you can write
> >> functional and procedural code in Python if you wish. I
Chris Angelico writes:
> On Thu, 3 Nov 2022 at 21:44, Alan Gauld wrote:
>> Also Python is not a purely OOP language, in that you can write
>> functional and procedural code in Python if you wish. In
>> Smalltalk thats notionally impossible because everything
>> is an
Greg Ewing writes:
> On 3/11/22 1:37 pm, Julieta Shem wrote:
>> The code for computing the length of a Pair (which is really a linked
>> list) happens to be the same for computing the length of a Stack.
>
> I would question whether that should be a method of Pair at all,
> since it's not the leng
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Julieta Shem writes:
>>That's very interesting. Would you share the complete thread of e-mail?
>>I would love to read it word for word.
>
> Yes, with pleasure! A quotation from my corresponding web page:
>
> (For technical reasons, the web page
On Thu, 3 Nov 2022 at 21:44, Alan Gauld wrote:
> Also Python is not a purely OOP language, in that you can write
> functional and procedural code in Python if you wish. In
> Smalltalk thats notionally impossible because everything
> is an object. And all programming statements are m
From: Python-list on
behalf of Alan Gauld
Date: Thursday, November 3, 2022 at 6:45 AM
To: Julieta Shem , python-list@python.org
Subject: Re: an oop question
*** Attention: This is an external email. Use caution responding, opening
attachments or clicking on links. ***
On 03/11/2022 00:25
On 03/11/2022 00:25, Julieta Shem wrote:
>> |OOP to me means only messaging, local retention and protection and
>> |hiding of state-process, and extreme late-binding of all things.
>
> I'm wondering how Python fails to satisfy his definition.
Python doesn't do any fo
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Greg Ewing writes:
>>I don't see any overlap between these at the conceptual level.
>
> It might come from early LISP dialects. In early LISPs, the
> only basic means to combine data into a larger assembly of
> data was the dotted pair and NULL
On 3/11/22 1:37 pm, Julieta Shem wrote:
The code for computing the length of a Pair (which is really a linked
list) happens to be the same for computing the length of a Stack.
I would question whether that should be a method of Pair at all,
since it's not the length of the pair itself, but the
Alan Gauld writes:
> On 01/11/2022 17:58, Julieta Shem wrote:
[...]
>>> IS-A relationship, so Stack inheriting Pair would mean that a Stack
>>> was a Pair. That is not really true.
>>
>> That's another interesting observation. I do not have much
>> understanding of how to really think of thes
Dennis Lee Bieber writes:
> On 2 Nov 2022 09:56:28 GMT, r...@zedat.fu-berlin.de (Stefan Ram) declaimed
> the following:
>
>
>> Now, in the next program, I have removed the subclassings,
>> there is no inheritance from the base class "Language"
>> anymore. Yet the polymorphism in "f" still work
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Julieta Shem writes:
>>Any book recomendations on getting this thing mathematics-clear?
>
> OOP cannot be mathematics-clear because it is an /attempt/ to
> abstract from several different programming languages.
>
> When
Greg Ewing writes:
> On 2/11/22 9:54 am, Julieta Shem wrote:
>> But we've left behind a more basic requirement --- the Stack
>> class wishes for all the methods already written in some class called
>> Pair,
>
> Is that *really* what you want, though?
>
> To my way of thinking, a Stack and a Pair
On 02/11/2022 20:21, Dennis Lee Bieber wrote:
>> shows that in Python we do *not* need subclassing/inheritance
>> for polymorphism!
>>
> To me, that is not really an example of polymorphism, but more an
> example of Python's "duck typing".
But duck typing is a perfectly good implementatio
On 01/11/2022 17:58, Julieta Shem wrote:
> nowhere in trying to detect in high-precision what is OOP and what is
> not.
Stefan has given a good answer but essentially OOP is a program
that is structured around objects communicating by sending
messages to one another.
Objects are, in mos
On 2/11/22 9:54 am, Julieta Shem wrote:
But we've left behind a more basic requirement --- the Stack
class wishes for all the methods already written in some class called
Pair,
Is that *really* what you want, though?
To my way of thinking, a Stack and a Pair are quite different
data structures
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>>The crucial feature OOP adds to this is polymorphism ("late binding").
>
> If polymorphism is so crucial, the idea of subclasses
> has something to it! [...]
I wonde
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Julieta Shem writes:
>>clarify. If I wish for an empty stack, I wish I could just say
> Stack()
>>Stack()
>>and if I wish for a nonempty stack, I'd write
> Stack(1, Stack(2, Stack(3, Stack(
>>Stack(1, Stack(2, Stack(3, Stack(
>
> I
22 at 3:43 PM
To: python-list@python.org
Subject: Re: an oop question
*** Attention: This is an external email. Use caution responding, opening
attachments or clicking on links. ***
Julieta Shem writes:
>clarify. If I wish for an empty stack, I wish I could just say
>>>> Stack()
e
has something else simply because it has a different name. It is not
the user's business to know what things are on the inside.
>> So far so good, but when it comes to building a better user interface
>> for it I have no idea how to do it. I think one of the purposes of OOP
>>
Chris Angelico writes:
> On Mon, 31 Oct 2022 at 14:38, Julieta Shem wrote:
>>
>> Chris Angelico writes:
>>
>> > The most straight-forward way to represent this concept in an
>> > object-oriented way is subclassing.
>> >
>> > class Stack:
>> > ... # put whatever code is common here
>> >
>> >
rt of).
If you had a stack you could create a Pair from it certainly.
> So far so good, but when it comes to building a better user interface
> for it I have no idea how to do it. I think one of the purposes of OOP
> is to organize code hierarchically so that we can reuse what we wrote.
O
On Mon, 31 Oct 2022 at 14:38, Julieta Shem wrote:
>
> Chris Angelico writes:
>
> > The most straight-forward way to represent this concept in an
> > object-oriented way is subclassing.
> >
> > class Stack:
> > ... # put whatever code is common here
> >
> > class Empty(Stack):
> > ... # pu
Chris Angelico writes:
> On Mon, 31 Oct 2022 at 09:05, Julieta Shem wrote:
>>
>> Julieta Shem writes:
>>
>> [...]
>>
>> >> . If you should, however, be talking about the new "type hints":
>> >> These are static and have "Union", for example, "Union[int, str]"
>> >> or "int | str".
>> >
>>
On 31/10/2022 09.22, Stefan Ram wrote:
Giorgio Pastore writes:
You may find useful to learn about the possibilities of using Python
tools to implement a stack data structure and its manipulation methods.
A good introduction is at
https://realpython.com/how-to-implement-python-stack/
I can'
same interface create an abstract base class and derive both
of them from it.
https://docs.python.org/3/library/abc.html
From: Python-list on
behalf of Julieta Shem
Date: Sunday, October 30, 2022 at 5:51 PM
To: python-list@python.org
Subject: an oop question
*** Attention: This is an
On Mon, 31 Oct 2022 at 09:05, Julieta Shem wrote:
>
> Julieta Shem writes:
>
> [...]
>
> >> . If you should, however, be talking about the new "type hints":
> >> These are static and have "Union", for example, "Union[int, str]"
> >> or "int | str".
> >
> > I ended up locating such features
ice. This means that I can solve my stack-union problem by writing a
procedure --- say stack(...) --- that sometimes gives me Empty() and
sometimes gives me Stack().
I think that Stefan Ram's suggestion provides a solution to the problem
of the stack, but not in a real OOP flavor.
You may
tr__(self):
return "Stack({!r}, {})".format(self.first, str(self.rest))
def __repr__(self):
return str(self)
[...]
>>> Stack()
Stack()
>>> Stack(1, Stack())
Stack(1, Stack())
That's it. That's what I was looking for. However, I don't r
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Julieta Shem writes:
>>My desire seems to imply that I need a union-like data structure.
>
> You only need to worry about such things in languages with
> static typing. For example, to have a function that can
> sometimes return an int value an
I have a question about a particular case I'm working on. I'm studying
OOP. To ask the question, I'm going to have to introduce you my context
here, so you'll need to bear with me. If you'd like to see the question
right away, go to the section ``My difficulty
r...@zedat.fu-berlin.de (Stefan Ram) writes:
[...]
>>>However, to evaluate a method call such as "o.m( a, a1, ... )",
>>>currying does not necessarily have to be used. One can as well
>>>determine the function to be used for "m" from the type of "o"
>>>and then call that function with arguments
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Meredith Montgomery writes:
>>The code below works, but you can see it's kinda ugly. I wish I could
>>uncurry a procedure, but I don't think this is possible. (Is it?)
>
> from functools import partial
> from operator import add
> add5 = partial( a
Meredith Montgomery writes:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>
>> Meredith Montgomery writes:
>>>Is that at all possible somehow? Alternatively, how would you do your
>>>toy oop-system?
>>
>> Maybe something along those lines:
>
Chris Angelico writes:
> On Sat, 24 Sept 2022 at 07:52, Meredith Montgomery
> wrote:
>>
>> def Counter(name = None):
>> o = {"name": name if name else "untitled", "n": 0}
>> def inc(o):
>> o["n"] += 1
>> return o
>> o["inc"] = inc
>> def get(o):
>> return o["n"]
>> o["get"]
On Sat, 24 Sept 2022 at 07:52, Meredith Montgomery
wrote:
>
> def Counter(name = None):
> o = {"name": name if name else "untitled", "n": 0}
> def inc(o):
> o["n"] += 1
> return o
> o["inc"] = inc
> def get(o):
> return o["n"]
> o["get"] = get
> return o
>
Want a neat demo
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Meredith Montgomery writes:
>>Is that at all possible somehow? Alternatively, how would you do your
>>toy oop-system?
>
> Maybe something along those lines:
>
> from functools import partial
>
> def counter_c
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Meredith Montgomery writes:
>>Is that at all possible somehow? Alternatively, how would you do your
>>toy oop-system?
>
> Maybe something along those lines:
>
> from functools import partial
>
> def counter_c
c at 0x016547C64CA0>}
We can see something got incremented! But...
>>> c["n"]
0
Indeed, what got incremented is the dictionary attached to the /inc/
procedure of the Counter closure, so it's that dictionary that's being
mutated. My /inherit/ procedure is no
get you up to speed, but then again, we often find out someone is
given a homework assignment ...
-Original Message-
From: Tola Oj
To: python-list@python.org
Sent: Mon, May 23, 2022 4:54 pm
Subject: oop issue
i just finished learning oop as a beginner and trying to practice with i
On 23/05/2022 22:54, Tola Oj wrote:
i just finished learning oop as a beginner and trying to practice with it
but i ran into this typeerror issue, help please.
Traceback (most recent call last):
File
"c:\Users\ojomo\OneDrive\Desktop\myexcel\oop_learn.py\myExperiment.py\mainMain.py"
i just finished learning oop as a beginner and trying to practice with it
but i ran into this typeerror issue, help please.
Traceback (most recent call last):
File
"c:\Users\ojomo\OneDrive\Desktop\myexcel\oop_learn.py\myExperiment.py\mainMain.py",
line 36, in
On 2022-05-23 20:36, Tola Oj wrote:
i am trying to print this code but it keeps giving me this typeerror,
please help. the csv file format i am trying to change into a list is in a
different module.
class invest_crypto:
crypto_current_rate = 0.05
client_list = []
def __init__(self
i am trying to print this code but it keeps giving me this typeerror,
please help. the csv file format i am trying to change into a list is in a
different module.
class invest_crypto:
crypto_current_rate = 0.05
client_list = []
def __init__(self, name, surname, amount_Deposited, amount
Hello,
I would like to know how possible it is to call a member function from a class
and pass it a variable
Example:
class Application(tk.Frame):
"""docstring for ."""
def __init__(self, parent):
super(Application, self).__init__(parent)
self.parent = parent
par
def add_item(self, item_object):
if len(self.inventory) <= self.capacity:
self.inventory.append(item_object)
return True
else:
print("Reached max capacity")
return False
on behalf of DL
Neil via Python-list
*Sent:* Sunday, February 23, 2020 4:41:54 PM
*To:* python-list@
On 22/02/20 10:45 PM, S Y wrote:
How can I use remove,add and verify methods in class oop. Which has tuple with
allowed values inside class. Like two classes cart and inventory
Please show the code you have so-far.
What are you removing, adding, and verifying?
Are you aware of the Python
How can I use remove,add and verify methods in class oop. Which has tuple with
allowed values inside class. Like two classes cart and inventory
Get Outlook for iOS<https://aka.ms/o0ukef>
--
https://mail.python.org/mailman/listinfo/python-list
Oscar Benjamin wrote:
In Python the original exception message plus traceback is often very
informative (to a programmer!) about the problem.
That's okay, exception chaining preserves the whole traceback if
you want to dig down that far.
Catching and
reraising can mean that you end up craftin
On Tue, 5 Nov 2019 at 21:52, Gregory Ewing wrote:
>
> Peter J. Holzer wrote:
> > On 2019-11-04 18:18:39 -0300, Luciano Ramalho wrote:
> >
> > Or maybe don't catch it here at all but just let it bubble up until it
> > hits a level where dealing with it makes sense from the user's point of
> > view
Peter J. Holzer wrote:
On 2019-11-04 18:18:39 -0300, Luciano Ramalho wrote:
In addition, as Rob said, it is usually a bad idea to wrap several
lines of code in a single try/except block
I disagree with this. While it is sometimes useful to wrap a single
line, in my experience it rarely is. T
On 11/5/19 11:52 AM, Peter J. Holzer wrote:
On 2019-11-04 18:18:39 -0300, Luciano Ramalho wrote:
In addition, as Rob said, it is usually a bad idea to wrap several
lines of code in a single try/except block
I disagree with this. While it is sometimes useful to wrap a single
line, in my experie
On 2019-11-04 18:18:39 -0300, Luciano Ramalho wrote:
> In addition, as Rob said, it is usually a bad idea to wrap several
> lines of code in a single try/except block
I disagree with this. While it is sometimes useful to wrap a single
line, in my experience it rarely is. The scope of the try ... e
On Tue, Nov 5, 2019 at 8:46 PM R.Wieser wrote:
>
> Chris,
>
> > "Control flow" is anything that changes the order that your code runs.
>
> My apologies, I should have said "a control flow mechanism" /in this
> context/ (though I assumed that as implicite, as I quoted the text from the
> OP).
>
> C
Chris,
> "Control flow" is anything that changes the order that your code runs.
My apologies, I should have said "a control flow mechanism" /in this
context/ (though I assumed that as implicite, as I quoted the text from the
OP).
Case in point, the __init__ code (of a class object) can result
On Tue, Nov 5, 2019 at 6:26 PM R.Wieser wrote:
> > It is considered totally OK to use exception handling as a control
> > flow mechanism in Python.
>
> I'm not sure what exactly you mean with "a control flow mechanism", but as
> several methods throw exceptions themselves I will have no choice in
Luciano,
> In this context, what I mean by that quote is to say that Python
> never forces you to wrap anything in try/except blocks.
True. But /not/ doing it means that the casted exeption in the __init__
block will just abort the whole program - in a user unfriendly way. And
thats normally
On Mon, Nov 4, 2019 at 5:52 PM R.Wieser wrote:
> I was thinking of (the needed) wrapping of the "newObject = classObject()"
> line in such a try..except block (to capture the re-casted exception). I
> take it that that that means that the full contents of the __init__ block
> are wrapped too.
P
Rob,
> That's why if you for instance, open a serial port in an __init__ routine,
> and something fails, you want to catch the exception there in __init__,
> explicitly close that serial port, and reraise the exception. Otherwise
> that port still has an object open against it until Python gets
On 11/4/19 10:59 AM, R.Wieser wrote:
Rob,
Returning None will specifically NOT accomplish the thing you want;
nothing ever checks the return value of __init__.
I thought to have read that when you return a none from it the object itself
would return a placeholder singleton.
Raise an excepti
Luciano,
> """A failed __init__ should raise an appropriate exception. A bare
> return or returning None is what any __init__ is expected to do in the
> normal case, so it signals success."""
Ah, that settles it than.
Somehow I thought that a return (of "none") there indicated an error result,
Rob,
> Returning None will specifically NOT accomplish the thing you want;
> nothing ever checks the return value of __init__.
I thought to have read that when you return a none from it the object itself
would return a placeholder singleton.
> Raise an exception.
Yeah, that was what I was thi
On 11/4/19 10:36 AM, Luciano Ramalho wrote:
Sorry, I responded only to the OP. My response:
"""A failed __init__ should raise an appropriate exception. A bare
return or returning None is what any __init__ is expected to do in the
normal case, so it signals success."""
Actually, the Python inter
Sorry, I responded only to the OP. My response:
"""A failed __init__ should raise an appropriate exception. A bare
return or returning None is what any __init__ is expected to do in the
normal case, so it signals success."""
Actually, the Python interpreter *does* check the return of __init__.
If
On 11/4/19 7:32 AM, R.Wieser wrote:
Hello all,
The whole question: How should I handle failed initialisation code inside
the __init__ of an object ?
I've seen an example doing a plain "return" (of the value "none""), but have
no idea if that is all it takes.
Also, I wonder what happens to the
Hello all,
The whole question: How should I handle failed initialisation code inside
the __init__ of an object ?
I've seen an example doing a plain "return" (of the value "none""), but have
no idea if that is all it takes.
Also, I wonder what happens to the object itself. Does it still exist
Rhodri,
> Yes, it can. That's why you want to create a finalizer to tidy up.
AFAIKS in my case there is nothing to cleanup. As far as I understood the
WeakSet will automagically purge the reference whe the object it references
is destroyed.
I could also try to do it in in the __del__ method
On 02/11/2019 06:30, R.Wieser wrote:
Rhodri,
Use weak references. A WeakSet
(https://docs.python.org/3/library/weakref.html#weakref.WeakSet) is
probably what you want.
Most likely!As a fresh freshling in regard to python I was not even
aware that a "copy object, but do not increment the
Rhodri,
> Use weak references. A WeakSet
> (https://docs.python.org/3/library/weakref.html#weakref.WeakSet) is
> probably what you want.
Most likely!As a fresh freshling in regard to python I was not even
aware that a "copy object, but do not increment the reference count"
existed.Th
Dennis,
> In __init__() you are adding "self" to a classwide list. So in
> your __del__() you need to remove the instance from the
> same list. Something
:-) Thats the problem: __del__ only gets called when the object is
destroyed - which will never happen when the "instances" list still contain
Chris,
> Have a method to explicitly purge the instance.
I was thinking of that too but decided against it, as it would mean that my
objects would need to be handled specially - which is not quite what I'm
looking for.
To be honest, I was thinking of/hoping that there would be a method which
On Sat, Nov 2, 2019 at 6:21 AM R.Wieser wrote:
>
> Hello all,
>
> I've created a class from which I can iterate all its instanciated objects
> (using an "instances" list).The problem is that I now cannot seem to
> delete an object anymore, AFAIK as a copy of its "self" is still inside the
> "i
On 01/11/2019 19:15, R.Wieser wrote:
Hello all,
I've created a class from which I can iterate all its instanciated objects
(using an "instances" list).The problem is that I now cannot seem to
delete an object anymore, AFAIK as a copy of its "self" is still inside the
"instances" list.
Objec
Hello all,
I've created a class from which I can iterate all its instanciated objects
(using an "instances" list).The problem is that I now cannot seem to
delete an object anymore, AFAIK as a copy of its "self" is still inside the
"instances" list.
Object in question:
- - - - - - - - - - -
[Replying to direct email. David - please respond to the list so that
you can receive other people's suggestions also]
Hi David,
On 14/01/17 15:30, David D wrote:
> 1) No this is not homework, I am doing this all on my own.
In that case I apologise - I gave you the benefit of the doubt though
On Friday, January 13, 2017 at 2:27:04 PM UTC-8, David D wrote:
> I am testing out some basic Object Oriented Programming in Python. The
> basics:
>
> -User enters a name
> -While loop with a sentinel value of "quit" will continue entering names
> until the sentinel value is reached
> -The o
On Jan 13, 2017 3:33 PM, wrote:
The issue I am having is that when i enter the sentinel value of QUIT, it
gets initialized as the name and printed out. How can I get around this?
I hope this makes sense.
Hard to say for certain without seeing your code, but the most likely cause
of this is th
Hi,
On 13/01/17 22:26, daviddsch...@gmail.com wrote:
The issue I am having is that when i enter the sentinel value of QUIT, it gets
initialized as the name and printed out. How can I get around this?
If I understand the question correctly (which looks like it's just a
re-worded homework que
I am testing out some basic Object Oriented Programming in Python. The basics:
-User enters a name
-While loop with a sentinel value of "quit" will continue entering names until
the sentinel value is reached
-The object is created with the inputted value (NAME and until a sentinel value
is e
On Thursday, 18 June 2015 12:21:29 UTC+1, Jason P. wrote:
>
> I'm aware of duck typing. The point in using interfaces is to be explicit
> about the boundaries of a system.
>
> Quite a red "Growing Object-Oriented Software, Guided by Tests", by the way.
> In fact interfaces are key components i
Ah, turns out there was an entry. I updated it.
Laura
--
https://mail.python.org/mailman/listinfo/python-list
On 19/06/2015 00:01, Laura Creighton wrote:
In a message of Thu, 18 Jun 2015 11:50:28 +0100, Mark Lawrence writes:
Throw in http://clonedigger.sourceforge.net/ as well and you've a really
awesome combination.
Mark Lawrence
I didn't know about that one.
Hey thank you, Mark. Looks great.
It
In a message of Thu, 18 Jun 2015 11:50:28 +0100, Mark Lawrence writes:
>Throw in http://clonedigger.sourceforge.net/ as well and you've a really
>awesome combination.
>
>Mark Lawrence
>
I didn't know about that one.
Hey thank you, Mark. Looks great.
It needs its own entry in
https://wiki.python
>
> python -m doctest application.py
>
> And from there, I would build up extra doc tests
>
An extra doc test
that fails
#!/usr/bin/env python
"""
NewsGroup comp.lang.python
Subject .. Classic OOP in Python
Date ..
me from a classic background in what refers to OOP. Mostly Java and
> > > PHP (> 5.3). I'm used to abstract classes, interfaces, access modifiers
> > > and so on.
> > >
> > > Don't get me wrong. I know that despite the differences Pytho
quot;""Great doc about move"""
> raise NotImplementedError()
>
> class Dog(MovingObject):
> def move(self):
> print "Dog is moving"
>
> class Car(MovingObject):
> def move(self):
> print "Car is moving
> def move(self):
>> """Great doc about move"""
>> raise NotImplementedError()
>>
>> class Dog(MovingObject):
>> def move(self):
>> print "Dog is moving"
>>
>> class Car(MovingObj
1 - 100 of 761 matches
Mail list logo