Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-14 Thread Gabriel Genellina
En Wed, 14 Nov 2007 15:08:42 -0300, <[EMAIL PROTECTED]> escribió: > thank you. > result is the same however: > pyt: main.cpp:17: PyObject* pyNode_root(PyObject*, PyObject*): > Assertion `co' failed. Well, "is the same" in the sense that the code still doesn't do what you want... But the previou

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-14 Thread sndive
On Nov 14, 12:57 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 13 Nov 2007 19:59:56 -0300, <[EMAIL PROTECTED]> escribió: > > > working on a smaller example. i could not get pyNode_root invoked yet > > and > > PyRun_String("import node\nprint node.root()\n", > > Py_fi

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread Gabriel Genellina
En Tue, 13 Nov 2007 19:59:56 -0300, <[EMAIL PROTECTED]> escribió: > working on a smaller example. i could not get pyNode_root invoked yet > and > PyRun_String("import node\nprint node.root()\n", > Py_file_input, > exec, g_maindict); The globals argument should co

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread sndive
On Nov 13, 3:31 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Nov 13, 2007 3:18 PM, <[EMAIL PROTECTED]> wrote: > > > On Nov 9, 5:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > En Tue, 06 Nov 2007 23:25:17 -0300, <[EMAIL PROTECTED]> escribió: > > > > One should make a lot of assum

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread sndive
On Nov 9, 7:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 06 Nov 2007 23:25:17 -0300, <[EMAIL PROTECTED]> escribió: > > > i naively created execution context: > > PyObject *execcontext = PyDict_New(); > > stuffed a handle in it: > > PyObject *ih = PyCObject_FromVoidPtr(han

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread sndive
On Nov 13, 3:31 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Nov 13, 2007 3:18 PM, <[EMAIL PROTECTED]> wrote: > > > On Nov 9, 5:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > En Tue, 06 Nov 2007 23:25:17 -0300, <[EMAIL PROTECTED]> escribió: > > > > One should make a lot of assum

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread Chris Mellon
On Nov 13, 2007 3:18 PM, <[EMAIL PROTECTED]> wrote: > On Nov 9, 5:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > En Tue, 06 Nov 2007 23:25:17 -0300, <[EMAIL PROTECTED]> escribió: > > > One should make a lot of assumptions about your code because it's not > > complete. Please post a min

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread sndive
On Nov 9, 5:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 06 Nov 2007 23:25:17 -0300, <[EMAIL PROTECTED]> escribió: > > > i naively created execution context: > > PyObject *execcontext = PyDict_New(); > > stuffed a handle in it: > > PyObject *ih = PyCObject_FromVoidPtr(han

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-09 Thread Gabriel Genellina
En Tue, 06 Nov 2007 23:25:17 -0300, <[EMAIL PROTECTED]> escribió: > i naively created execution context: > PyObject *execcontext = PyDict_New(); > stuffed a handle in it: > PyObject *ih = PyCObject_FromVoidPtr(handle, NULL); > int st= PyDict_SetItemString(res, "interp", ih); What's `r

Re: Private data

2007-03-19 Thread Dustan
On Mar 19, 7:31 am, Bruno Desthuilliers wrote: > Dustan a écrit : > > > > > On Mar 19, 4:09 am, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: > >> Dustan a écrit : > > >>>http://dustangroups.googlepages.com/privateattributesinpython > >>> This is something that I just threw together this mornin

Re: Private data

2007-03-19 Thread Dustan
On Mar 19, 3:06 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Dustan a écrit : > > >http://dustangroups.googlepages.com/privateattributesinpython > > May I report a small typo ? Absolutely. I might even fix it. > """ > def interanalDataDecorator(func): > """ > > Talking about private

Re: Private data

2007-03-19 Thread Bruno Desthuilliers
Dustan a écrit : > http://dustangroups.googlepages.com/privateattributesinpython > May I report a small typo ? """ def interanalDataDecorator(func): """ Talking about private attributes... !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Private data

2007-03-19 Thread Bruno Desthuilliers
Dustan a écrit : > On Mar 19, 4:09 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> Dustan a écrit : >> >>> http://dustangroups.googlepages.com/privateattributesinpython >>> This is something that I just threw together this morning, after a >>> eureka moment. It's a way of creating private cla

Re: Private data

2007-03-19 Thread Dustan
On Mar 19, 4:09 am, Bruno Desthuilliers wrote: > Dustan a écrit : > > >http://dustangroups.googlepages.com/privateattributesinpython > > > This is something that I just threw together this morning, after a > > eureka moment. It's a way of creating private class attributes > > What for ? We already

Re: Private data

2007-03-19 Thread Bruno Desthuilliers
Dustan a écrit : > http://dustangroups.googlepages.com/privateattributesinpython > > This is something that I just threw together this morning, after a > eureka moment. It's a way of creating private class attributes What for ? We already have one: prefix 'private' names with a single underscore

Re: Private data

2007-03-18 Thread Gabriel Genellina
En Sun, 18 Mar 2007 10:21:27 -0300, Dustan <[EMAIL PROTECTED]> escribió: dis.dis(testPrivateStaticFunctionVariables) > 21 0 LOAD_DEREF 0 (func) > 3 LOAD_DEREF 1 (internalData) > 6 LOAD_FAST0 (args) >

Re: Private data

2007-03-18 Thread Dustan
On Mar 18, 8:21 am, "Dustan" <[EMAIL PROTECTED]> wrote: > On Mar 18, 7:25 am, "Dustan" <[EMAIL PROTECTED]> wrote: > > > > > On Mar 18, 7:06 am, Steven D'Aprano > > > First, an example of the code in action. > > > > >>> import PrivateAttributes > > > >>> obj = PrivateAttributes.TestPrivateClassAttri

Re: Private data

2007-03-18 Thread Dustan
On Mar 18, 7:25 am, "Dustan" <[EMAIL PROTECTED]> wrote: > On Mar 18, 7:06 am, Steven D'Aprano > > First, an example of the code in action. > > > >>> import PrivateAttributes > > >>> obj = PrivateAttributes.TestPrivateClassAttributes() > > >>> obj.getNumInstances() > > 1 > > >>> another = PrivateAtt

Re: Private data

2007-03-18 Thread Dustan
On Mar 18, 7:17 am, "Dustan" <[EMAIL PROTECTED]> wrote: > On Mar 18, 5:26 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > > > En Sat, 17 Mar 2007 13:31:01 -0300, Dustan <[EMAIL PROTECTED]> > > escribió: > > > >http://dustangroups.googlepages.com/privateattributesinpython > > > > This is

Re: Private data

2007-03-18 Thread Dustan
On Mar 18, 7:06 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 17 Mar 2007 09:31:01 -0700, Dustan wrote: > >http://dustangroups.googlepages.com/privateattributesinpython > > > This is something that I just threw together this morning, after a > > eureka moment. It's a way of creating priv

Re: Private data

2007-03-18 Thread Dustan
On Mar 18, 5:26 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 17 Mar 2007 13:31:01 -0300, Dustan <[EMAIL PROTECTED]> > escribió: > > >http://dustangroups.googlepages.com/privateattributesinpython > > > This is something that I just threw together this morning, after a > > eureka mome

Re: Private data

2007-03-18 Thread Steven D'Aprano
On Sat, 17 Mar 2007 09:31:01 -0700, Dustan wrote: > http://dustangroups.googlepages.com/privateattributesinpython > > This is something that I just threw together this morning, after a > eureka moment. It's a way of creating private class attributes and > static function variables (I'm not 100% s

Re: Private data

2007-03-18 Thread Gabriel Genellina
En Sat, 17 Mar 2007 13:31:01 -0300, Dustan <[EMAIL PROTECTED]> escribió: > http://dustangroups.googlepages.com/privateattributesinpython > > This is something that I just threw together this morning, after a > eureka moment. It's a way of creating private class attributes and > static function v