Re: python class methods identity?

2007-11-23 Thread Chris Mellon
On Nov 23, 2007 1:29 AM, Roc Zhou [EMAIL PROTECTED] wrote: Hello, I'm now being confused by this segment of code: class Test: ... var = 1 ... def func(self): pass ... x = Test() y = Test() x.var is y.var True x.func is y.func False id(x.var); id(y.var) 146132400

Re: Automatic Generation of Python Class Files

2007-10-30 Thread Bruno Desthuilliers
Fuzzyman a écrit : On Oct 22, 6:43 pm, Steven Bethard [EMAIL PROTECTED] wrote: (snip) # Inherit from object. There's no reason to create old-style classes. We recently had to change an object pipeline from new style classes to old style. A lot of these objects were being created and the

Re: Automatic Generation of Python Class Files

2007-10-30 Thread Hrvoje Niksic
Fuzzyman [EMAIL PROTECTED] writes: We recently had to change an object pipeline from new style classes to old style. A lot of these objects were being created and the *extra overhead* of new style classes was killing us. :-) Can you please expand on this? What extra overhead of new-style

Re: Automatic Generation of Python Class Files

2007-10-30 Thread Fuzzyman
On Oct 29, 11:35 pm, Steven Bethard [EMAIL PROTECTED] wrote: Fuzzyman wrote: On Oct 22, 6:43 pm, Steven Bethard [EMAIL PROTECTED] wrote: # Inherit from object. There's no reason to create old-style classes. We recently had to change an object pipeline from new style classes to old style.

Re: Automatic Generation of Python Class Files

2007-10-30 Thread Chris Mellon
On Oct 30, 2007 5:52 AM, Fuzzyman [EMAIL PROTECTED] wrote: On Oct 29, 11:35 pm, Steven Bethard [EMAIL PROTECTED] wrote: Fuzzyman wrote: On Oct 22, 6:43 pm, Steven Bethard [EMAIL PROTECTED] wrote: # Inherit from object. There's no reason to create old-style classes. We recently had to

Re: Automatic Generation of Python Class Files

2007-10-29 Thread Fuzzyman
On Oct 22, 6:43 pm, Steven Bethard [EMAIL PROTECTED] wrote: Sunburned Surveyor wrote: Contents of input text file: [Name] Fire Breathing Dragon [Properties] Strength Scariness Endurance [Methods] eatMaiden argMaiden fightKnight argKnight Generated Python Class File

Re: Automatic Generation of Python Class Files

2007-10-29 Thread Steven Bethard
Fuzzyman wrote: On Oct 22, 6:43 pm, Steven Bethard [EMAIL PROTECTED] wrote: # Inherit from object. There's no reason to create old-style classes. We recently had to change an object pipeline from new style classes to old style. A lot of these objects were being created and the *extra

Re: Automatic Generation of Python Class Files

2007-10-23 Thread Marc 'BlackJack' Rintsch
On Mon, 22 Oct 2007 17:31:51 -0600, Steven Bethard wrote: Bruno Desthuilliers wrote: Computed attributes are IMHO not only a life-saver when it comes to refactoring. There are cases where you *really* have - by 'design' I'd say - the semantic of a property, but know from the start you'll

Re: Automatic Generation of Python Class Files

2007-10-23 Thread Bruno Desthuilliers
Steven Bethard a écrit : Bruno Desthuilliers wrote: Steven Bethard a écrit : (snip) In Python, you can use property() to make method calls look like attribute access. This could be necessary if you have an existing API that used public attributes, but changes to your code require those

Re: Automatic Generation of Python Class Files

2007-10-23 Thread Steven Bethard
Marc 'BlackJack' Rintsch wrote: On Mon, 22 Oct 2007 17:31:51 -0600, Steven Bethard wrote: Bruno Desthuilliers wrote: Computed attributes are IMHO not only a life-saver when it comes to refactoring. There are cases where you *really* have - by 'design' I'd say - the semantic of a property,

Re: Automatic Generation of Python Class Files

2007-10-23 Thread Steven Bethard
Bruno Desthuilliers wrote: Steven Bethard a écrit : Bruno Desthuilliers wrote: Steven Bethard a écrit : (snip) In Python, you can use property() to make method calls look like attribute access. This could be necessary if you have an existing API that used public attributes, but changes

Re: Automatic Generation of Python Class Files

2007-10-23 Thread Bruno Desthuilliers
Steven Bethard a écrit : Bruno Desthuilliers wrote: Steven Bethard a écrit : Bruno Desthuilliers wrote: Steven Bethard a écrit : (snip) In Python, you can use property() to make method calls look like attribute access. This could be necessary if you have an existing API that used

Re: Automatic Generation of Python Class Files

2007-10-23 Thread Steven Bethard
Bruno Desthuilliers wrote: I guess as long as your documentation is clear about which attributes require computation and which don't... Why should it ? FWIW, I mentionned that I would obviously not use properties for values requiring heavy, non cachable computation. This set aside, the

Re: Automatic Generation of Python Class Files

2007-10-23 Thread Bruno Desthuilliers
Steven Bethard a écrit : Bruno Desthuilliers wrote: I guess as long as your documentation is clear about which attributes require computation and which don't... Why should it ? FWIW, I mentionned that I would obviously not use properties for values requiring heavy, non cachable

Re: Automatic Generation of Python Class Files

2007-10-23 Thread Steven Bethard
Bruno Desthuilliers wrote: Steven Bethard a écrit : Bruno Desthuilliers wrote: I guess as long as your documentation is clear about which attributes require computation and which don't... Why should it ? [snip] I believe we simply disagree on weither properties should be used when it

Re: Automatic Generation of Python Class Files

2007-10-23 Thread Bruno Desthuilliers
Steven Bethard a écrit : Bruno Desthuilliers wrote: Steven Bethard a écrit : Bruno Desthuilliers wrote: I guess as long as your documentation is clear about which attributes require computation and which don't... Why should it ? [snip] I believe we simply disagree on weither

Re: Automatic Generation of Python Class Files

2007-10-23 Thread Steven Bethard
Bruno Desthuilliers wrote: Now how does your desire for documentation imply that if you're creating a class for the first time, it should *never* use property() ? Of course, there's *never* any such thing as never in Python. ;-) STeVe P.S. If you really don't understand what I was getting

Automatic Generation of Python Class Files

2007-10-22 Thread Sunburned Surveyor
I was thinking of a way I could make writing Python Class Files a little less painful. I was considering a Ptyhon script that read a file with a list of property names and method names and then generated a skeleton class file. I was even thinking of automatically generating the shell for doc

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Chris Mellon
On 10/22/07, Sunburned Surveyor [EMAIL PROTECTED] wrote: I was thinking of a way I could make writing Python Class Files a little less painful. I was considering a Ptyhon script that read a file with a list of property names and method names and then generated a skeleton class file. I

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Sunburned Surveyor
On Oct 22, 10:26 am, Chris Mellon [EMAIL PROTECTED] wrote: On 10/22/07, Sunburned Surveyor [EMAIL PROTECTED] wrote: I was thinking of a way I could make writing Python Class Files a little less painful. I was considering a Ptyhon script that read a file with a list of property names

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Bruno Desthuilliers
Sunburned Surveyor a écrit : I was thinking of a way I could make writing Python Class Files What's a Python Class File ? a little less painful. If you find writing classes in Python painful, then either you have no experience with any mainstream language or you are doing something wrong

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Chris Mellon
On 10/22/07, Sunburned Surveyor [EMAIL PROTECTED] wrote: On Oct 22, 10:26 am, Chris Mellon [EMAIL PROTECTED] wrote: On 10/22/07, Sunburned Surveyor [EMAIL PROTECTED] wrote: I was thinking of a way I could make writing Python Class Files a little less painful. I was considering

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Marc 'BlackJack' Rintsch
text file: [Name] Fire Breathing Dragon [Properties] Strength Scariness Endurance [Methods] eatMaiden argMaiden fightKnight argKnight Generated Python Class File: def class FireBreathingDragon: def getStrength(self): Docstring goes here. @return

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Sunburned Surveyor
Python Class Files a little less painful. I was considering a Ptyhon script that read a file with a list of property names and method names and then generated a skeleton class file. I was even thinking of automatically generating the shell for doc strings and epydoc tags

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Steven Bethard
Sunburned Surveyor wrote: Contents of input text file: [Name] Fire Breathing Dragon [Properties] Strength Scariness Endurance [Methods] eatMaiden argMaiden fightKnight argKnight Generated Python Class File: def class FireBreathingDragon: def getStrength(self

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Diez B. Roggisch
You wrote: can't think of a single reason why you would ever want to do this, since your list of method and property names would be just as verbose as just typing the actual python code. I don't think I understand how this would be the same amount of typing. Consider the following example

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Sunburned Surveyor
On Oct 22, 11:43 am, Steven Bethard [EMAIL PROTECTED] wrote: Sunburned Surveyor wrote: Contents of input text file: [Name] Fire Breathing Dragon [Properties] Strength Scariness Endurance [Methods] eatMaiden argMaiden fightKnight argKnight Generated Python Class File

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Steven Bethard
Sunburned Surveyor wrote: I also intended to add statements creating properties from the getter and setter methods. I understand that getters and setters aren't really necessary if you aren't making a property. I just forgot to add the property statements to my example. You still don't want

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Bruno Desthuilliers
and method in generated class file.): Contents of input text file: [Name] Fire Breathing Dragon Why do you put spaces in the name ? [Properties] Strength Scariness Endurance [Methods] eatMaiden argMaiden fightKnight argKnight Generated Python Class File: def class

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Sunburned Surveyor
argMaiden fightKnight argKnight Generated Python Class File: def class FireBreathingDragon: should be: class FireBreathingDragon(object): def getStrength(self): You don't need these getters and setters. Python has support for computed attributes (look for 'property'), so until you

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Bruno Desthuilliers
Sunburned Surveyor a écrit : On Oct 22, 11:47 am, Bruno Desthuilliers [EMAIL PROTECTED] wrote: (snip) Bruno wrote: You don't need these getters and setters. Python has support for computed attributes (look for 'property'), so until you need to control access, a plain attribute is all you

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Bruno Desthuilliers
Steven Bethard a écrit : (snip) In Python, you can use property() to make method calls look like attribute access. This could be necessary if you have an existing API that used public attributes, but changes to your code require those attributes to do additional calculations now. But if

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Sunburned Surveyor
On Oct 22, 1:23 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Steven Bethard a écrit : (snip) In Python, you can use property() to make method calls look like attribute access. This could be necessary if you have an existing API that used public attributes, but changes to your code

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Sunburned Surveyor
On Oct 22, 11:44 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: You wrote: can't think of a single reason why you would ever want to do this, since your list of method and property names would be just as verbose as just typing the actual python code. I don't think I understand how this

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Steven Bethard
Bruno Desthuilliers wrote: Steven Bethard a écrit : (snip) In Python, you can use property() to make method calls look like attribute access. This could be necessary if you have an existing API that used public attributes, but changes to your code require those attributes to do

Re: problem with Python class creating

2007-10-19 Thread dmitrey
Thanks all for these detailed explanations. On Oct 18, 10:48 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: dmitrey a écrit : Not unless these classes define their own initializers. But that's another problem and there are lots of those ones) class MyClass: def __init__(self):

problem with Python class creating

2007-10-18 Thread dmitrey
Hi all, I have the code like this one: from myMisc import ooIter class MyClass: def __init__(self): pass iterfcn = lambda *args: ooIter(self) # i.e pass the class instance to other func named ooIter field2 = val2 field3 = val3 # etc So it yields global name 'self' is not defined,

Re: problem with Python class creating

2007-10-18 Thread Bruno Desthuilliers
dmitrey a écrit : Hi all, I have the code like this one: from myMisc import ooIter class MyClass: Unless you have a need for compatibility with aged Python versions, you'd be better using new-style classes: class MyClass(object): def __init__(self): pass This is the default

Re: problem with Python class creating

2007-10-18 Thread timaranz
On Oct 19, 8:22 am, dmitrey [EMAIL PROTECTED] wrote: Hi all, I have the code like this one: from myMisc import ooIter class MyClass: def __init__(self): pass iterfcn = lambda *args: ooIter(self) # i.e pass the class instance to other func named ooIter field2 = val2 field3

Re: Python class method as an argument of a function in a C extension

2007-09-27 Thread mauro
On 26 Set, 19:00, Matimus [EMAIL PROTECTED] wrote: Can anybody give me an hint (or some link) on how to define 'aCFunction' and how to call 'self.myMethod' in the C source code? A python function defined in C accepts a pointer to self and a tuple of arguments, each of which is also a

Re: Python class method as an argument of a function in a C extension

2007-09-26 Thread Matimus
Can anybody give me an hint (or some link) on how to define 'aCFunction' and how to call 'self.myMethod' in the C source code? A python function defined in C accepts a pointer to self and a tuple of arguments, each of which is also a PyObject. If you pass a function or method, it will be

Re: ctypes:passing python class instances through c and back

2007-07-29 Thread Gabriel Genellina
En Thu, 26 Jul 2007 12:18:04 -0300, m2i3k [EMAIL PROTECTED] escribió: I have C code with requires me to register a python callback. I am able to get the callback working well using ctypes if I use global functions without any context argument for the callback. Now I want to register a python

ctypes:passing python class instances through c and back

2007-07-26 Thread m2i3k
Hi I have C code with requires me to register a python callback. I am able to get the callback working well using ctypes if I use global functions without any context argument for the callback. Now I want to register a python class member function for callback, and give self as the context

Re: Bug in Python class static variable?

2007-07-03 Thread Bruza
On Jul 2, 1:21 pm, Duncan Booth [EMAIL PROTECTED] wrote: Bruza [EMAIL PROTECTED] wrote: On Jul 2, 3:52 am, Duncan Booth [EMAIL PROTECTED] wrote: Bruza [EMAIL PROTECTED] wrote: I am trying to define a class static variable. But the value of the static variable seems to be only defined

Bug in Python class static variable?

2007-07-02 Thread Bruza
I am trying to define a class static variable. But the value of the static variable seems to be only defined inside the file that the class is declared. See the code below. When I run python w.py, I got: 000=== Hello World 001=== Hello World 002=== Not Initialized 003=== Not

Re: Bug in Python class static variable?

2007-07-02 Thread Duncan Booth
Bruza [EMAIL PROTECTED] wrote: I am trying to define a class static variable. But the value of the static variable seems to be only defined inside the file that the class is declared. See the code below. When I run python w.py, I got: When you run python w.py the *script* w.py is loaded as

Re: Bug in Python class static variable?

2007-07-02 Thread Bruza
On Jul 2, 3:52 am, Duncan Booth [EMAIL PROTECTED] wrote: Bruza [EMAIL PROTECTED] wrote: I am trying to define a class static variable. But the value of the static variable seems to be only defined inside the file that the class is declared. See the code below. When I run python w.py, I

Re: Bug in Python class static variable?

2007-07-02 Thread Duncan Booth
Bruza [EMAIL PROTECTED] wrote: On Jul 2, 3:52 am, Duncan Booth [EMAIL PROTECTED] wrote: Bruza [EMAIL PROTECTED] wrote: I am trying to define a class static variable. But the value of the static variable seems to be only defined inside the file that the class is declared. See the code

Re: python class instantiation

2006-10-23 Thread Fredrik Lundh
Éric Daigneault lists wrote: When creating a class with data members but no __init__ method. Python deals differently with data members that are muatable and immutables. no, it doesn't. it's your code that deals with them in different ways, not Python. Ex: class A(object):

Re: python class instantiation

2006-10-23 Thread Éric Daigneault
Fredrik Lundh wrote: Éric Daigneault lists wrote: When creating a class with data members but no __init__ method. Python deals differently with data members that are muatable and immutables. no, it doesn't. it's your code that deals with them in different ways, not Python.

Re: python class instantiation

2006-10-23 Thread Chetan
Éric Daigneault wrote: Got a question for you all... I noticed a behaviour in python class creation that is strange, to say the least. When creating a class with data members but no __init__ method. Python deals differently with data members that are muatable and immutables. Ex: class A(object

Re: python class instantiation

2006-10-23 Thread Gabriel Genellina
At Monday 23/10/2006 17:56, Éric Daigneault lists wrote: When creating a class with data members but no __init__ method. Python deals differently with data members that are muatable and immutables. See http://zephyrfalcon.org/labs/python_pitfalls.html specially items 4 and 5. And

Re: python class instantiation

2006-10-23 Thread Paul McGuire
Éric Daigneault [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It is humbling to see how simple yet powerfull python`s view on things is +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

A Comparison of Python Class Objects and Init Files for Program Configuration

2006-09-12 Thread metaperl
A Comparison of Python Class Objects and Init Files for Program Configuration = Terrence Brannon [EMAIL PROTECTED] http://www.livingcosmos.org/Members/sundevil/python/articles/a-comparison-of-python-class-objects-and-init

include a python class in another python script.

2006-08-15 Thread KraftDiner
I have a class that is defined in a file called MyClass.py How do I use that class in another python script.. import MyClass ? (Does it need to be in a specific location?) -- http://mail.python.org/mailman/listinfo/python-list

Re: include a python class in another python script.

2006-08-15 Thread [EMAIL PROTECTED]
KraftDiner wrote: I have a class that is defined in a file called MyClass.py How do I use that class in another python script.. import MyClass ? (Does it need to be in a specific location?) Same directory as the script that's importing it, or in the PYTHONPATH. import sys print sys.path --

Re: include a python class in another python script.

2006-08-15 Thread danielx
KraftDiner wrote: I have a class that is defined in a file called MyClass.py How do I use that class in another python script.. import MyClass ? (Does it need to be in a specific location?) MyClass.py has to be on your python path. Your python path is a list of directories python will

Re: Python Class for Apache log analysis

2006-06-09 Thread Steve Holden
And80 wrote: Hi all, I am looking for a python package that I could employ to analyze Apache's log files in real time. Of course I already have found some scripts, but most of them are outdated (python1.5), while others are simply impossible to use for a custom application. I was looking for

create a c++ wrapper for python class?

2006-05-10 Thread Mark Harrison
Right now I'm using Boost Python to wrap some C++ code so that applications from both languages can use it. This is great, but I'm rapidly coming to the conclusion that a lot of this work is better coded in Python. There's nothing particularly CPU-bound, and the comprehensive Python library is a

Re: create a c++ wrapper for python class?

2006-05-10 Thread Diez B. Roggisch
Mark Harrison schrieb: Right now I'm using Boost Python to wrap some C++ code so that applications from both languages can use it. This is great, but I'm rapidly coming to the conclusion that a lot of this work is better coded in Python. There's nothing particularly CPU-bound, and the

Re: using vim as a python class/module/function etc.. browser

2006-04-11 Thread Robert Kern
Chris Jones wrote: Robert Kern wrote: Of course, modern versions of Exuberant Ctags also support Python, too. I apt-installed this package but the man page is rather intimidating so I thought I might as well make sure I was going in the right direction. You will probably want to read the

Re: using vim as a python class/module/function etc.. browser

2006-04-11 Thread Daniel Nogradi
Of course, modern versions of Exuberant Ctags also support Python, too. I apt-installed this package but the man page is rather intimidating so I thought I might as well make sure I was going in the right direction. You will probably want to read the vim documentation on how to use ctags

Re: using vim as a python class/module/function etc.. browser

2006-04-11 Thread Chris Jones
Daniel Nogradi wrote: Of course, modern versions of Exuberant Ctags also support Python, too. I apt-installed this package but the man page is rather intimidating so I thought I might as well make sure I was going in the right direction. You will probably want to read the vim documentation on

using vim as a python class/module/function etc.. browser

2006-04-10 Thread Chris Jones
I'm trying to make sense of a python program and was wondering if vim has any python-oriented functionalities (apart from syntax highlighting) that would make it somewhat easier to browse the source code. What I had in mind is something that would let me use CTRL+] to automatically display

Re: using vim as a python class/module/function etc.. browser

2006-04-10 Thread Robert Kern
Chris Jones wrote: I'm trying to make sense of a python program and was wondering if vim has any python-oriented functionalities (apart from syntax highlighting) that would make it somewhat easier to browse the source code. What I had in mind is something that would let me use CTRL+] to

Re: Python Class use

2006-02-07 Thread Roy Smith
S Borg [EMAIL PROTECTED] wrote: I am running Python on Mac OS X. The interpreter has been great for learning the basics, but I would now like to be able to reuse code. Excellent. Code reuse is what it's all about! How do I write reusable code? I have done it The Java way: write the class,

Re: Python Class use

2006-02-07 Thread Fabiano Sidler
Huh? You definitely must import that module. Then, is your homedir listed in sys.path? Greetings, F. Sidler -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Class use

2006-02-07 Thread Roel Schroeven
S Borg schreef: Hello, I am running Python on Mac OS X. The interpreter has been great for learning the basics, but I would now like to be able to reuse code. How do I write reusable code? I have done it The Java way: write the class, and save it to my home directory, then call it from

Re: Python Class use

2006-02-07 Thread Magnus Lycka
Roel Schroeven wrote: import MyModule x = MyModule.MyClass() x.f() Or you could directly import MyClass into the global namespace like this: from MyModule import MyClass x = MyClass() x.f() But that's not recommended since it clutters the global namespace and makes it more

Embedding Python: Creating Python Class from Application

2006-01-12 Thread Kakacek
Hello All, Let's say I have a following python code: class hw_class: def __init__(self): pass def hello_world(self): print 'Hello World!' create_instance('hw_class', 'hw') hw.hello_world() hw = None The 'create_instance' function should be implemented in the application

Re: Embedding Python: Creating Python Class from Application

2006-01-12 Thread Kakacek
In the mean time I did this. It works however, it creates memory leaks. Any idea what could be wrong? procedure TForm1.PyCreateInstance(Sender: TObject; PSelf, Args: PPyObject; var Result: PPyObject); var BClassName: PChar; BInstName: PChar; // BB: Boolean; BModule:

Basic about Python class

2005-11-27 Thread Manuel11g
Hello, I am a new programmer in Python and a need some help. Where can i get a basic tutorial about Class. I don't know nothing about Object Oriented Programming. Can you help me? -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic about Python class

2005-11-27 Thread Brett Hoerner
Manuel11g wrote: Hello, I am a new programmer in Python and a need some help. Where can i get a basic tutorial about Class. I don't know nothing about Object Oriented Programming. Can you help me? http://diveintopython.org/object_oriented_framework/index.html --

Re: Create new instance of Python class in C

2005-09-10 Thread Sybren Stuvel
phil hunt enlightened us with: Why do you need to maske lots of copies? The puzzles are stored in a NxN list of strings. The strings contain all the numerals that that block can contain. So a 9x9 puzzle contains 81 strings 123456789 when it's empty. My creation function picks a block that isn't

Create new instance of Python class in C

2005-09-09 Thread Sybren Stuvel
Hi people, I'm creating a program that can solve and create Sudoku puzzles. My creation function needs to make a lot of copies of a puzzle. Until now, I used copy.deepcopy(), but that's too slow. I want to implement such a copying function in C and use that instead. My idea about this is: - Get

Re: Create new instance of Python class in C

2005-09-09 Thread djw
Sybren Stuvel wrote: Hi people, I'm creating a program that can solve and create Sudoku puzzles. My creation function needs to make a lot of copies of a puzzle. Until now, I used copy.deepcopy(), but that's too slow. I want to implement such a copying function in C and use that instead. My

Re: Create new instance of Python class in C

2005-09-09 Thread Sybren Stuvel
djw enlightened us with: Personally, I would try Psyco first, and consider Pyrex next. Ok, I'll take a look at those. Are you sure your algorithm can't be optimized first, before you start trying to write this in C? I'm sure there will be optimizations, but profiling showed that the copying

Re: Create new instance of Python class in C

2005-09-09 Thread phil hunt
On Fri, 9 Sep 2005 17:19:21 +0200, Sybren Stuvel [EMAIL PROTECTED] wrote: Hi people, I'm creating a program that can solve and create Sudoku puzzles. My creation function needs to make a lot of copies of a puzzle. Why do you need to maske lots of copies? And when you say lots of what numbers do

Re: Create new instance of Python class in C

2005-09-09 Thread phil hunt
On Fri, 9 Sep 2005 18:50:26 +0200, Sybren Stuvel [EMAIL PROTECTED] wrote: djw enlightened us with: Personally, I would try Psyco first, and consider Pyrex next. Ok, I'll take a look at those. Are you sure your algorithm can't be optimized first, before you start trying to write this in C?

Re: graphical or flow charting design aid for python class development?

2005-09-01 Thread Paul McGuire
It's not free, but it is pretty cheap considering all it can do. Check out Enterprise Architect (with the free add-in for Python) from www.sparxsystems.com.au. Pro version license is US$180 or so, but they may have a student license for less that you could use. -- Paul --

Re: graphical or flow charting design aid for python class development?

2005-09-01 Thread William Gill
Thanks everyone. I will explore all the suggestions, but it looks like SPE is the immediate answer. Bill William Gill wrote: Being somewhat new to Python, and having a tendency to over complicate things in my class design, I was wondering if anyone can suggest a simple graphical or

Re: graphical or flow charting design aid for python class development?

2005-09-01 Thread gene tani
There's also this about giving source/class browsers a hand by sprinkling isinstance()'s in http://wingware.com/doc/intro/tutorial-sassist-with-classes I always encourage people to write up their experience/improessions in the python wiki: http://wiki.python.org/moin/PythonEditors (or the

Re: graphical or flow charting design aid for python class development?

2005-09-01 Thread Florian Diesch
William Gill [EMAIL PROTECTED] wrote: Being somewhat new to Python, and having a tendency to over complicate things in my class design, I was wondering if anyone can suggest a simple graphical or flowcharting tool that they use to organize their class and program design? Because of a 55

graphical or flow charting design aid for python class development?

2005-08-31 Thread William Gill
Being somewhat new to Python, and having a tendency to over complicate things in my class design, I was wondering if anyone can suggest a simple graphical or flowcharting tool that they use to organize their class and program design? Because of a 55 mph head-on accident a few years back, I

Re: graphical or flow charting design aid for python class development?

2005-08-31 Thread tooper
You may want to use Doxygen, which generates nice diagrams. It's normally only for C++, but there are nice filters (for ex. http://i31www.ira.uka.de/~baas/pydoxy) that generates C++ header from python code that Doxygen can crunch. Another solution is to use IDE such as Eric3 that can generate UML

Re: graphical or flow charting design aid for python class development?

2005-08-31 Thread gene tani
Have you looked at class browser module? Not the graphical tool you're looking for, but maybe a good start http://www.python.org/doc/2.0.1/lib/module-pyclbr.html William Gill wrote: Being somewhat new to Python, and having a tendency to over complicate things in my class design, I was

Re: graphical or flow charting design aid for python class development?

2005-08-31 Thread William Gill
gene tani wrote: Have you looked at class browser module? Not the graphical tool you're looking for, but maybe a good start No, it's not graphical, but it looks like I may be able to use it to put together a nice outline, or summary of my modules. It's worth exploring, thanks. Bill

Re: graphical or flow charting design aid for python class development?

2005-08-31 Thread Michael Ekstrand
On Wed, 31 Aug 2005 15:40:52 GMT William Gill [EMAIL PROTECTED] wrote: Being somewhat new to Python, and having a tendency to over complicate things in my class design, I was wondering if anyone can suggest a simple graphical or flowcharting tool that they use to organize their class and

Re: graphical or flow charting design aid for python class development?

2005-08-31 Thread gene tani
forgot mention Komodo's code and object browser, which're both in the $30 license http://aspn.activestate.com/ASPN/docs/Komodo/3.1/komodo-doc-codeintel.html#codeintel_codebrowser and SPE's supposed to have some kinda class explorer http://www.stani.be/python/spe --

Why does python class have not private methods? Will this never changed?

2005-04-19 Thread could ildg
Python is an oop language, but why does it hava not private methods? And it even has not real private fields. Will this never changed? Private stuff always makes programming much easier. -- -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python class have not private methods? Will this neverchanged?

2005-04-19 Thread Fredrik Lundh
could ildg [EMAIL PROTECTED] wrote: Private stuff always makes programming much easier. says who? /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python class have not private methods? Will this neverchanged?

2005-04-19 Thread James
Trolls? On 4/19/05, Fredrik Lundh [EMAIL PROTECTED] wrote: could ildg [EMAIL PROTECTED] wrote: Private stuff always makes programming much easier. says who? /F -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python class have not private methods? Will this never changed?

2005-04-19 Thread Simon Brunning
On 4/19/05, could ildg [EMAIL PROTECTED] wrote: Python is an oop language, Yes. Private stuff always makes programming much easier. That contention is, at best, debatable. See http://groups-beta.google.com/group/comp.lang.python/msg/b977ed1312e10b21. -- Cheers, Simon B, [EMAIL PROTECTED],

Re: Why does python class have not private methods? Will this never changed?

2005-04-19 Thread Roy Smith
In article [EMAIL PROTECTED], Simon Brunning [EMAIL PROTECTED] wrote: On 4/19/05, could ildg [EMAIL PROTECTED] wrote: Python is an oop language, Yes. Private stuff always makes programming much easier. That contention is, at best, debatable. See

Re: Why does python class have not private methods? Will this never changed?

2005-04-19 Thread Peter Hansen
Roy Smith wrote: Simon Brunning [EMAIL PROTECTED] wrote: On 4/19/05, could ildg [EMAIL PROTECTED] wrote: Private stuff always makes programming much easier. That contention is, at best, debatable. See http://groups-beta.google.com/group/comp.lang.python/msg/b977ed1312e10b21. Nice essay. Now, for

Re: Why does python class have not private methods? Will this never changed?

2005-04-19 Thread Jaime Wyant
Have I missed something? Doesn't this mangle class methods: class Foo: def __bar(self): print bar Granted, you could probably figure out how the names are being mangled. In the example above __bar is a defacto private method. Griping about it not having `private' in front of it is

Re: Why does python class have not private methods? Will this never changed?

2005-04-19 Thread Roy Smith
In article [EMAIL PROTECTED], Peter Hansen [EMAIL PROTECTED] wrote: Roy Smith wrote: Simon Brunning [EMAIL PROTECTED] wrote: On 4/19/05, could ildg [EMAIL PROTECTED] wrote: Private stuff always makes programming much easier. That contention is, at best, debatable. See

Re: Why does python class have not private methods? Will this never changed?

2005-04-19 Thread Adriano Ferreira
but why does it hava not private methods? Because it does not need them, ain't it? Private stuff always makes programming much easier. Does it? Sometimes contortion is needed to get rid of declarations that restrain access, for example, when writing tests. I think the point-of-view of Python is

<    1   2