Donovan Baarda | 1 Feb 2005 03:06
Picon
Picon
Gravatar

Re: Moving towards Python 3.0 (was Re: Speed up function calls)

On Tue, 2005-02-01 at 10:30 +1100, Donovan Baarda wrote:
> On Mon, 2005-01-31 at 15:16 -0500, Nathan Binkert wrote:
> > > Wouldn't it be nicer to have a facility that let you send messages
> > > between processes and manage concurrency properly instead?  You'll need
[...]
> A quick google search revealed this;
> 
> http://www.heise.de/ct/english/98/13/140/
> 
> Keeping in mind the high overheads of sharing memory between CPU's, the
> discussion about threads at this url seems to confirm; threads with
> shared memory are hard to distribute over multiple CPU's. Different OS's
> and/or thread implementations have tried (or just outright rejected)
> different ways of doing it, to varying degrees of success. IMHO, the
> fact that QNX doesn't distribute threads speaks volumes.

Sorry for replying to my reply, but I forgot the bit that brings it all
back On Topic :-)

The belief that the opcode granularity thread-switch driven by the GIL
is the cause of Python's threads being non-distributable is only half
true. 

Since OS's don't distribute threads well, any attempts to "Fix Python's
Threading" in an attempt to make its threads distributable is a waste of
time. The only thing that this might achieve would be to reduce the
latency on thread switches, maybe allowing faster response to OS events
like signals. However, the complexity introduced would cause more
problems than it would fix, and could easily result in worse
performance, not better.
(Continue reading)

Paul Moore | 1 Feb 2005 10:18
Picon
Gravatar

Re: python-dev Summary for 2004-12-16 through 2004-12-31 [draft]

On Mon, 31 Jan 2005 14:02:20 -0800, Brett C. <bac <at> ocf.berkeley.edu> wrote:
> 2.5 was released just before the time this summary covers so most stuff was on bug
> fixes discovered after the release.

Give Guido the time machine keys back!

I assume you meant 2.4, or is this a blatant attempt to get back ahead
of schedule with summaries? :-)

Paul.

PS If you look in this month's python-dev archives, you'll see
evidence of /F's last attempt to steal the time machine, with a
message posted from the "far future" of Feb 23rd, 2005. He clearly
stalled the machine, as he posted from an alternate reality. Let this
be a warning!
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

cedric paille | 1 Feb 2005 13:20
Picon

Python reference count question

Hi all, i'm working on an app that embed python 2.3 with Gnu/Linux, and i'd like to have some precisions:
 
I'm making python's modules to extend my application's functions with a built in script editor.
At now all works very well, but i'd like to know if i'm not forgetting some references inc/dec....
 
Here is a portion of my code:
 
static PyObject *
Scene_GetNodeGraph(PyObject *self, PyObject *args)
{
  NodeGraph* Ng = NodeGraph::GetInstance();
  std::vector<String> NodG;
  Ng->GetNodeGraph(NodG);
  PyObject* List = PyList_New(NodG.size());
  PyObject* Str = NULL;
  std::vector<String>::iterator it = NodG.begin();
  int i = 0;
  for (;it != NodG.end();it++)
  {
    Str = PyString_FromString(it->AsChar());
    PyList_SetItem(List,i,Str);
     i++;
  }
  return List;
}
 
Can someone take a look at this and tell me if i must add some inc/decref ?
 
Thanks.
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org
Aahz | 1 Feb 2005 16:50

Re: Python reference count question

On Tue, Feb 01, 2005, cedric paille wrote:
>
> Hi all, i'm working on an app that embed python 2.3 with Gnu/Linux,
> and i'd like to have some precisions:

python-dev is for the core developers to discuss bugs and patches.
Please use comp.lang.python for questions about using Python.  Thanks.
--

-- 
Aahz (aahz <at> pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Given that C++ has pointers and typecasts, it's really hard to have a serious 
conversation about type safety with a C++ programmer and keep a straight face.
It's kind of like having a guy who juggles chainsaws wearing body armor 
arguing with a guy who juggles rubber chickens wearing a T-shirt about who's 
in more danger."  --Roy Smith, c.l.py, 2004.05.23
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Steve Holden | 1 Feb 2005 16:32
Picon
Picon
Gravatar

Database import problems

I wonder if there is a developer with MySQL or sqlite and the 
appropriate Python interface module who can help me to understand a 
problem I'm experiencing trying to use PEP 302-style import hooks.

Basically I suspect we've either got an import bug or (more likely IMHO) 
a documentation bug, but I don't want to file on sf until I know exactly 
what the problem is, and I'm reluctant to use too much bandwidth on 
python-dev, which I know to be a busy list.

The background is visible in the Python-list archives starting at

http://mail.python.org/pipermail/python-list/2005-January/262148.html

Of course it's possible that a savvy developer can just tell me what the 
problem is by reading that thread.

If not, being a bear of little brain I need help from someone who is 
used to running debugging interpreters and can see exactly what's going 
on - my debugging system is fine for Python source, but has no insight 
into the interpreter code itself.

Since I'm not currently subscribed to python-dev an email response (or, 
better, a follow-up on the c.l.py thread) would be appreciated if you 
can solve this problem.

I'm happy to send full code off-list (or on-list, come to that) to 
anybody who can assist.

regards
  Steve
--

-- 
Meet the Python developers and your c.l.py favorites
Come to PyCon!!!!  http://www.python.org/pycon/2005/
Steve Holden               http://www.holdenweb.com/

_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Guido van Rossum | 1 Feb 2005 16:49
Picon
Gravatar

Re: Database import problems

On Tue, 01 Feb 2005 10:32:43 -0500, Steve Holden <steve <at> holdenweb.com> wrote:
> I wonder if there is a developer with MySQL or sqlite and the
> appropriate Python interface module who can help me to understand a
> problem I'm experiencing trying to use PEP 302-style import hooks.
[...]

I sent Steve a private reply pointing out the line
"sys.modules['path'] = path" in os.py.

--

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Neal Becker | 1 Feb 2005 17:11
Picon

complex I/O problem

If I call "print" on a complex value, I may get this:
'(2+2j)'

But this is not acceptable as input:
complex ('(2+2j)')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: complex() arg is a malformed string

Whatever format is used for output should be accepted as input!

_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

A.M. Kuchling | 1 Feb 2005 18:16
Picon
Gravatar

Re: complex I/O problem

On Tue, Feb 01, 2005 at 11:11:37AM -0500, Neal Becker wrote:
> complex ('(2+2j)')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ValueError: complex() arg is a malformed string
> 
> Whatever format is used for output should be accepted as input!

This isn't true in general; it's not true of strings, for example, nor
of files.  Parsing complex numbers would be pretty complicated,
because it would have to accept '(2+2j)', '2+2j', '3e-6j', and perhaps
even '4j+3'.  It seems easier to just use eval() than to make
complex() implement an entire mini-parser.

--amk
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Guido van Rossum | 1 Feb 2005 18:27
Picon
Gravatar

Re: complex I/O problem

On Tue, 1 Feb 2005 12:16:10 -0500, A.M. Kuchling <amk <at> amk.ca> wrote:
> On Tue, Feb 01, 2005 at 11:11:37AM -0500, Neal Becker wrote:
> > complex ('(2+2j)')
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> > ValueError: complex() arg is a malformed string
> >
> > Whatever format is used for output should be accepted as input!
> 
> This isn't true in general; it's not true of strings, for example, nor
> of files.  Parsing complex numbers would be pretty complicated,
> because it would have to accept '(2+2j)', '2+2j', '3e-6j', and perhaps
> even '4j+3'.  It seems easier to just use eval() than to make
> complex() implement an entire mini-parser.

Well, complex('2+2j') works, so it's not that far...

But the rules are different:

- There's no requirement whatsoever for str(); it can be whatever
makes the most sense for the type.

- For repr(), if at all possible, eval(repr(x)) == x should hold, in a
suitable environment (you may have to import certain things in the
namespace). If this can't be made true, repr(x) should be of the form
<...>.

- If there's no need for str() and repr() to be different, let str(x)
== repr(x).

So I think complex() is just fine.

--

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Josiah Carlson | 1 Feb 2005 18:31
Picon
Favicon

Re: complex I/O problem


"A.M. Kuchling" <amk <at> amk.ca> wrote:
> 
> On Tue, Feb 01, 2005 at 11:11:37AM -0500, Neal Becker wrote:
> > complex ('(2+2j)')
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> > ValueError: complex() arg is a malformed string
> > 
> > Whatever format is used for output should be accepted as input!
> 
> This isn't true in general; it's not true of strings, for example, nor
> of files.  Parsing complex numbers would be pretty complicated,
> because it would have to accept '(2+2j)', '2+2j', '3e-6j', and perhaps
> even '4j+3'.  It seems easier to just use eval() than to make
> complex() implement an entire mini-parser.

Which brings up the fact that while some things are able to make the
eval(str(obj)) loop, more are able to make the eval(repr(obj)) loop
(like strings themselves...).

 - Josiah

_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org


Gmane