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 ca
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 u
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 bel
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 gett
; > [Methods]
> > eatMaiden argMaiden
> > fightKnight argKnight
>
> > Generated Python Class File:
>
> > def class FireBreathingDragon:
>
> >def getStrength(self):
> > """
> > Docstring goes here.
>
> > @return
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
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 an
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
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
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.
> >
> >
On Wed, May 4, 2016 at 8:56 AM, David Shi via Python-list
wrote:
> I found a Python class within an Open Source software.
> I would like to use it in my own Python script.
> I tried to import it, but I got following message.
> from intersection import *Traceback (most recent call
David Shi via Python-list writes:
> I found a Python class within an Open Source software.
> I would like to use it in my own Python script.
> I tried to import it, but I got following message.
Your text is mangled in transit. Please post only plain text messages
(avoid HTML or ot
It's working, all is good.
What I can't figure out is how to create a second C function that
returns a new instance to the "demo" class to python.
There must a be tutorial somewhere, but I can't find anything. I do
not want to define a new python class in C.
Another e
Hey,
Im new to object orientated programming and have an issue with using classes.
Im using the kivy module, a GUI creator , so posting the actual code may
confuse. But an example of what im trying to achieve is below
class test()
s = 1
def test1()
global s
s = 2
You are misreading the original example. `init_network` is defined as a
method on the class, and called in its initializer. There is no property
named "init_network".
On Mon, Jun 29, 2020 at 1:18 PM joseph pareti wrote:
> I have piece of code with constructs as follows:
>
> *class* *SentimentNet
On 30/06/20 5:14 AM, joseph pareti wrote:
I have piece of code with constructs as follows:
*class* *SentimentNetwork**:*
*def* __init__*(*self*,* reviews*,* labels*,* hidden_nodes *=* 10*,*
learning_rate *=* 0.1*):*
np*.*random*.*seed*(*1*)*
self*.*init_network*(**len**(*s
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 t
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
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
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 t
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: PPyObje
unction, I take an instance of the "demo" class and do
> my magic. It's working, all is good.
>
> What I can't figure out is how to create a second C function that
> returns a new instance to the "demo" class to python.
> There must a be tutorial so
Ok, I have it :)
PyImport_Import , PyModule_GetDict, PyDict_GetItemString and
PyObject_CallObject
Need to take a second look at cython when I have a spare cycle or 2.
Thanks for the the tip :)
A+
Dids,
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Mar 30, 2013 at 8:12 AM, Sam Berry wrote:
> class test()
> s = 1
>
> def test1()
> global s
> s = 2
>
> def test2()
> global s
> s = 3
>
> def test3()
> global s
> s = 4
That's not a global, that's a class variable. But to gi
On Fri, Mar 29, 2013 at 2:12 PM, Sam Berry wrote:
> Hey,
>
> Im new to object orientated programming and have an issue with using classes.
> Im using the kivy module, a GUI creator , so posting the actual code may
> confuse. But an example of what im trying to achieve is below
>
> class test()
>
Thanks for the responses! My issue was sorted with Benjamins post, just
printing s worked.
Cheers for the info though Chris, if i have any further issues il post them
with some working code.
Sam
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Mar 30, 2013 at 9:17 AM, Sam Berry wrote:
> Thanks for the responses! My issue was sorted with Benjamins post, just
> printing s worked.
>
> Cheers for the info though Chris, if i have any further issues il post them
> with some working code.
Awesome! Always happy to help out.
ChrisA
-
On Sat, 30 Mar 2013 08:24:00 +1100, Chris Angelico wrote:
> On Sat, Mar 30, 2013 at 8:12 AM, Sam Berry
> wrote:
>> class test()
>> s = 1
>>
>> def test1()
>> global s
>> s = 2
> That's not a global, that's a class variable.
/me thwacks Chris with a halibut.
Not only i
On Sat, Mar 30, 2013 at 9:51 AM, Steven D'Aprano
wrote:
> On Sat, 30 Mar 2013 08:24:00 +1100, Chris Angelico wrote:
>
>> On Sat, Mar 30, 2013 at 8:12 AM, Sam Berry
>> wrote:
>>> class test()
>>> s = 1
>>>
>>> def test1()
>>> global s
>>> s = 2
>
>> That's not a global, tha
On 03/29/2013 06:17 PM, Sam Berry wrote:
Thanks for the responses! My issue was sorted with Benjamins post, just
printing s worked.
Cheers for the info though Chris, if i have any further issues il post them
with some working code.
In that case, you probably should add a line like:
s = Non
Hello
From my C extension module I want to store a C pointer in a given PyObject.
The only way I figure how to do it is to use Py_BuildValues and store the
poiner casted to Py_ssize_t, thus:
Py_BuildValues("n", (Py_ssize_t)my_ptr)
Can it be done differently?
Regards,
Elias
--
http://ma
I want to register a python class member function for callback,
> and give "self" as the context argument at the time of callback
> registration. Then the c code can invoke the callback with self as the
> context argument
Use a bound method as the callback -that is, get the
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
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
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
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
copyin
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 numb
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 thi
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 i
On Sep 29, 2:27 am, "lallous" wrote:
> Hello
>
> From my C extension module I want to store a C pointer in a given PyObject.
>
> The only way I figure how to do it is to use Py_BuildValues and store the
> poiner casted to Py_ssize_t, thus:
>
> Py_BuildValues("n", (Py_ssize_t)my_ptr)
>
> Can it be
cdef __dealloc__ in Cython). If the
pointer references a resource that needs to be closed, this is safer
than using a __del__ method in a Python class.
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 29, 9:42 am, sturlamolden wrote:
> You can use PyCObject, or write your own extension type that wraps the
> pointer (very easy to to with Cython or Pyrex). The advantage of using
> an extension type is you have a guarantee from Python on the
> deallocator method being called (cdef __dealloc
On 29 Sep, 19:11, Carl Banks wrote:
> CObjects can be passed a C function as a deallocator; this should work
> as reliably as a custom class deallocator.
>
> Carl Banks
Except that __del__ prevents cyclic GC.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks everyone.
Finally, I used Falcolas suggestion and took into consideration
sturlamolden's comments.
Regards,
Elias
"lallous" wrote in message news:h9sgcn$iv...@aioe.org...
Hello
From my C extension module I want to store a C pointer in a given
PyObject.
The only way I figure how to
Hello
After using the PyCObject, I cannot pickle the class anymore.
Any simple solution to this problem? (or resorting to __reduce__ is the only
solution?)
Thanks,
Elias
"Falcolas" wrote in message
news:9d3790aa-f7d9-4bb5-a81f-5428b2d60...@v25g2000yqk.googlegroups.com...
On Sep 29, 2:27 am
On Sep 30, 5:24 am, "lallous" wrote:
> Hello
>
> After using the PyCObject, I cannot pickle the class anymore.
> Any simple solution to this problem? (or resorting to __reduce__ is the only
> solution?)
You can't pickle a CObject, you'd have to create a custom type (one
that implements one of th
On Sep 29, 11:16 am, sturlamolden wrote:
> On 29 Sep, 19:11, Carl Banks wrote:
>
> > CObjects can be passed a C function as a deallocator; this should work
> > as reliably as a custom class deallocator.
>
> Except that __del__ prevents cyclic GC.
You are mistaken on two counts.
First of all, a
cator is as reliable as a custom
> type's tp_dealloc.
You are right. I did not look at the PyCObject_* API close enough.
I thought of wrapping the CObject with a Python class, and calling the
destructor from __del__. That would be less reliable.
S.M.
--
http://mail.python.org/mailman/listinfo/python-list
his CObject?
Maybe we can help you choose a better way to handle it at the C level.
I am wrapping a C++ pointer with the python object. That way I can tell with
which C++ object a given python class instance is associated.
The thing is when developing, I need to pickle but I don't nee
We are looking for someone that can help with the subject class, Intro to
Python class, 7/21-23, Ft Worth TX. Please let me know if you can help.
Would need your resume and best possible daily rate.
Best regards,
Rich Drehoff
TechnoTraining, Inc.
328 Office Square Lane, Ste. 202
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 ha
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 what
I'm trying to create a class that would lie to the user that a member is in
some cases a simple variable and in other cases a class. The nature of the
member would depend on call syntax like so:
1. x = obj.member #x becomes the "simple" value contained in member
2. x = obj.member.another_member #
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
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 wonder
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
>
On first glance Doxygen doesn't look like the ticket, but the screen
shots of Eric3 look VERY promising. I have already downloaded it, and
will try it.
Thanks,
Bill
tooper wrote:
> You may want to use Doxygen, which generates nice diagrams. It's
> normally only for C++, but there are nice filt
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
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
--
http://mail.python.org/mailma
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
--
http://mail.python.or
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 flow
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 sepa
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
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+] t
Robert Kern wrote:
> 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 w
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
> >>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
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 doc
Hello:
I can't figure out how to create an instance
of a python class from 'C++':
( I am relatively new to Python so excuse some of
the following. )
In a .py file I create an ABC and then specialize it:
from MyMod import *
from abc import ABCMeta, abstractmethod
On 9/20/2012 9:52 AM, Jure Erznožnik wrote:
I'm trying to create a class that would lie to the user that a member is in
some cases a simple variable and in other cases a class. The nature of the
member would depend on call syntax like so:
1. x = obj.member #x becomes the "simple" value containe
On Thu, 20 Sep 2012 06:52:07 -0700, Jure Erznožnik wrote:
> I'm trying to create a class that would lie to the user that a member is
> in some cases a simple variable and in other cases a class. The nature
> of the member would depend on call syntax like so:
> 1. x = obj.member #x becomes the "si
Hi people,
I've created very nice post here:
http://stackoverflow.com/questions/5274690/how-to-get-python-class-serializable-and-well-parsed-by-json-custom-encoder-deco
Yes, there are solutions over the internet, but nothing works for my
custom types.
If you could answer, please read it
Hi guys,
I'm wondering how to create an instance of an extension class I wrote.
There's a minimal self-contained C module at the bottom of this post
which exports two things: 1) a class Series, and 2) a function
make_series() which is supposed to create a Series object on the C side
and retur
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
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
"could ildg" <[EMAIL PROTECTED]> wrote:
> Private stuff always makes programming much easier.
says who?
--
http://mail.python.org/mailman/listinfo/python-list
Trolls?
On 4/19/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> "could ildg" <[EMAIL PROTECTED]> wrote:
>
> > Private stuff always makes programming much easier.
>
> says who?
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-l
On Tue, Mar 4, 2014 at 5:14 PM, Bill wrote:
> Hello:
>
> I can't figure out how to create an instance
> of a python class from 'C++':
>
> ( I am relatively new to Python so excuse some of
> the following. )
>
> In a .py file I create an ABC and then s
>
> So far, so good. The object that was passed in was the "Derived"
> class object. Since you presumably only want class objects to be
> passed in, you might want to check that here using PyType_Check.
>
Yes. Will do.
>
> > PyTypeObject *typ = class_decl->ob_type;
>
> In Python, y
On 2014-03-05, Ian Kelly wrote:
> On Tue, Mar 4, 2014 at 5:14 PM, Bill wrote:
>> Hello:
>>
>> I can't figure out how to create an instance
>> of a python class from 'C++':
>>
>> ( I am relatively new to Python so excuse some of the fol
On Wed, 05 Mar 2014 16:08:00 +, Grant Edwards wrote:
> On 2014-03-05, Ian Kelly wrote:
>> On Tue, Mar 4, 2014 at 5:14 PM, Bill wrote:
>>> Hello:
>>>
>>> I can't figure out how to create an instance of a python class from
>>> 'C++'
On 2014-03-05, Alister wrote:
>>
>>> Why are you creating an ABC?
>>
>> Because it was the first binary computer that did calculations with
>> electronic switching elements (gates), and it would be really cool to
>> have one! The ABC also pioneered the use of capciators as regenerative
>> storage
On Wednesday 05 March 2014 17:09:53 Grant Edwards did opine:
> On 2014-03-05, Alister wrote:
> >>> Why are you creating an ABC?
> >>
> >> Because it was the first binary computer that did calculations with
> >> electronic switching elements (gates), and it would be really cool to
> >> have one!
On 5 Mar 2014, at 00:14, Bill wrote:
> Hello:
>
> I can't figure out how to create an instance
> of a python class from 'C++':
>
Why not use pycxx from http://sourceforge.net/projects/cxx/?
This lib does all the heavy lifting for you for both python2 and
Barry Scott, 11.03.2014 22:37:
> On 5 Mar 2014, at 00:14, Bill wrote:
>> I can't figure out how to create an instance
>> of a python class from 'C++':
>
> Why not use pycxx from http://sourceforge.net/projects/cxx/?
>
> This lib does all the heavy li
Common guys, help me, sweet heart to finish my job and go with my
friend in the bar. Today we have a blues night :) Love it!
Christina
--
http://mail.python.org/mailman/listinfo/python-list
Currently trying to pick up my ava http://en.gravatar.com/christinasanders21
for StackOverflow, which site I found very good for my questions,
didn't I?
Yes, and there are problem when adding a picture. Web admins should be
careful.
Can anyone explain me my problem ? :
Christina
--
http:/
Ok, guys. I used my bro account. Now I'm here. By the way is anybody
going to be in Paris Sunday night ?
I invite you if you would help :))) Kiss, well yet 30 minutes at work
and I'm free...
Sophie
--
http://mail.python.org/mailman/listinfo/python-list
I can not open your link. Are you sure you provided the correct link?
- Gennadiy
On Fri, Mar 11, 2011 at 10:36 PM, Arthur Mc Coy <1984docmc...@gmail.com>wrote:
> Currently trying to pick up my ava
> http://en.gravatar.com/christinasanders21
> for StackOverflow, which site I found very good fo
On 01/04/2020 13:42, Musbur wrote:
So when created from C, neither the "new" nor the "init" functions are
called on the object, only "finalize". No wonder I get segfaults in the
real life application.
So how is this done right? Here's the C module:
I believe you do it in C as you would in Py
Am 01.04.2020 15:01 schrieb Rhodri James:
I believe you do it in C as you would in Python: you call the Series
class!
pyseries = PyObject_CallObject((PyObject *)&series_type, NULL);
Well, that dumps core just as everything else I tried.
What does work, however, is calling PyType_Ready first
On 01/04/2020 18:24, Musbur wrote:
Am 01.04.2020 15:01 schrieb Rhodri James:
I believe you do it in C as you would in Python: you call the Series
class!
pyseries = PyObject_CallObject((PyObject *)&series_type, NULL);
Well, that dumps core just as everything else I tried.
What does work, ho
On 2020-04-01 13:42, Musbur wrote:
Hi guys,
I'm wondering how to create an instance of an extension class I wrote.
There's a minimal self-contained C module at the bottom of this post
which exports two things: 1) a class Series, and 2) a function
make_series() which is supposed to create a Serie
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]
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
> http://groups-beta.g
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,
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 asin
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
>>
>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
Hi all,
I am trying to wrap some C code using SWIG (win32, mingw). I am new to
SWIG and to the Python/C API so what I am doing is looking at the
examples and trying to fit them to my needs, but I cannot find any
complete demo example of a C function taking as an argument a Python
function defined
101 - 200 of 202 matches
Mail list logo