Piet van Oostrum writes:
> from import * is considered bad practice anyway. It is better just to import
> the things you need.
>
> from pykkar import World, Pykkar, _WorldProper
Or, even better, be explicit:
import pykkar
…
foo = pykkar.World()
--
\ “Computer perspect
markot...@gmail.com writes:
>
> OK so I did a took time of and read the pykkar code through. abd I found that
> there is a third class i have to implement.
[...]
> So I have come up with this code
> from pykkar import *
>
> create_world("""
>
> # #
> # v#
> # #
> #
On 10Oct2013 11:34, markot...@gmail.com wrote:
> OK so I did a took time of and read the pykkar code through. abd
> I found that there is a third class i have to implement.
> This Is the pykkar sourcecode
[... lots and lots of docstring and code ...]
[... and finally a little more messgae ...]
> I
kolmapäev, 9. oktoober 2013 2:55.28 UTC+3 kirjutas Cameron Simpson:
> On 08Oct2013 01:20, wrote:
>
> > I cant just subclassing doesent work. It seem the init method of the source
> > class also calls out another class. And the problem is, i can subclass the
> > other class to with the required
On 08Oct2013 01:20, markot...@gmail.com wrote:
> I cant just subclassing doesent work. It seem the init method of the source
> class also calls out another class. And the problem is, i can subclass the
> other class to with the required function but the end result is that it
> doesent work, sin
On Tue, 08 Oct 2013 15:05:26 +0100, wrote:
Parent class is at the link.
Please quote some context when you reply. What link?
Then again, I'm not about to click on some random link someone posts to a
newsgroup. Apart from being one of the classic ways to get a virus onto
my computer, it
Parent class is at the link.
--
https://mail.python.org/mailman/listinfo/python-list
On 8/10/2013 04:20, markot...@gmail.com wrote:
> I cant just subclassing doesent work.
I can't parse that "sentence."
> It seem the init method of the source class also calls out another
class. And the problem is, i can subclass the other class to with the required
function but the end result i
On 08/10/2013 09:20, markot...@gmail.com wrote:
To whom and to what are you replying?
--
Roses are red,
Violets are blue,
Most poems rhyme,
But this one doesn't.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
I cant just subclassing doesent work. It seem the init method of the source
class also calls out another class. And the problem is, i can subclass the
other class to with the required function but the end result is that it doesent
work, since the source class cant accsess the subclass functions.
On Sun, 06 Oct 2013 06:15:51 -0700, markotaht wrote:
> There is this class file, it has its functions and variables.
What's a class file?
Do you mean a file containing only a single class?
> Now im
> greating my program, that uses the funcions from the class.
They are called "methods".
>
On 10/6/2013 9:15 AM, markot...@gmail.com wrote:
There is this class file, it has its functions and variables. Now im greating
my program, that uses the funcions from the class. BUt there are some functions
missing from the class. So i want to add some extra funtions to the class,
whidout alte
There is this class file, it has its functions and variables. Now im greating
my program, that uses the funcions from the class. BUt there are some functions
missing from the class. So i want to add some extra funtions to the class,
whidout altering the original source code, but by extending it
On Tuesday, October 1, 2013 3:34:08 AM UTC+8, Dave Angel wrote:
> On 30/9/2013 08:41, markot...@gmail.com wrote:
>
>
>
> > under variables, i mean, the int's and lists and strings and floats that
> > the parent class uses. IF in parent class there is variable called
> > location, then can i us
On 09/30/2013 04:45 PM, Steven D'Aprano wrote:
I can't speak for others, but in my own experience, I never *quite*
understood the semantic differences between Python name bindings and
Pascal variables until I came across the meme "Python has no variables".
+1
--
https://mail.python.org/mailman
On Tue, 01 Oct 2013 00:45:06 +0100, Ned Batchelder
wrote:
On 9/30/13 6:02 PM, Ethan Furman wrote:
From your blog:
Names are Python's variables: they refer to values, and
those values can change (vary) over the course of your
program.
This is partially incorrect. If the value referred
On Mon, 30 Sep 2013 05:41:16 -0700, markotaht wrote:
> under variables, i mean, the int's and lists and strings and floats that
> the parent class uses. IF in parent class there is variable called
> location, then can i use the same variable in my sub class.
Firstly, in Python circles we prefer t
On Mon, 30 Sep 2013 17:28:30 -0400, Ned Batchelder wrote:
> On 9/30/13 3:34 PM, Dave Angel wrote:
>> Python doesn't actually have variables, but the things it documents as
>> variables are local names within a method. Those are not visible
>> outside of the method, regardless of whether you're in
On 9/30/13 6:02 PM, Ethan Furman wrote:
On 09/30/2013 02:28 PM, Ned Batchelder wrote:
On 9/30/13 3:34 PM, Dave Angel wrote:
Python doesn't actually have variables, but the things it documents as
variables are local names within a method. Those are not visible
outside of the method, regardless
On 09/30/2013 02:28 PM, Ned Batchelder wrote:
On 9/30/13 3:34 PM, Dave Angel wrote:
Python doesn't actually have variables, but the things it documents as
variables are local names within a method. Those are not visible
outside of the method, regardless of whether you're in a class or a
subclas
On Mon, Sep 30, 2013, at 17:28, Ned Batchelder wrote:
> On 9/30/13 3:34 PM, Dave Angel wrote:
> > Python doesn't actually have variables, but the things it documents as
> > variables are local names within a method. Those are not visible
> > outside of the method, regardless of whether you're in a
On 9/30/13 3:34 PM, Dave Angel wrote:
Python doesn't actually have variables, but the things it documents as
variables are local names within a method. Those are not visible
outside of the method, regardless of whether you're in a class or a
subclass.
Why does this meme persist!? Of course Py
On 30/9/2013 08:41, markot...@gmail.com wrote:
> under variables, i mean, the int's and lists and strings and floats that the
> parent class uses. IF in parent class there is variable called location, then
> can i use the same variable in my sub class.
Python doesn't actually have variables, bu
markot...@gmail.com writes:
> under variables, i mean, the int's and lists and strings and floats that the
> parent class uses. IF in parent class there is variable called location, then
> can i use the same variable in my sub class.
Do you mean class variables or instance variables?
--
Piet
On Mon, Sep 30, 2013 at 9:02 AM, Peter Otten <__pete...@web.de> wrote:
> markot...@gmail.com wrote:
>
> > under variables, i mean, the int's and lists and strings and floats that
> > the parent class uses. IF in parent class there is variable called
> > location, then can i use the same variable i
markot...@gmail.com wrote:
> under variables, i mean, the int's and lists and strings and floats that
> the parent class uses. IF in parent class there is variable called
> location, then can i use the same variable in my sub class.
Please show us some code. Thankyou.
--
https://mail.python.or
under variables, i mean, the int's and lists and strings and floats that the
parent class uses. IF in parent class there is variable called location, then
can i use the same variable in my sub class.
--
https://mail.python.org/mailman/listinfo/python-list
markot...@gmail.com wrote:
> esmaspäev, 30. september 2013 11:43.19 UTC+3 kirjutas mark...@gmail.com:
>> Is there a way to give a class extra functions whidout editing the .py
>> file where the class is located?
>
> But does it have all the variables that the main class have?
Yes. You can invoke
esmaspäev, 30. september 2013 11:43.19 UTC+3 kirjutas mark...@gmail.com:
> Is there a way to give a class extra functions whidout editing the .py file
> where the class is located?
But does it have all the variables that the main class have?
--
https://mail.python.org/mailman/listinfo/python-lis
markot...@gmail.com wrote:
> Is there a way to give a class extra functions whidout editing the .py
> file where the class is located?
A clean way is subclassing:
import vehicles
class FlyingCar(vehicles.Car):
def lift_off(self):
pass
flying_car = FlyingCar()
flying_car.lift_off()
Is there a way to give a class extra functions whidout editing the .py file
where the class is located?
--
https://mail.python.org/mailman/listinfo/python-list
You might want to consult this.
http://www.ibiblio.org/g2swap/byteofpython/read/object-methods.html
On Tue, Apr 1, 2008 at 9:43 PM, <[EMAIL PROTECTED]> wrote:
> I can't get call a class for some reason. This must be one of those
> newbie questions I hear so much about:
>
> class wontwork:
>
Try this.
class wontwork:
def really(self):
print "Hello World"
wontwork().really()
On Tue, Apr 1, 2008 at 9:43 PM, <[EMAIL PROTECTED]> wrote:
> I can't get call a class for some reason. This must be one of those
> newbie questions I hear so much about:
>
> class wontwo
I can't get call a class for some reason. This must be one of those
newbie questions I hear so much about:
class wontwork:
def really():
print "Hello World"
wontwork.really()
This returns (as an error):
Traceback (most recent call last):
File "", line 1, in
wontw
David Wahler wrote:
>> what's the magic needed to reuse the base-class implementation of a
>> classmethod?
>>
>> class A(object):
>>@classmethod
>>def foo(cls, a,b):
>># do something
>>pass
>>
>> class B(A):
On Tue, 01 Nov 2005 00:24:37 GMT, "Giovanni Bajo" <[EMAIL PROTECTED]> wrote:
>Hello,
>
>what's the magic needed to reuse the base-class implementation of a
>classmethod?
>
>class A(object):
> @classmethod
> def foo(cls, a,b):
>
Giovanni Bajo wrote:
> Hello,
>
> what's the magic needed to reuse the base-class implementation of a
> classmethod?
>
> class A(object):
>@classmethod
>def foo(cls, a,b):
># do something
>pass
>
> class B(A):
> @classmetho
Hello,
what's the magic needed to reuse the base-class implementation of a
classmethod?
class A(object):
@classmethod
def foo(cls, a,b):
# do something
pass
class B(A):
@classmethod
def foo(cls, a, b):
A.foo(cls, a, b) # WRONG!
I need to call the
38 matches
Mail list logo