On 12/19/2019 06:22 AM, Pieter van Oostrum wrote:
Random832 writes:
On Wed, Dec 18, 2019, at 23:10, wrote:
[vahid asadi]
my problem here is why this attribute is not recognize by python and it
raise an traceback error that said 'there is no such p.family
attribute'. although i use multiple
Random832 writes:
> On Wed, Dec 18, 2019, at 23:10, vahid asadi via Python-list wrote:
>> HI guys this is my first post on python mailing lists ever and i glad
>> to do this.
>> my problem here is why this attribute is not recognize by python and it
>> raise an traceback error that said 'there
On Wed, Dec 18, 2019, at 23:10, vahid asadi via Python-list wrote:
> HI guys this is my first post on python mailing lists ever and i glad
> to do this.
> my problem here is why this attribute is not recognize by python and it
> raise an traceback error that said 'there is no such p.family
> att
On Mon, 24 Apr 2017 10:10 pm, id23...@gmail.com wrote:
> I do not quite understand how inheritance works in Python.
[...]
> class mainCL():
> def __init__(self):
> self.path1 = "/a"
> self.path2 = "/b"
>
> class secondCL(mainCL):
> def __init__(newID):
> self
Am 15.02.2013 19:06, schrieb Dave Angel:
On 02/15/2013 12:50 PM, Bob Brusa wrote:
Am 15.02.2013 18:06, schrieb Thomas Rachel:
Am 15.02.2013 17:59 schrieb Bob Brusa:
Hi,
I use a module downloaded from the net. Now I want to build my own
class, based on the class SerialInstrument offered in this
On 02/15/2013 01:28 PM, Bob Brusa wrote:
to make it more clear, I attach a cut-down version of my program. It
includes comments to explain in more detail what my problem is.
Bob
Good job cutting down the sample. Naturally, it'd have been smart to
tell us you don't get the same trace
Am 15.02.2013 19:03, schrieb Dave Angel:
On 02/15/2013 12:23 PM, Bob Brusa wrote:
Am 15.02.2013 18:11, schrieb Dave Angel:
On 02/15/2013 11:59 AM, Bob Brusa wrote:
Hi,
I use a module downloaded from the net. Now I want to build my own
class, based
on the class SerialInstrument offered in this
On 02/15/2013 12:50 PM, Bob Brusa wrote:
Am 15.02.2013 18:06, schrieb Thomas Rachel:
Am 15.02.2013 17:59 schrieb Bob Brusa:
Hi,
I use a module downloaded from the net. Now I want to build my own
class, based on the class SerialInstrument offered in this module - and
in my class I would like to
On 02/15/2013 12:23 PM, Bob Brusa wrote:
Am 15.02.2013 18:11, schrieb Dave Angel:
On 02/15/2013 11:59 AM, Bob Brusa wrote:
Hi,
I use a module downloaded from the net. Now I want to build my own
class, based
on the class SerialInstrument offered in this module - and in my class
I would
like to i
Am 15.02.2013 18:06, schrieb Thomas Rachel:
Am 15.02.2013 17:59 schrieb Bob Brusa:
Hi,
I use a module downloaded from the net. Now I want to build my own
class, based on the class SerialInstrument offered in this module - and
in my class I would like to initialize a few things, using e. g. the
m
Am 15.02.2013 18:11, schrieb Dave Angel:
On 02/15/2013 11:59 AM, Bob Brusa wrote:
Hi,
I use a module downloaded from the net. Now I want to build my own
class, based
on the class SerialInstrument offered in this module - and in my class
I would
like to initialize a few things, using e. g. the me
Am 15.02.2013 17:59 schrieb Bob Brusa:
Hi,
I use a module downloaded from the net. Now I want to build my own
class, based on the class SerialInstrument offered in this module - and
in my class I would like to initialize a few things, using e. g. the
method clear() offered by SerialInstrument. He
On 02/15/2013 11:59 AM, Bob Brusa wrote:
Hi,
I use a module downloaded from the net. Now I want to build my own class, based
on the class SerialInstrument offered in this module - and in my class I would
like to initialize a few things, using e. g. the method clear() offered by
SerialInstrument.
On Thu, Oct 18, 2012 at 10:51 AM, Dave Angel wrote:
> On 10/18/2012 10:10 AM, Jeff Jeffries wrote:
> > Hello everybody
> >
> > When I set "AttributeChanges" in my example, it sets the same value for
> all
> > other subclasses. Can someone help me with what the name of this behavior
> > is (mutabl
On 10/18/2012 10:10 AM, Jeff Jeffries wrote:
> Hello everybody
>
> When I set "AttributeChanges" in my example, it sets the same value for all
> other subclasses. Can someone help me with what the name of this behavior
> is (mutable class global?) ? I don't know any keywords... having
> troubl
On 18 October 2012 15:10, Jeff Jeffries wrote:
> Hello everybody
>
> When I set "AttributeChanges" in my example, it sets the same value for all
> other subclasses. Can someone help me with what the name of this behavior is
> (mutable class global?) ? I don't know any keywords... having troub
On Thu, Apr 5, 2012 at 11:50 AM, Yagnesh Raghava Yakkala
wrote:
>>>you will have
>>> to pass the instance in explicitly as the self argument. For example:
>>
>>> B.foo(x) # calls B.foo directly with instance x
>
> After follow up, I see one problem(can i say that?) with this. With python
> overw
Hello,
With Chris and Ian help (Thank you both)
I end up writing the example script like this,(just for the record)
-
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
class A(object):
def __init__(self, a):
print('a = ', a)
self.a = a
On Fri, Apr 6, 2012 at 4:09 AM, Yagnesh Raghava Yakkala
wrote:
> Thanks for explaining. It makes sense. I see that python interpreter can
> instantly tell the list of defined methods in the super class(es). So "keeping
> track" thing is not at all a problem.
>
> Thanks a lot again.
Most welcome!
Hello Chris,
Chris Angelico writes:
>
> If you're subclassing something, you should generally work with the
> intention that an instance of your class will function viably in any
> situation in which an instance of the parent is wanted. So if you're
> writing a method of the same name as one in
On Fri, Apr 6, 2012 at 3:50 AM, Yagnesh Raghava Yakkala
wrote:
> After follow up, I see one problem(can i say that?) with this. With python
> overwriting methods of super class(es), one need to keep track of all the
> methods ever defined in the super class(es). do everybody do a check before
> wr
Hello Ian,
Yagnesh Raghava Yakkala writes:
> Hello Ian,
>
> Ian Kelly writes:
[snipped 21 lines]
>
>>you will have
>> to pass the instance in explicitly as the self argument. For example:
>
>> B.foo(x) # calls B.foo directly with instance x
After follow up, I see one problem(can i say tha
Hello Ian,
Ian Kelly writes:
> On Thu, Apr 5, 2012 at 10:50 AM, yag wrote:
>> three classes A,B,C and instance x.
>>
>> now how can I call methods foo in class A and B using 'x' instance. (I hope I
>> could pronounce the terminology correct)
>
> Do you mean that you want C.foo to call B.foo, a
Chris Angelico writes:
> On Fri, Apr 6, 2012 at 2:50 AM, yag wrote:
>>
[snipped 19 lines]
> In each case, you are overriding the foo() method, so your instance
> will only execute the last one. If you want to chain to the others,
> you need to write your methods to do so - which is what you've
On Thu, Apr 5, 2012 at 10:50 AM, yag wrote:
> three classes A,B,C and instance x.
>
> now how can I call methods foo in class A and B using 'x' instance. (I hope I
> could pronounce the terminology correct)
Do you mean that you want C.foo to call B.foo, and B.foo to call
A.foo? If that is the ca
On Fri, Apr 6, 2012 at 2:50 AM, yag wrote:
>
> Hello,
>
> I am new to python (or to any programming language). My first post on this
> list,
> so please go easy. Apologies if its a FAQ.
Welcome!
> class A(object):
> def foo(self):
> print('printing from foo in A = ',self.a)
>
> class
On 02/09/2011 08:40 PM, Carl Banks wrote:
I explained why in my last post; there's a bunch of reasons.
Generally you can't assume someone's going to go through the type
structure to find the object's dict, nor can you expect inherited
methods to always use the derived class's type structure (some
On Feb 9, 3:11 pm, Rouslan Korneychuk wrote:
> On 02/09/2011 04:58 PM, Carl Banks wrote:
> > On Feb 9, 1:14 pm, Rouslan Korneychuk wrote:
> >> On 02/09/2011 02:42 PM, Carl Banks wrote:
> >>> This is the only case I can think of where the
> >>> layout conflict would be caused by a type setting tp_
On 02/09/2011 05:02 PM, Carl Banks wrote:
On Feb 9, 1:14 pm, Rouslan Korneychuk wrote:
Each Python class is a wrapper for a C++ class.
Also, if you want my opinion (you probably don't after you've already
gone to so much trouble, but here it is anyway):
No, your opinion is quite welcome.
On 02/09/2011 04:58 PM, Carl Banks wrote:
On Feb 9, 1:14 pm, Rouslan Korneychuk wrote:
On 02/09/2011 02:42 PM, Carl Banks wrote:
This is the only case I can think of where the
layout conflict would be caused by a type setting tp_dictoffset.
No, actually I have code that is roughly equivalent
On Feb 9, 1:14 pm, Rouslan Korneychuk wrote:
> Each Python class is a wrapper for a C++ class.
Also, if you want my opinion (you probably don't after you've already
gone to so much trouble, but here it is anyway):
It's not worth it to mimic the C++ type hierarchy in Python. Just
wrap each C++ c
On Feb 9, 1:14 pm, Rouslan Korneychuk wrote:
> On 02/09/2011 02:42 PM, Carl Banks wrote:
> > This is the only case I can think of where the
> > layout conflict would be caused by a type setting tp_dictoffset.
>
> No, actually I have code that is roughly equivalent to the following
> pseudocode:
>
On 02/09/2011 02:42 PM, Carl Banks wrote:
On Feb 9, 10:54 am, Rouslan Korneychuk wrote:
I'm working on a program that automatically generates C++ code for a
Python extension and I noticed a few limitations when using the weaklist
and instance dictionaries (tp_weaklistoffset and tp_dictoffset).
On Feb 9, 10:54 am, Rouslan Korneychuk wrote:
> I'm working on a program that automatically generates C++ code for a
> Python extension and I noticed a few limitations when using the weaklist
> and instance dictionaries (tp_weaklistoffset and tp_dictoffset). This is
> pertaining to the C API.
>
>
On Mon, 04 Oct 2010 09:51:18 -0700, Dennis Lee Bieber wrote:
> On 04 Oct 2010 05:08:20 GMT, Steven D'Aprano
> declaimed the following in
> gmane.comp.python.general:
>
>
>> from luncheon_meats import Ham
>>
>> class Spam(Ham):
>> def __init__(self):
>> self.__x = "yummy"
>>
>>
>>
On Sun, 03 Oct 2010 21:32:25 -0700, Dennis Lee Bieber wrote:
> Well... then use the double __ prefix so your instance variables
> have a class specific name... That IS what the __ are designed to do --
> ensure that the name, as used /in/ that class itself is unique, and not
> referencing so
In article <14cf8b45-a3c0-489f-8aa9-a75f0f326...@n3g2000yqb.googlegroups.com>
Rock wrote:
>I've really been wondering about the following lately. The question is
>this: if there are no (real) private or protected members in Python,
>how can you be sure, when inheriting from another class, that yo
On Mon, 04 Oct 2010 11:57:18 +1300, Gregory Ewing wrote:
> Rock wrote:
>> What if the
>> library I'm using doesn't realase the source, or what if I just can't
>> get my hands on it for some reason or another?
>
> You can always use dir() on an instance of the class to find out what
> names it's u
On Sun, 03 Oct 2010 15:04:17 -0700, Rock wrote:
> Thanks for the reply. No, I was just working with a normal library class
> which was supposed to be derived. So that's what I did, but in the
> process I found myself needing to create an instance variable and it
> dawned on me: "how do I know I'm
On Oct 3, 5:17 pm, MRAB wrote:
> On 04/10/2010 00:06, Steve Howell wrote:> On Oct 3, 3:57 pm, Gregory
> Ewing wrote:
> >> Rock wrote:
> >>> What if the
> >>> library I'm using doesn't realase the source, or what if I just can't
> >>> get my hands on it for some reason or another?
>
> >> You can
On Oct 3, 5:13 pm, Carl Banks wrote:
> On Oct 3, 3:04 pm, Rock wrote:
>
> > No, I was just working with a normal library
> > class which was supposed to be derived. So that's what I did, but in
> > the process I found myself needing to create an instance variable and
> > it dawned on me: "how do
On 04/10/2010 00:06, Steve Howell wrote:
On Oct 3, 3:57 pm, Gregory Ewing wrote:
Rock wrote:
What if the
library I'm using doesn't realase the source, or what if I just can't
get my hands on it for some reason or another?
You can always use dir() on an instance of the class to
find out what
On Oct 3, 3:04 pm, Rock wrote:
> No, I was just working with a normal library
> class which was supposed to be derived. So that's what I did, but in
> the process I found myself needing to create an instance variable and
> it dawned on me: "how do I know I'm not clobbering something
> here???" ...
Arnaud Delobelle writes:
> I've been reading c.l.python for years (on and off) and I can't recall
> anybody saying this has been a problem in practise.
It has been a problem for me at least once. I blew a good chunk of a
day debugging a problem that turned out due to my clobbering something
in
On Oct 3, 3:57 pm, Gregory Ewing wrote:
> Rock wrote:
> > What if the
> > library I'm using doesn't realase the source, or what if I just can't
> > get my hands on it for some reason or another?
>
> You can always use dir() on an instance of the class to
> find out what names it's using.
>
Indeed
Rock wrote:
What if the
library I'm using doesn't realase the source, or what if I just can't
get my hands on it for some reason or another?
You can always use dir() on an instance of the class to
find out what names it's using.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 3, 3:04 pm, Rock wrote:
> > Object-oriented designs are difficult to design in any programming
> > language, and it helps to have some sort of concrete problem to drive
> > the discussion. Are you working on a particular design where you
> > think Python's philosophy will inhibit good desi
Arnaud Delobelle writes:
> I've been reading c.l.python for years (on and off) and I can't recall
> anybody saying this has been a problem in practise.
Arghh! Practice, I meant practice!
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
Rock writes:
>> Object-oriented designs are difficult to design in any programming
>> language, and it helps to have some sort of concrete problem to drive
>> the discussion. Are you working on a particular design where you
>> think Python's philosophy will inhibit good design? My take on Pytho
> Object-oriented designs are difficult to design in any programming
> language, and it helps to have some sort of concrete problem to drive
> the discussion. Are you working on a particular design where you
> think Python's philosophy will inhibit good design? My take on Python
> is that it focu
On Oct 3, 1:07 pm, Rock wrote:
> Hi all :)
>
> I've really been wondering about the following lately. The question is
> this: if there are no (real) private or protected members in Python,
> how can you be sure, when inheriting from another class, that you
> won't wind up overriding, and possibly
On 10/03/2010 01:07 PM, Rock wrote:
Hi all :)
I've really been wondering about the following lately. The question is
this: if there are no (real) private or protected members in Python,
how can you be sure, when inheriting from another class, that you
won't wind up overriding, and possibly clobb
On 21 Jun., 22:51, Scott David Daniels wrote:
> LorenzoDiGregoriowrote:
> > On 21 Jun., 01:54, Dave Angel wrote:
> >> ...
> >> class B(object):
> >> def __init__(self,test=None):
> >> if test==None:
> >> test = A()
> >> self.obj =()
> >> return
> > ...
> >
Dave Angel a écrit :
(snip
Default
arguments of class methods are evaluated during the definition of the
class
Default arguments of functions are eval'd during the execution of the
def statement.
The fact that you use a def statement within a class statement's body is
totally orthogonal -
Piet van Oostrum a écrit :
Steven D'Aprano (SD) wrote:
(snip)
SD> # A.__base__ = DebugA ## Uncomment this line for debugging.
A.__base__ = DebugA
TypeError: readonly attribute
Make that: A.__bases__ = DebugA,
or even better (readability-wise):
A.__bases__ = (DebugA,)
Just the sam
Lorenzo Di Gregorio wrote:
On 21 Jun., 01:54, Dave Angel wrote:
...
class B(object):
def __init__(self,test=None):
if test==None:
test = A()
self.obj =()
return
...
I had also thought of using "None" (or whatever else) as a marker but
I was curious to fi
Lorenzo Di Gregorio wrote:
> I had also thought of using "None" (or whatever else) as a marker but
> I was curious to find out whether there are better ways to supply an
> object with standard values as a default argument.
> In this sense, I was looking for problems ;-)
>
> Of course the observati
On 21 Jun., 01:54, Dave Angel wrote:
> LorenzoDiGregoriowrote:
> > On Jun 20, 8:43 pm, Dave Angel wrote:
>
> >>LorenzoDiGregoriowrote:
>
> >>> Hi,
>
> >>> I'm wondering what would be the preferred way to solve the following
> >>> forward reference problem:
>
> >>>
Lorenzo Di Gregorio wrote:
On Jun 20, 8:43 pm, Dave Angel wrote:
Lorenzo Di Gregorio wrote:
Hi,
I'm wondering what would be the preferred way to solve the following
forward reference problem:
---
class BaseA(object):
def __init__(
On Sat, 20 Jun 2009 21:26:56 +0100, Lorenzo Di Gregorio
wrote:
Thank you for your help: I'm working on a rather large source, but I
think I have isolated the problem now.
This listing generates an error:
---
class BaseA(object):
def __init__(se
On Jun 20, 8:43 pm, Dave Angel wrote:
> Lorenzo Di Gregorio wrote:
> > Hi,
>
> > I'm wondering what would be the preferred way to solve the following
> > forward reference problem:
>
> > ---
> > class BaseA(object):
> > def __init__(self):
> > return
> Steven D'Aprano (SD) wrote:
>SD> Lorenzo Di Gregorio wrote:
>>> Hi,
>>>
>>> I'm wondering what would be the preferred way to solve the following
>>> forward reference problem:
>SD> You don't actually explain what is the problem. Fortunately, I'm good at
>SD> guessing, and I think I can gu
Lorenzo Di Gregorio wrote:
Hi,
I'm wondering what would be the preferred way to solve the following
forward reference problem:
---
class BaseA(object):
def __init__(self):
return
class DebugA(BaseA):
def __init__(self):
return
# here
Lorenzo Di Gregorio wrote:
> Hi,
>
> I'm wondering what would be the preferred way to solve the following
> forward reference problem:
You don't actually explain what is the problem. Fortunately, I'm good at
guessing, and I think I can guess what your problem is (see below):
>
On Wed, 27 May 2009 17:21:23 -0400, Terry Reedy wrote:
> super() was designed for multiple inheritance.
Surely you mean that super() was designed for *inheritance*, multiple or
singular? Working with single inheritance is part of the design, not an
accident of implementation.
> The only reaso
imageguy wrote:
I have an object the I would like to use as a base class. Some of the
methods I would like to override completely, but others I would simply
like to call the base class method and use the return value in the
child method. The purpose here is to eliminate the duplication of
valua
On May 27, 12:58 pm, imageguy wrote:
> I have an object the I would like to use as a base class. Some of the
> methods I would like to override completely, but others I would simply
> like to call the base class method and use the return value in the
> child method. The purpose here is to elimin
On Wed, May 27, 2009 at 9:58 PM, imageguy wrote:
> I have an object the I would like to use as a base class. Some of the
> methods I would like to override completely, but others I would simply
> like to call the base class method and use the return value in the
> child method. The purpose here
imageguy wrote:
I have an object the I would like to use as a base class. Some of the
methods I would like to override completely, but others I would simply
like to call the base class method and use the return value in the
child method. The purpose here is to eliminate the duplication of
valua
On May 27, 12:58 pm, imageguy wrote:
> I have an object the I would like to use as a base class. Some of the
> methods I would like to override completely, but others I would simply
> like to call the base class method and use the return value in the
> child method. The purpose here is to elimin
imageguy wrote:
I have an object the I would like to use as a base class. Some of the
methods I would like to override completely, but others I would simply
like to call the base class method and use the return value in the
child method. The purpose here is to eliminate the duplication of
valua
On Wed, Nov 5, 2008 at 6:59 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
> You need to call the __init__ of NoteSet inside Scale, as otherwise the
> instance isn't properly initialized.
Thanks, solved.
--
http://mail.python.org/mailman/listinfo/python-list
Mr.SpOOn wrote:
> Hi,
> I have a problem with this piece of code:
>
>
> class NoteSet(OrderedSet):
> def has_pitch(self):
> pass
> def has_note(self):
> pass
>
> class Scale(NoteSet):
> def __init__(self, root, type):
> self.append(root)
> self.type =
On Oct 3, 11:56 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Fri, 03 Oct 2008 03:32:52 -0700, Michele Simionato wrote:
> > IMO, if you have methods that you want to use in different classes, this
> > is hint that
> > you are in need of generic functions. See this blog post
On Fri, 03 Oct 2008 03:32:52 -0700, Michele Simionato wrote:
> IMO, if you have methods that you want to use in different classes, this
> is hint that
> you are in need of generic functions. See this blog post for an example:
>
> http://www.artima.com/weblogs/viewpost.jsp?thread=237764
That's a
2008/10/3 Tim Rowe <[EMAIL PROTECTED]>:
> As others have said, no. What nobody seems to have said yet is why. If
> Y descends from X, you are saying that Y is an X; that a Y can be used
> anywhere an X can. If Y doesn't support some methods of X then it is
> *not* an X, and *can't* be used anywher
2008/10/2 process <[EMAIL PROTECTED]>:
> Let's say I have a class X which has 10 methods.
>
> I want class Y to inherit 5 of them.
>
> Can I do that?
As others have said, no. What nobody seems to have said yet is why. If
Y descends from X, you are saying that Y is an X; that a Y can be used
anywhe
On Oct 2, 10:16 pm, process <[EMAIL PROTECTED]> wrote:
> Let's say I have a class X which has 10 methods.
>
> I want class Y to inherit 5 of them.
>
> Can I do that? Can I do something along the lines of super(Y, exclude
> method 3 4 7 9 10) ?
Don't use inheritance, use delegation or just copy the
greg wrote:
>> class Mask(object):
>> def m3(self): raise NotImplementedError
>> def m4(self): raise NotImplementedError
>
>> What's the name of this python design pattern? :-)
>
> Don't know. Perhaps we could call it the FigLeaf pattern
> (covering up what you don't want seen)?
Braghettone ;)
[EMAIL PROTECTED] wrote:
class Mask(object):
def m3(self): raise NotImplementedError
def m4(self): raise NotImplementedError
What's the name of this python design pattern? :-)
Don't know. Perhaps we could call it the FigLeaf pattern
(covering up what you don't want seen)?
There's a
Gary Herron:
> You can also redefine the ones you don't want inherited:
> class A:
> def DontInheritMe(self, ...):
>...
> Class B(A):
> def DontInheritMe(self, ...):
>raise NotImplementedError // Or some such
I have never used something like this, but the OP may use a maski
On Oct 2, 3:16 pm, process <[EMAIL PROTECTED]> wrote:
> Let's say I have a class X which has 10 methods.
>
> I want class Y to inherit 5 of them.
>
> Can I do that? Can I do something along the lines of super(Y, exclude
> method 3 4 7 9 10) ?
That implies that the 5 you do include don't rely on or
Gary Herron wrote:
> process wrote:
>
>> Let's say I have a class X which has 10 methods.
>>
>> I want class Y to inherit 5 of them.
>>
>> Can I do that? Can I do something along the lines of super(Y, exclude
>> method 3 4 7 9 10) ?
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
On Oct 2, 1:16 pm, process <[EMAIL PROTECTED]> wrote:
> Let's say I have a class X which has 10 methods.
>
> I want class Y to inherit 5 of them.
>
> Can I do that? Can I do something along the lines of super(Y, exclude
> method 3 4 7 9 10) ?
I think the noral way of doing that is to split the ori
process wrote:
> Let's say I have a class X which has 10 methods.
>
> I want class Y to inherit 5 of them.
>
> Can I do that? Can I do something along the lines of super(Y, exclude
> method 3 4 7 9 10) ?
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
No.
But why do yo care? Yo
On Aug 11, 2:41 pm, Johannes Bauer <[EMAIL PROTECTED]> wrote:
> Hello group,
>
> I'm having a seemingly simple problem. I want to generate a hierarchy of
> modules, like this one:
>
> GenerationScripts/
> GenerationScripts/dhcp
> GenerationScripts/bind9
>
> And the files:
>
> GenerationScripts/dhcp
Johannes Bauer a écrit :
Hello group,
I'm having a seemingly simple problem. I want to generate a hierarchy of
modules, like this one:
GenerationScripts/
GenerationScripts/dhcp
GenerationScripts/bind9
And the files:
GenerationScripts/dhcp/__init__.py
GenerationScripts/bind9/generator.py
Gen
Preamble: when posting a brand new question, you'd better not replying to
an existing completely unrelated message. In most viewers, this will cause
your message to appear in the thread for the original question and far
less people will see it. So better create a brand new thread.
On Fri, 2
On Fri, Jun 20, 2008 at 6:19 PM, Hamish McKenzie
<[EMAIL PROTECTED]> wrote:
>
> I have this class:
>
> class Vector(object):
> TOL = 1e-5
> def __eq__( self, other, tolerance=TOL ):
> print tolerance
>
>
> shortened for clarity obviously. so I want to subclass this class like
> s
Thanks to everyone who replied. Kay and Mark put me on the right track
immediately. Ben is quite right - the fragment that I posted couldn't
have given that error, but I didn't want to post the whole thing -
perhaps wrongly, I thought it wouldn't help clarify what I thought the
problem was. And
Hook <[EMAIL PROTECTED]> writes:
> I'm having a problem with multiple inheritance
You aren't alone. Multiple inheritance (MI) is difficult to implement,
and once implemented, usually difficult to understand and sometimes
counterintuitive.
I recommend you read and absorb the article "The Truth ab
In article <[EMAIL PROTECTED]>,
Hook <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm having a problem with multiple inheritance - it's clearly something
> I've missed, but the web pages and books that I've consulted aren't
> helping, so I'll throw myself on the mercy and collective wisdom of
> Usene
On Apr 19, 12:37 am, Hook <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm having a problem with multiple inheritance - it's clearly something
> I've missed, but the web pages and books that I've consulted aren't
> helping, so I'll throw myself on the mercy and collective wisdom of
> Usenet!
>
> I've got 4
Hook wrote:
> When I run the script I get this:
>
> Traceback (most recent call last):
> File "./3.py", line 20, in
> Obj.Connect ('Database')
> File "/mnt/isis/Projects/Python/Learning/DB_m.py", line 102, in Connect
> self.TRACE ("DB::Connect (" + database + "," + mode)
> File "/m
On 19 Apr., 08:37, Hook <[EMAIL PROTECTED]> wrote:
> Traceback (most recent call last):
> File "./3.py", line 20, in
> Obj.Connect ('Database')
> File "/mnt/isis/Projects/Python/Learning/DB_m.py", line 102, in Connect
> self.TRACE ("DB::Connect (" + database + "," + mode)
> File "/m
Hi all,
I would like to thank you all for all the suggestions.
what I did was simply extending the super class data with data from
its child
using the id example, Foo.id = 1 is now = [1] and the FooSon does
self.id.append(2)
the system designer wanted inheritance+java and I wanted Python
+Functi
On Mar 25, 12:01 pm, Robert Bossy <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm not sure what you're trying to actually achieve, but it seems that
> you want an identificator for classes, not for instances. In this case,
> setting the id should be kept out of __init__ since it is an instance
> initializ
Hi,
I'm not sure what you're trying to actually achieve, but it seems that
you want an identificator for classes, not for instances. In this case,
setting the id should be kept out of __init__ since it is an instance
initializer: make id static and thus getid() a classmethod.
Furthermore, if yo
On Mar 25, 4:37 pm, Brian Lane <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
>
> Gerard Flanagan wrote:
> > Use the child class when calling super:
>
> > --
> > class Foo(object):
> > def __init__(self):
> > self.id
On Tue, 25 Mar 2008 16:37:00 +0100, Brian Lane <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Gerard Flanagan wrote:
>
>> Use the child class when calling super:
>>
>> --
>> class Foo(object):
>> def __init__(self):
>>
1 - 100 of 215 matches
Mail list logo