Wednesday, February 3, 2010

comp.lang.python - 25 new messages in 10 topics - digest

comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en

comp.lang.python@googlegroups.com

Today's topics:

* test -- please ignore - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/87ebbae4005795a5?hl=en
* Trouble with os.system - 6 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/3f2521a2937658ef?hl=en
* Passing parameters in URL - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/52695ffb32fef94b?hl=en
* Dreaming of new generation IDE - 5 messages, 4 authors
http://groups.google.com/group/comp.lang.python/t/e019614ea149e7bd?hl=en
* ANN: GMPY 1.11 released - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/6b7dae7a8c90517e?hl=en
* Selenium/SauceLabs OpenSpace at Pycon - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/259ee71b81205891?hl=en
* Python-URL! - weekly Python news and links (Feb 3) - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/64f16b0c8c18c3f4?hl=en
* converting XML to hash/dict/CustomTreeCtrl - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/d581e29de4476d2f?hl=en
* How to guard against bugs like this one? - 2 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/fe6430e7980e2a96?hl=en
* The best library to create charting application - 3 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/7c14e5090a272c23?hl=en

==============================================================================
TOPIC: test -- please ignore
http://groups.google.com/group/comp.lang.python/t/87ebbae4005795a5?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Feb 3 2010 9:33 am
From: tinnews@isbd.co.uk


kj <no.email@please.post> wrote:
> In <87wryumvff.fsf@benfinney.id.au> Ben Finney <ben+python@benfinney.id.au> writes:
>
> >kj <no.email@please.post> writes:
>
> >> (my replies in a different comp.lang.python thread are getting
> >> rejected by the server; i have no problem posting to alt.test; and
> >> i'm trying to toubleshoot the problem further.)
>
> >Thank you for this explanation. It is important to know that you've
> >tried the less obtrusive diagnostics first. Good hunting.
>
> I figured out the immediate reason for the failure: when replying
> to *certain posts*, my newsreader omits the Newsgroups header from
> the response. Why it does this is still a mystery to me, but at
> least now I know what to look out for. Then again, I use the
> "venerable" (i.e. decrepit) nn as newsreader, so this discovery
> probably won't help many of those reading this...

I used to use nn, now I use tin which is fairly similar and still
being maintained.

--
Chris Green


==============================================================================
TOPIC: Trouble with os.system
http://groups.google.com/group/comp.lang.python/t/3f2521a2937658ef?hl=en
==============================================================================

== 1 of 6 ==
Date: Wed, Feb 3 2010 9:54 am
From: Gerald Britton


Can you post your code?

On Wed, Feb 3, 2010 at 12:47 PM, Cpa <cp.astolfi@gmail.com> wrote:
> Hi there,
>
> I'm having some trouble with os.system on Fedora 12.
> I have a bunch of .tex files in tmp/ and I want to compile them.
> In my shell, the following commands work perfectly : 'for file in tmp/
> *.tex; do pdflatex "$file"; done'.
>
> But if I use the same command using os.system(), it will compile
> correctly every file except the last one, for which it raises an error
> (I get a prompt, as if I did a syntax error in tex document).
>
> I suspected some kind of escaping issue, but it won't even work with
> files such as : foo.txt, bar.txt.
>
> Any idea ?
> Thanks,
> Cpa
> --
> http://mail.python.org/mailman/listinfo/python-list
>

--
Gerald Britton


== 2 of 6 ==
Date: Wed, Feb 3 2010 9:58 am
From: Cpa


Sure.

import sys,re,os
files2create = sys.argv[1:]
os.system('mkdir tmp')

# Some code to create the .tex

# Compile tex files
os.system('for file in tmp/*; do pdflatex "$file"; done')

Pretty simple, alas.

--
Cpa


On 3 fév, 18:54, Gerald Britton <gerald.brit...@gmail.com> wrote:
> Can you post your code?
>
>
>
> On Wed, Feb 3, 2010 at 12:47 PM, Cpa <cp.asto...@gmail.com> wrote:
> > Hi there,
>
> > I'm having some trouble with os.system on Fedora 12.
> > I have a bunch of .tex files in tmp/ and I want to compile them.
> > In my shell, the following commands work perfectly : 'for file in tmp/
> > *.tex; do pdflatex "$file"; done'.
>
> > But if I use the same command using os.system(), it will compile
> > correctly every file except the last one, for which it raises an error
> > (I get a prompt, as if I did a syntax error in tex document).
>
> > I suspected some kind of escaping issue, but it won't even work with
> > files such as : foo.txt, bar.txt.
>
> > Any idea ?
> > Thanks,
> > Cpa
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
> --
> Gerald Britton

== 3 of 6 ==
Date: Wed, Feb 3 2010 10:08 am
From: Gerald Britton


It kinda worked for me but I had to change it a little:

os.system('for file in /tmp/*.tex; do pdflatex "$file"; done')

Maybe you're picking up other files in /tmp that are not .tex files?

On Wed, Feb 3, 2010 at 12:58 PM, Cpa <cp.astolfi@gmail.com> wrote:
> Sure.
>
> import sys,re,os
> files2create = sys.argv[1:]
> os.system('mkdir tmp')
>
> # Some code to create the .tex
>
> # Compile tex files
> os.system('for file in tmp/*; do pdflatex "$file"; done')
>
> Pretty simple, alas.
>
> --
> Cpa
>
>
> On 3 fév, 18:54, Gerald Britton <gerald.brit...@gmail.com> wrote:
>> Can you post your code?
>>
>>
>>
>> On Wed, Feb 3, 2010 at 12:47 PM, Cpa <cp.asto...@gmail.com> wrote:
>> > Hi there,
>>
>> > I'm having some trouble with os.system on Fedora 12.
>> > I have a bunch of .tex files in tmp/ and I want to compile them.
>> > In my shell, the following commands work perfectly : 'for file in tmp/
>> > *.tex; do pdflatex "$file"; done'.
>>
>> > But if I use the same command using os.system(), it will compile
>> > correctly every file except the last one, for which it raises an error
>> > (I get a prompt, as if I did a syntax error in tex document).
>>
>> > I suspected some kind of escaping issue, but it won't even work with
>> > files such as : foo.txt, bar.txt.
>>
>> > Any idea ?
>> > Thanks,
>> > Cpa
>> > --
>> >http://mail.python.org/mailman/listinfo/python-list
>>
>> --
>> Gerald Britton
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

--
Gerald Britton


== 4 of 6 ==
Date: Wed, Feb 3 2010 10:42 am
From: Cpa


No, the tmp folder only contains files, and your modification still
won't work for me.

By the way I have the same error if I do:

files2compile = os.listdir('./tmp/')
for f in files2compile:
os.system('pdflatex '+f)

--
Cp

On 3 fév, 19:08, Gerald Britton <gerald.brit...@gmail.com> wrote:
> It kinda worked for me but I had to change it a little:
>
> os.system('for file in /tmp/*.tex; do pdflatex "$file"; done')
>
> Maybe you're picking up other files in /tmp that  are not .tex files?
>
>
>
> On Wed, Feb 3, 2010 at 12:58 PM, Cpa <cp.asto...@gmail.com> wrote:
> > Sure.
>
> > import sys,re,os
> > files2create = sys.argv[1:]
> > os.system('mkdir tmp')
>
> > # Some code to create the .tex
>
> > # Compile tex files
> > os.system('for file in tmp/*; do pdflatex "$file"; done')
>
> > Pretty simple, alas.
>
> > --
> > Cpa
>
> > On 3 fév, 18:54, Gerald Britton <gerald.brit...@gmail.com> wrote:
> >> Can you post your code?
>
> >> On Wed, Feb 3, 2010 at 12:47 PM, Cpa <cp.asto...@gmail.com> wrote:
> >> > Hi there,
>
> >> > I'm having some trouble with os.system on Fedora 12.
> >> > I have a bunch of .tex files in tmp/ and I want to compile them.
> >> > In my shell, the following commands work perfectly : 'for file in tmp/
> >> > *.tex; do pdflatex "$file"; done'.
>
> >> > But if I use the same command using os.system(), it will compile
> >> > correctly every file except the last one, for which it raises an error
> >> > (I get a prompt, as if I did a syntax error in tex document).
>
> >> > I suspected some kind of escaping issue, but it won't even work with
> >> > files such as : foo.txt, bar.txt.
>
> >> > Any idea ?
> >> > Thanks,
> >> > Cpa
> >> > --
> >> >http://mail.python.org/mailman/listinfo/python-list
>
> >> --
> >> Gerald Britton
>
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
> --
> Gerald Britton

== 5 of 6 ==
Date: Wed, Feb 3 2010 11:13 am
From: Jerry Hill


On Wed, Feb 3, 2010 at 12:58 PM, Cpa <cp.astolfi@gmail.com> wrote:
> Sure.
>
> import sys,re,os
> files2create = sys.argv[1:]
> os.system('mkdir tmp')
>
> # Some code to create the .tex
>
> # Compile tex files
> os.system('for file in tmp/*; do pdflatex "$file"; done')
>
> Pretty simple, alas.

I think your bug is in the lines you chose not to share with us. I
bet you've forgotten to close the last file you create, so that file
has changes that haven't been flushed out to the disk yet. Make sure
you call close() on each of the files when you're done writing them.

--
Jerry


== 6 of 6 ==
Date: Wed, Feb 3 2010 11:15 am
From: Charles-Pierre Astolfi


That was it ! What a stupid error...

Thank you !
--
Cp

On Wed, Feb 3, 2010 at 20:13, Jerry Hill <malaclypse2@gmail.com> wrote:
> On Wed, Feb 3, 2010 at 12:58 PM, Cpa <cp.astolfi@gmail.com> wrote:
>> Sure.
>>
>> import sys,re,os
>> files2create = sys.argv[1:]
>> os.system('mkdir tmp')
>>
>> # Some code to create the .tex
>>
>> # Compile tex files
>> os.system('for file in tmp/*; do pdflatex "$file"; done')
>>
>> Pretty simple, alas.
>
> I think your bug is in the lines you chose not to share with us.  I
> bet you've forgotten to close the last file you create, so that file
> has changes that haven't been flushed out to the disk yet.  Make sure
> you call close() on each of the files when you're done writing them.
>
> --
> Jerry
>

==============================================================================
TOPIC: Passing parameters in URL
http://groups.google.com/group/comp.lang.python/t/52695ffb32fef94b?hl=en
==============================================================================

== 1 of 3 ==
Date: Wed, Feb 3 2010 10:01 am
From: Alan Harris-Reid


I have a web-page where each row in a grid has edit/delete buttons to
enable the user to maintain a selected record on another page. The
buttons are in the form of a link with href='/item_edit?id=123', but
this string appears in the URL and gives clues as to how to bypass the
correct sequence of events, and could be risky if they entered the URL
directly (especially when it comes to deleting records).

Is there another way of passing a record-id to a method
a) without it appearing in the URL?
b) without the user being able to fathom-out how to attach which id to
which URL?

As each link contains row-id, I guess there is nothing to stop someone
from getting the id from the page source-code. Is it safe to use the
above href method if I test for authorised credentials (user/password
stored as session variables, perhaps?) before performing the edit/delete
action?

I am currently using CherryPy 3.2, but I guess the theory could apply to
any HTTP framework or web app..

Any help would be appreciated.
Alan Harris-Reid

== 2 of 3 ==
Date: Wed, Feb 3 2010 10:11 am
From: John Bokma


Alan Harris-Reid <alan@baselinedata.co.uk> writes:

> I have a web-page where each row in a grid has edit/delete buttons to
> enable the user to maintain a selected record on another page. The
> buttons are in the form of a link with href='/item_edit?id=123', but
> this string appears in the URL and gives clues as to how to bypass the
> correct sequence of events, and could be risky if they entered the URL
> directly (especially when it comes to deleting records).

You should *never* use a GET request to do actions like deleting
records. You already are aware of it being risky, so don't do this. You
should use GET for getting information, and POST for modifying information.

> Is there another way of passing a record-id to a method
> a) without it appearing in the URL?

Use a POST request. Note that the user still has to select something,
and that this information is send by the browser, and hence the user can
see this information (and maybe others), and repeat the action with, for
example, a Python program.

> b) without the user being able to fathom-out how to attach which id to
> which URL?

I am not sure what you want to prevent here. If you're afraid that user
A can delete things that belong user B, than "hiding" things or making
them "hard to guess" are not going to help much. If you have several
users, you must use some login procedure (and sessions).

> As each link contains row-id, I guess there is nothing to stop someone
> from getting the id from the page source-code. Is it safe to use the
> above href method if I test for authorised credentials (user/password
> stored as session variables, perhaps?) before performing the
> edit/delete action?

Yes. But still make sure that session ids are not easy to guess, and
expire. And make very sure that session ids can't leak to others.

Moreover, each time you modify a database use POST. One could argue to
also use POST for logging out, otherwise another site might be able to
log your users out if they visit that site.

--
John Bokma j3b

Hacking & Hiking in Mexico - http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development


== 3 of 3 ==
Date: Wed, Feb 3 2010 10:12 am
From: Paul Rubin


Alan Harris-Reid <alan@baselinedata.co.uk> writes:
> As each link contains row-id, I guess there is nothing to stop someone
> from getting the id from the page source-code. Is it safe to use the
> above href method if I test for authorised credentials (user/password
> stored as session variables, perhaps?) before performing the
> edit/delete action?

Well, if it's really ok for them to delete records programmatically even
if it's ok for them to delete through the web site. I'd probably
encrypt the post parameters if this was a concern.

==============================================================================
TOPIC: Dreaming of new generation IDE
http://groups.google.com/group/comp.lang.python/t/e019614ea149e7bd?hl=en
==============================================================================

== 1 of 5 ==
Date: Wed, Feb 3 2010 10:05 am
From: Phlip


On Feb 3, 3:10 am, Vladimir Ignatov <kmis...@gmail.com> wrote:

> Finally I develop a feeling that strong instrumentation / tools can
> bring us the best of two worlds. That I am dreaming on is an absolute
> new type/class of IDE suitable for Python and potentially for other
> dynamic-type languages. Instead of current text-oriented IDEs, it
> should be a database-centric and resemble current CAD systems instead
> of being just "fancy text editor". Source text should be an output
> product of that CAD and not a "source material" itself.

That's fine so long as I can also treat the source as source, at need.

You may have just reinvented Smalltalk's Squeak editor (reputedly the
testbed for all of modern GUIs...).

Current editors suck because they can't see into the code and browse
it - unless it's so statically typed it's painful.

That's why I wrote this:

http://www.oreillynet.com/onlamp/blog/2008/05/dynamic_languages_vs_editors.html


== 2 of 5 ==
Date: Wed, Feb 3 2010 10:24 am
From: John Bokma


Vladimir Ignatov <kmisoft@gmail.com> writes:

> Finally I develop a feeling that strong instrumentation / tools can
> bring us the best of two worlds. That I am dreaming on is an absolute
> new type/class of IDE suitable for Python and potentially for other
> dynamic-type languages. Instead of current text-oriented IDEs, it
> should be a database-centric and resemble current CAD systems instead
> of being just "fancy text editor". Source text should be an output
> product of that CAD and not a "source material" itself.

Your idea is certainly not new. Moreover, I've been using such an IDE
and implemented support for a (small) language in it:

Programs are hierarchical compositions of formulae satisfying
structural and extra-structural relationships. A program editor can
use knowledge of such relationships to detect and provide immediate
feedback about violations of them. The Synthesizer Generator is a
tool for creating such editors from language descriptions. An editor
designer specifies the desired relationships and the feedback to be
given when they are violated, as well as a user interface; from the
specification, the Synthesizer Generator creates a full-screen editor
for manipulating programs in the language.

http://portal.acm.org/citation.cfm?id=390010.808247

It might be a good start to read as much as possible on the Synthesizer
Generator if you want to write such an IDE for Python. I am sure you
could write such an IDE in the Synthesizer Generator, but I have no idea
if it's still available. And back when I used it (at university) one had
to pay for it, and most likely was closed source as well.

See also: http://www.google.com/search?q=synthesizer%20generator

--
John Bokma j3b

Hacking & Hiking in Mexico - http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development


== 3 of 5 ==
Date: Wed, Feb 3 2010 10:54 am
From: Stef Mientki


On 03-02-2010 18:21, Vladimir Ignatov wrote:
>>> Imagine simple operation like "method renaming" in a simple "dumb"
>>> environment like text editor + grep. Now imagine how simple it can be
>>> if system "knows" all your identifiers and just regenerates relevant
>>> portions of text from internal database-alike representation.
>>>
>>>
>> I think every IDE (not older than 20 years) does that already.
>>
> And fix every reference to it in all files? For python? I don't think
> so. I even don't think this is possible at all.
with tools like inspect it certainly should be possible
> That if several
> different objects have a similar named method? How will IDE "classify"
> calls and renames only some of calls and not others?
>
yep, you're right,
the IDE's I use have as the beste "search / select / rename".

But how often do you must/want to rename something (mature) ?

cheers,
Stef
> Vladimir Ignatov
>

== 4 of 5 ==
Date: Wed, Feb 3 2010 10:57 am
From: Adam Tauno Williams


On Wed, 2010-02-03 at 10:05 -0800, Phlip wrote:
> On Feb 3, 3:10 am, Vladimir Ignatov <kmis...@gmail.com> wrote:
> > Finally I develop a feeling that strong instrumentation / tools can
> > bring us the best of two worlds. That I am dreaming on is an absolute
> > new type/class of IDE suitable for Python and potentially for other
> > dynamic-type languages. Instead of current text-oriented IDEs, it
> > should be a database-centric and resemble current CAD systems instead
> > of being just "fancy text editor". Source text should be an output
> > product of that CAD and not a "source material" itself.
> That's fine so long as I can also treat the source as source, at need.
> You may have just reinvented Smalltalk's Squeak editor (reputedly the
> testbed for all of modern GUIs...).
> Current editors suck because they can't see into the code and browse
> it - unless it's so statically typed it's painful.

? I edit Python in MonoDevelop 2.2; and I can browse my file,
classes, etc... So I don't know what you mean by "can't see into the
code". It works pretty well.

Of course it can't tell that I've set x = {an integer}, as that only
happens at runtime.

> That's why I wrote this:
> http://www.oreillynet.com/onlamp/blog/2008/05/dynamic_languages_vs_editors.html


== 5 of 5 ==
Date: Wed, Feb 3 2010 11:38 am
From: Phlip


On Feb 3, 10:57 am, Adam Tauno Williams <awill...@opengroupware.us>
wrote:

> > Current editors suck because they can't see into the code and browse
> > it - unless it's so statically typed it's painful.
>
> ?  I edit Python in MonoDevelop  2.2;  and I can browse my file,
> classes, etc...  So I don't know what you mean by "can't see into the
> code".  It works pretty well.
>
> Of course it can't tell that I've set x = {an integer}, as that only
> happens at runtime.
>
> > That's why I wrote this:
> > http://www.oreillynet.com/onlamp/blog/2008/05/dynamic_languages_vs_editors.html

You just said that your code browsing "works pretty well, except when
it doesn't".

Hence my blog entry. If your editor analyzed your code at runtime,
instead of just static analysis, then it could see that x = an
integer, or an object, no matter how dynamic your language.

--
Phlip
http://zeekland.zeroplayer.com/Uncle_Wiggilys_Travels/1

==============================================================================
TOPIC: ANN: GMPY 1.11 released
http://groups.google.com/group/comp.lang.python/t/6b7dae7a8c90517e?hl=en
==============================================================================

== 1 of 2 ==
Date: Wed, Feb 3 2010 10:22 am
From: Mensanator


On Feb 3, 10:37 am, casevh <cas...@gmail.com> wrote:
> On Feb 2, 10:03 pm, Mensanator <mensana...@aol.com> wrote:
>
>
>
>
>
> > On Feb 2, 12:45 am, casevh <cas...@gmail.com> wrote:
>
> > > Everyone,
>
> > > I'm pleased to annouce the final release of GMPY 1.11.
> > > GMPY is a wrapper for the MPIR or GMP multiple-precision
> > > arithmetic library. GMPY 1.11 is available for download from:
>
> > >http://code.google.com/p/gmpy/
>
> > > In addition to support for Python 3.x, there are several new
> > > features in this release:
>
> > > - Even faster conversion to/from Python longs.
> > > - Performance improvements by reducing function overhead.
> > > - Performance improvements by improved caching.
> > > - Support for cdivmod, fdivmod, and tdivmod.
> > > - Unicode strings are accepted on Python 2.x and 3.x.
> > > - Fixed regression in GMPY 1.10 where True/False were no
> > >   longer recognized.
>
> > > Changes since 1.11rc1:
> > > - Recognizes GMP 5.
> > > - Bugs fixed in Windows binaries (MPIR 1.3.0rc3 -> 1.3.1).
>
> > > Comments on provided binaries
>
> > > The 32-bit Windows installers were compiled with MinGW32 using MPIR
> > > 1.3.1 and will automatically recognize the CPU type and use code
> > > optimized for the CPU at runtime. The 64-bit Windows installers were
> > > compiled Microsoft's SDK compilers using MPRI 1.3.1. Detailed
> > > instructions are included if you want to compile your own binary.
>
> > > Please report any issues!
>
> > My previous replies didn't show up. Something to do the .announce
> > group? I'll trim that and try again. Sorry if they show up eventually.
>
> > Two issues:
>
> > 1] why does both gmpy 1.11 and gmpy 1.11rc1 both reply
>
> > >>> gmpy.version()
>
> > '1.11'
>
> > Aren't these different versions? How are we supposed to tell them
> > apart?
>
> Check the name of source tarball?
>
> gmpy._cvsid() will return the internal source code revision number.
> The changes made in each revision number are listed athttp://code.google.com/p/gmpy/source/list.

So, '$Id: gmpy.c 237 2010-01-10 03:46:37Z casevh $' would be Revision
237
on that source list?

>
> I know some applications check gmpy.version(). I don't know if they'll
> work if the format of the string changes.

Then gmpy.version() isn't really intended to be a version per se,
it's just a level of compatibility for those programs that care?

>
>
>
> > 2] Is it true that the only changes since 1.11rc1 are not
> >    applicable to me since
>
> >    - I'm not using Windows
> >    - whether it recognizes GMP 5 is moot as GMP 5 cannot be
> >      compiled on a Mac (according to GMP site)
>
> Yes. The only change for GMP 5 was to recognize the new version number
> when running the tests.

Good.

>
>
>
> > Is it possible GMP's problems with getting GMP 5 to compile
> > are the same ones I had with 3.1 on Snow Leopard? (They bemoan
> > not having a set of every Mac system.) Think it would behoove
> > me to try it?
>
> According to comments on GMP's mailing list, the latest snapshot
> should work.ftp://ftp.gmplib.org/pub/snapshot/
>

I'll have to see if I can get it to work this weekend. I sure hope I
don't muck it up after after all the trouble I had getting the
previous
one to work.

Thanks for the links.

>
>
>
>
> > > casevh

== 2 of 2 ==
Date: Wed, Feb 3 2010 10:36 am
From: casevh


On Feb 3, 10:22 am, Mensanator <mensana...@aol.com> wrote:
> On Feb 3, 10:37 am, casevh <cas...@gmail.com> wrote:
>
>
>
> > On Feb 2, 10:03 pm, Mensanator <mensana...@aol.com> wrote:
>
> > > On Feb 2, 12:45 am, casevh <cas...@gmail.com> wrote:
>
> > > > Everyone,
>
> > > > I'm pleased to annouce the final release of GMPY 1.11.
> > > > GMPY is a wrapper for the MPIR or GMP multiple-precision
> > > > arithmetic library. GMPY 1.11 is available for download from:
>
> > > >http://code.google.com/p/gmpy/
>
> > > > In addition to support for Python 3.x, there are several new
> > > > features in this release:
>
> > > > - Even faster conversion to/from Python longs.
> > > > - Performance improvements by reducing function overhead.
> > > > - Performance improvements by improved caching.
> > > > - Support for cdivmod, fdivmod, and tdivmod.
> > > > - Unicode strings are accepted on Python 2.x and 3.x.
> > > > - Fixed regression in GMPY 1.10 where True/False were no
> > > >   longer recognized.
>
> > > > Changes since 1.11rc1:
> > > > - Recognizes GMP 5.
> > > > - Bugs fixed in Windows binaries (MPIR 1.3.0rc3 -> 1.3.1).
>
> > > > Comments on provided binaries
>
> > > > The 32-bit Windows installers were compiled with MinGW32 using MPIR
> > > > 1.3.1 and will automatically recognize the CPU type and use code
> > > > optimized for the CPU at runtime. The 64-bit Windows installers were
> > > > compiled Microsoft's SDK compilers using MPRI 1.3.1. Detailed
> > > > instructions are included if you want to compile your own binary.
>
> > > > Please report any issues!
>
> > > My previous replies didn't show up. Something to do the .announce
> > > group? I'll trim that and try again. Sorry if they show up eventually.
>
> > > Two issues:
>
> > > 1] why does both gmpy 1.11 and gmpy 1.11rc1 both reply
>
> > > >>> gmpy.version()
>
> > > '1.11'
>
> > > Aren't these different versions? How are we supposed to tell them
> > > apart?
>
> > Check the name of source tarball?
>
> > gmpy._cvsid() will return the internal source code revision number.
> > The changes made in each revision number are listed athttp://code.google.com/p/gmpy/source/list.
>
> So, '$Id: gmpy.c 237 2010-01-10 03:46:37Z casevh $' would be Revision
> 237
> on that source list?
>
Correct.
>
>
> > I know some applications check gmpy.version(). I don't know if they'll
> > work if the format of the string changes.
>
> Then gmpy.version() isn't really intended to be a version per se,
> it's just a level of compatibility for those programs that care?

Historically, gmpy really didn't have alpha/beta/rc versions and
gmpy.version() just had the version "number" and didn't indicate the
status. If I change it, I'd rather go to "1.1.1rc1" or "1.2.0a0" but
that might break some applications.

>
>
>
> > > 2] Is it true that the only changes since 1.11rc1 are not
> > >    applicable to me since
>
> > >    - I'm not using Windows
> > >    - whether it recognizes GMP 5 is moot as GMP 5 cannot be
> > >      compiled on a Mac (according to GMP site)
>
> > Yes. The only change for GMP 5 was to recognize the new version number
> > when running the tests.
>
> Good.
>
>
>
> > > Is it possible GMP's problems with getting GMP 5 to compile
> > > are the same ones I had with 3.1 on Snow Leopard? (They bemoan
> > > not having a set of every Mac system.) Think it would behoove
> > > me to try it?
>
> > According to comments on GMP's mailing list, the latest snapshot
> > should work.ftp://ftp.gmplib.org/pub/snapshot/
>
> I'll have to see if I can get it to work this weekend. I sure hope I
> don't muck it up after after all the trouble I had getting the
> previous
> one to work.
>
> Thanks for the links.
>
>
>
> > > > casevh
>
>


==============================================================================
TOPIC: Selenium/SauceLabs OpenSpace at Pycon
http://groups.google.com/group/comp.lang.python/t/259ee71b81205891?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Feb 3 2010 10:42 am
From: Raymond Hettinger


For those who are interested, the Sauce Labs team, http://saucelabs.com/about/team,
is hosting two free tutorial open space sessions at Pycon in Atlanta.

In the short session, people bringing their laptops should be able to
record a web session in their browser, convert the recorded activity
to a Python script, modify the script to accept a number of inputs ,
and replay the script locally on their laptops. Once you've learned
how to fully automate your own browser, submit the same script to the
Sauce Labs cloud to run the tests in parallel across multiple browsers
and operating systems, and view the results with instant video
playback.

The tutorials should be of interest to web developers wanting fast,
cross-browser testing and it should be of general interest to anyone
wanting to use Python to automate browser sessions.

The tutorials are being led by Jason Huggins, the creator of Selenium
(an open source web app testing tool http://seleniumhq.org/ ).
Several familiar names from the Python community will also be on-hand:
http://saucelabs.com/about/news/feb-03-2010

Raymond


==============================================================================
TOPIC: Python-URL! - weekly Python news and links (Feb 3)
http://groups.google.com/group/comp.lang.python/t/64f16b0c8c18c3f4?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Feb 3 2010 10:22 am
From: "Gabriel Genellina"


QOTW: "I think, in the spirit of the topic, they should hold it at both
places at the same time." - Brian Blais, on whether the Python Concurrency
Workshop, v2.0, should be in Chicago or Denver (in January!)


The fastest way to consume an iterable until exhaustion:
http://groups.google.com/group/comp.lang.python/t/c1ae3513a31eb63e/

When inheriting from a built-in class, it isn't obvious which of
__new__ / __init__ should be overriden:
http://groups.google.com/group/comp.lang.python/t/a453c65be4e0f355/

When importing a module, Python may pick the wrong one due to name
clashes -- is this avoidable?
http://groups.google.com/group/comp.lang.python/t/fe6430e7980e2a96/

Setting a default encoding for 'print' statements:
http://groups.google.com/group/comp.lang.python/t/2fb77c8989f63f9d/

Despite its name, the iglob function (in module glob) isn't completely
lazy:
http://groups.google.com/group/comp.lang.python/t/d9a8617ec85e926d/

list.pop(0) has very poor performance; collections.deque works better
in some cases; patch to allow lists to free elements from head (not just
from tail):
http://groups.google.com/group/comp.lang.python/t/9221d87f93748b3f/

How to parse ill-formed postal addresses:
http://groups.google.com/group/comp.lang.python/t/76a4ab9fd7279a4e/

The future of Python 3:
Adoption by Linux distros and package maintainers:
http://groups.google.com/group/comp.lang.python/t/69463c4b9b1ecd8f/
Library support:
http://groups.google.com/group/comp.lang.python/t/ae138cefffed0d6b/
Myths and fallacies:
http://groups.google.com/group/comp.lang.python/t/8b8f4a9f999e33e8/

Why choose Python (and not Ruby) in an introductory course to programming:
http://groups.google.com/group/comp.lang.python/t/dfe4f6c60032755e/

How an extension module (written in C) may perform cleaning tasks:
http://groups.google.com/group/comp.lang.python/t/fbcb22b4401eaef1/

"Really, the built-in scope is just a built-in module called builtins,
but you have to import builtins to query built-ins because the name
builtins is not itself built-in..." (Lutz & Ascher, 'Programming Python')
http://groups.google.com/group/comp.lang.python/t/dc719a4d922f2f87/

A new implementation of the GIL allows for much better performance
in multicore architectures:
http://groups.google.com/group/comp.lang.python/t/586ef2d3685fa7ea/

After a year of work with relative success, Unladen Swallow (a
Google sponsored CPython improvement project) asks to be officially
recognized:
http://comments.gmane.org/gmane.comp.python.devel/109919


========================================================================
Everything Python-related you want is probably one or two clicks away in
these pages:

Python.org's Python Language Website is the traditional
center of Pythonia
http://www.python.org
Notice especially the master FAQ
http://www.python.org/doc/FAQ.html

PythonWare complements the digest you're reading with the
marvelous daily python url
http://www.pythonware.com/daily

Just beginning with Python? This page is a great place to start:
http://wiki.python.org/moin/BeginnersGuide/Programmers

The Python Papers aims to publish "the efforts of Python enthusiasts":
http://pythonpapers.org/
The Python Magazine is a technical monthly devoted to Python:
http://pythonmagazine.com

Readers have recommended the "Planet" site:
http://planet.python.org

comp.lang.python.announce announces new Python software. Be
sure to scan this newsgroup weekly.
http://groups.google.com/group/comp.lang.python.announce/topics

Python411 indexes "podcasts ... to help people learn Python ..."
Updates appear more-than-weekly:
http://www.awaretek.com/python/index.html

The Python Package Index catalogues packages.
http://www.python.org/pypi/

Much of Python's real work takes place on Special-Interest Group
mailing lists
http://www.python.org/sigs/

Python Success Stories--from air-traffic control to on-line
match-making--can inspire you or decision-makers to whom you're
subject with a vision of what the language makes practical.
http://www.pythonology.com/success

The Python Software Foundation (PSF) has replaced the Python
Consortium as an independent nexus of activity. It has official
responsibility for Python's development and maintenance.
http://www.python.org/psf/
Among the ways you can support PSF is with a donation.
http://www.python.org/psf/donations/

The Summary of Python Tracker Issues is an automatically generated
report summarizing new bugs, closed ones, and patch submissions.
http://search.gmane.org/?author=status%40bugs.python.org&group=gmane.comp.python.devel&sort=date

Although unmaintained since 2002, the Cetus collection of Python
hyperlinks retains a few gems.
http://www.cetus-links.org/oo_python.html

Python FAQTS
http://python.faqts.com/

The Cookbook is a collaborative effort to capture useful and
interesting recipes.
http://code.activestate.com/recipes/langs/python/

Many Python conferences around the world are in preparation.
Watch this space for links to them.

Among several Python-oriented RSS/RDF feeds available, see:
http://www.python.org/channews.rdf
For more, see:
http://www.syndic8.com/feedlist.php?ShowMatch=python&ShowStatus=all
The old Python "To-Do List" now lives principally in a
SourceForge reincarnation.
http://sourceforge.net/tracker/?atid=355470&group_id=5470&func=browse
http://www.python.org/dev/peps/pep-0042/

del.icio.us presents an intriguing approach to reference commentary.
It already aggregates quite a bit of Python intelligence.
http://del.icio.us/tag/python

Enjoy the *Python Magazine*.
http://pymag.phparch.com/

*Py: the Journal of the Python Language*
http://www.pyzine.com

Dr.Dobb's Portal is another source of Python news and articles:
http://www.ddj.com/TechSearch/searchResults.jhtml?queryText=python
and Python articles regularly appear at IBM DeveloperWorks:
http://www.ibm.com/developerworks/search/searchResults.jsp?searchSite=dW&searchScope=dW&encodedQuery=python&rankprofile=8

Previous - (U)se the (R)esource, (L)uke! - messages are listed here:
http://search.gmane.org/?query=python+URL+weekly+news+links&group=gmane.comp.python.general&sort=date
http://groups.google.com/groups/search?q=Python-URL!+group%3Acomp.lang.python&start=0&scoring=d&
http://lwn.net/Search/DoSearch?words=python-url&ctype3=yes&cat_25=yes

There is *not* an RSS for "Python-URL!"--at least not yet. Arguments
for and against are occasionally entertained.


Suggestions/corrections for next week's posting are always welcome.
E-mail to <Python-URL@phaseit.net> should get through.

To receive a new issue of this posting in e-mail each Monday morning
(approximately), ask <claird@phaseit.net> to subscribe. Mention
"Python-URL!". Write to the same address to unsubscribe.


-- The Python-URL! Team--

Phaseit, Inc. (http://phaseit.net) is pleased to participate in and
sponsor the "Python-URL!" project. Watch this space for upcoming
news about posting archives.

==============================================================================
TOPIC: converting XML to hash/dict/CustomTreeCtrl
http://groups.google.com/group/comp.lang.python/t/d581e29de4476d2f?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Feb 3 2010 11:12 am
From: Astan Chee


Nobody wrote:
> The code you're using expects the XML to follow a particular format, and
> yours doesn't.
>
> You might want to start with a fairly direct translation, e.g.:
>
> def xmldict(e):
> d = {}
> d['tag'] = e.tag
> d.update(e.attrib)
> children = map(xmldict, e)
> if children:
> d['children'] = children
> text = e.text.strip()
> if text:
> d['text'] = text
> return d
>
> tree = ElementTree.parse('test.xml')
> root = tree.getroot()
> d = xmldict(root)
> pprint.pprint(d)
>
> then refine this as needed.
>
Thanks, that is simple enough for me to understand. I think I got it now.
Thanks again

==============================================================================
TOPIC: How to guard against bugs like this one?
http://groups.google.com/group/comp.lang.python/t/fe6430e7980e2a96?hl=en
==============================================================================

== 1 of 2 ==
Date: Wed, Feb 3 2010 11:22 am
From: Steve Holden


Don't give it another thought. I'd much rather you cared than you didn't ...

regards
Steve

kj wrote:
>
> Steve, I apologize for the snarkiness of my previous reply to you.
> After all, I started the thread by asking the forum for advice on
> how to avoid a certain kind of bugs, you were among those who gave
> me advice. So nothing other than thanking you for it was in order.
> I just let myself get carried away by my annoyance with the Python
> import scheme. I'm sorry about it. Even though I don't think I
> can put to practice all of your advice, I can still learn a good
> deal from it.
>
> Cheers,
>
> ~kj
>
>
> Steve Holden <steve@holdenweb.com> writes:
>
>> kj wrote:
>>>> First, I don't shadow built in modules. Its really not very hard to avoid.
>>> ...*if* you happen to be clairvoyant. I still don't see how the rest of us
>>> could have followed this fine principle in the case of numbers.py
>>> prior to Python 2.6.
>>>
>> Clearly the more you know about the standard library the less likely
>> this is to be a problem. Had you been migrqating from an earlier version
>> the breakage would have alerted you to look for some version-dependent
>> difference.
>
> <snip>
>


--
Steve Holden +1 571 484 6266 +1 800 494 3119
PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS: http://holdenweb.eventbrite.com/

== 2 of 2 ==
Date: Wed, Feb 3 2010 11:23 am
From: Steve Holden


kj wrote:
> In <hkbv23$c07$1@reader2.panix.com> kj <no.email@please.post> writes:
>
>
>> Steve, I apologize for the snarkiness of my previous reply to you.
>> After all, I started the thread by asking the forum for advice on
>> how to avoid a certain kind of bugs, you were among those who gave
>> me advice. So nothing other than thanking you for it was in order.
>> I just let myself get carried away by my annoyance with the Python
>> import scheme. I'm sorry about it. Even though I don't think I
>> can put to practice all of your advice, I can still learn a good
>> deal from it.
>
>
> Boy, that was dumb of me. The above apology was meant for Stephen
> Hansen, not Steve Holden. I guess this is now a meta-apology...
> (Sheesh.)
>
Oh, so you don't like *my* advice? ;-)

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS: http://holdenweb.eventbrite.com/


==============================================================================
TOPIC: The best library to create charting application
http://groups.google.com/group/comp.lang.python/t/7c14e5090a272c23?hl=en
==============================================================================

== 1 of 3 ==
Date: Wed, Feb 3 2010 11:30 am
From: mk

The application will display (elaborate) financial charts.

Pygame? Smth else?

<duck>dotnet?


Regards,
mk

== 2 of 3 ==
Date: Wed, Feb 3 2010 11:43 am
From: Phlip


mk wrote:
>
> The application will display (elaborate) financial charts.
>
> Pygame? Smth else?

Back in the day it was Python BLT.

Are you on the Web or the Desktop?

--
Phlip
http://www.oreillynet.com/onlamp/blog/2008/05/dynamic_languages_vs_editors.html


== 3 of 3 ==
Date: Wed, Feb 3 2010 11:50 am
From: mk


Phlip wrote:
> mk wrote:
>>
>> The application will display (elaborate) financial charts.
>>
>> Pygame? Smth else?
>
> Back in the day it was Python BLT.
>
> Are you on the Web or the Desktop?
>

Desktop, really (there should be some nominal web interface but the main
application will be desktop)

Regards,
mk

==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.python"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.python?hl=en

To unsubscribe from this group, send email to comp.lang.python+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.python/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

No comments:

Post a Comment