Ladies and gentlemen, you are about to hear a very frightening speech. This speech is an explanation of the plans now being laid to throw the United States into a third world war.

2010-07-03 Thread nanothermite911fbibustards
Ladies and gentlemen, you are about to hear a very frightening
speech.  This speech is an explanation of the plans now being laid to
throw the United States into a third world war.

A CHRISTIAN VIEW OF THE HOLOCAUST

Ladies and gentlemen, you are about to hear a very frightening
speech.  This speech is an explanation of the plans now being laid to
throw the United States into a third world war.  It was made a short
time ago before a large group in the Congressional `Room of the
Willard Hotel in Washington, D.C.  Both the speech and the question
and answer period later so electrified the audience that a group of
patriots has transferred it to two long-playing records which you may
buy to play for friends, clubs, and your church group in your
community. The speaker is Mr. Benjamin Freedman, noted authority on
Zionism and all of its schemes. Mr. Freedman is a former Jew, and I
mean a FORMER Jew.  He has fought the Communist world conspiracy tooth
and nail, and stands today as a leading American patriot. We now take
you to the speaker's platform to present Benjamin Freedman.

(applause)

[Freedman's speech]

 What I intend to tell you tonight is something that you have
never been able to learn from any other source, and what I tell you
now concerns not only you, but your children and the survival of this
country and Christianity.  I'm not here just to dish up a few facts to
send up your blood pressure, but I'm here to tell you things that will
help you preserve what you consider the most sacred things in the
world:  the liberty, and the freedom, and the right to live as
Christians, where you have a little dignity, and a little right to
pursue the things that your conscience tells you are the right things,
as Christians.

   Now, first of all, I'd like to tell you that on August 25th 1960 --
that was shortly before elections -- Senator Kennedy, who is now the
President of the United States, went to New York, and delivered an
address to the Zionist Organization of America.   In that address, to
reduce it to its briefest form, he stated that he would use the armed
forces of the United States to preserve the existence of the regime
set up in Palestine by the Zionists who are now in occupation of that
area.

  In other words, Christian boys are going to be yanked out of their
homes, away from their families, and sent abroad to fight in Palestine
against the Christian and Moslem Arabs who merely want to return to
their homes. And these Christian boys are going to be asked to shoot
to kill these innocent [Arab Palestinians] people who only want to
follow out fifteen resolutions passed by the United Nations in the
last twelve years calling upon the Zionists to allow these people to
return to their homes.

 Now, when United States troops appear in the Middle East to fight
with the Zionists as their allies to prevent the return of these
people who were evicted from their homes in the 1948 armed
insurrection by the Zionists who were transplanted there from Eastern
Europe... when that happens, the United States will trigger World War
III.

 You say, when will that take place?  The answer is, as soon as
the difficulty between France and Algeria has been settled, that will
take place.  As soon as France and Algeria have been settled, that
will take place. As soon as France and Algeria have settled their
difficulty, and the Arab world, or the Moslem world, has no more war
on their hands with France, they are going to move these people back
into their homes, and when they do that and President kennedy sends
your sons to fight over there to help the crooks hold on to what they
stole from innocent men, women and children, we will trigger World War
III; and when that starts you can be sure we cannot emerge from that
war a victor. We are going to lose that war because there is not one
nation in the world that will let one of their sons fight with us for
such a cause.

 I know and speak to these ambassadors in Washington and the
United Nations -- and of the ninety-nine nations there, I've consulted
with maybe seventy of them -- and when we go to war in Palestine to
help the thieves retain possession of what they have stolen from these
innocent people we're not going to have a man there to fight with us
as our ally.

   And who will these people have supporting them, you ask.  Well,
four days after President Kennedy -- or he was then Senator Kennedy --
made that statement on August 28, 1960, the Arab nations called a
meeting in Lebanon and there they decided to resurrect, or reactivate,
the government of Palestine, which has been dormant more or less,
since the 1948 armed insurrection by the Zionists.

 Not only that... they ordered the creation of the Palestine Army,
and they are now drilling maybe a half a million soldiers in that area
of the world to lead these people back to their  homeland.  With them,
they have as their allies all the nations of what is termed the
Bandung Conference Group.  That includes t

The eastern European Jews, who form 92 per cent of the world's population of those people who call themselves Jews, were originally Khazars.

2010-07-03 Thread small Pox
The eastern European Jews, who form 92 per cent of the world's
population of those people who call themselves Jews, were originally
Khazars.

Now, what are the facts about the Jews?

 The Jews -- I call them Jews to you, because they are known as
Jews. I don't call them Jews.  I refer to them as so-called Jews,
because I know what they are.  If Jesus was a Jew, there isn't a Jew
in the world today, and if those people are Jews, certainly our Lord
and Savior was not one of them, and I can prove that.

 Now what happened?  The eastern European Jews, who form 92 per
cent of the world's population of those people who call themselves
Jews, were originally Khazars.

 They were a warlike tribe that lived deep in the heart of Asia.
And they were so warlike that even the Asiatics drove them out of Asia
into eastern Europe -- and to reduce this so you don't get too
confused about the history of Eastern Europe -- they set up this big
Khazar kingdom: 800,000 square miles.  Only, there was no Russia,
there were no other countries, and the Khazar kingdom was the biggest
country in all Europe -- so big and so powerful that when the other
monarchs wanted to go to war, the Khazars would lend them 40,000
soldiers. That's how big and powerful they were.

  Now, they were phallic worshippers, which is filthy.  I don't
want to go into the details of that now.  It was their religion the
way it was the religion of many other Pagans or Barbarians elsewhere
in the world.

 Now, the [Khazar] king became so disgusted with the degeneracy of
his kingdom that he decided to adopt a so-called monotheistic faith --
either  Christianity, Islam -- the Moslem faith -- or what is known
today as Judaism -- really Talmudism.  So, like spinning a top and
calling out "eeny, meeny, miney, moe,"  he picked out so-called
Judaism.  And that became the state religion.

 He sent down to the Talmudic schools of Pumbedita and Sura and
brought up thousands of these rabbis with their teachings, and opened
up synagogues and schools in his kingdom of 800,000 people -- 800,000
thousand square miles -- and maybe ten to twenty million people; and
they became what we call Jews.  There wasn't one of them that had an
ancestor that ever put a toe in the Holy Land, not only in Old
Testament history, but back to the beginning of time.  Not one of
them!  And yet they come to the Christians and they ask us to support
their armed insurrection in Palestine by saying:

"Well, you want to certainly help repatriate God's  chosen people
to their Promised Land, their ancestral homeland,  It's your Christian
duty.  We gave you one of our boys as your Lord and Savior.  You now
go to church on Sunday, and kneel and you worship a Jew, and we're
Jews."

 Well, they were pagan Khazars who were converted just the same as
the Irish [were converted].  And it's just as ridiculous to call them
"people of the Holy Land," as it would be. . . there are 54 million
Chinese Moslems.  Fifty four million!  And, Mohammed only died in 620
A.D., so in that time, 54 million Chinese have accepted Islam as their
religious belief.

 Now imagine, in China, 2,000 miles away from Arabia, where the
city of Mecca is located, where Mohammed was born. . . imagine if the
54 million Chinese called themselves  'Arabs'.  Imagine! Why, you'd
say they're lunatics.  Anyone who believes that those 54 million
Chinese are Arabs must be crazy.  All they did was adopt as a
religious faith; a belief that had its origin in Mecca, in Arabia.

  The same as the Irish.  When the Irish became Christians, nobody
dumped them in the ocean and imported from the Holy Land a new crop of
inhabitants that were Christians. They weren't different people.  They
were the same people, but they had accepted Christianity as a
religious faith.

 Now, these Pagans, these Asiatics, these Turko-Finns. . . they
were a Mongoloid race who were forced out of Asia into eastern
Europe.  They likewise, because their king took the faith -- Talmudic
faith -- they had no choice.  Just the same as in Spain:  If the king
was Catholic, everybody had to be a Catholic.  If not, you had to get
out of Spain.  So everybody -- they lived on the land just like the
trees and the bushes; a human being belonged to the land under their
feudal system -- so they [Khazars] all became what we call today,
Jews!

  Now imagine how silly it was for the Christians. . . for the
great Christian countries of the world to say, "We're going to use our
power, our prestige to repatriate God's chosen people to their
ancestral homeland, their Promised Land."

 Now, could there be a bigger lie than that?  Could there be a
bigger lie than that?

 And because they control the newspapers, the magazines, the
radio, the television, the book publishing business, they have the
ministers in the pulpit, they have the politicians on the soap boxes
talking the same language . . . so naturally you'd believe black is
white if you heard it ofte

SCHOLARLY TESTIMONIAL VIDEO : Joseph Moshe (MOSSAD Microbiologist) Swine flu vaccine 1

2010-07-03 Thread small Pox

Joseph Moshe (MOSSAD Microbiologist) Swine flu vaccine 1
http://www.youtube.com/watch?v=9ranNpzlXIo

Part 1 Today, the MSM are not talking about this case any more.
Yesterday, they wanted us to believe that Joseph Moshe was a nutcase
and a terrorist, arrested for threatening to bomb the White House.
Interesting detail about his arrest (the Westwood standoff) was that
he seemed to be immune to the 5 cans of tear gas and 5 gallons of law-
enforcement grade pepper spray they pumped into his face. He very
calmly remained in his car, as the video footage of his arrest shows.


Professor Moshe had called into a live radio show by Dr. A. True Ott,
(explanation of Joseph Moshes call at 06:00) broadcast on Republic
Broadcasting claiming to be a microbiologist who wanted to supply
evidence to a States Attorney regarding tainted H1N1 Swine flu
vaccines being produced by Baxter BioPharma Solutions. He said that
Baxters Ukrainian lab was in fact producing a bioweapon disguised as a
vaccine. He claimed that the vaccine contained an adjuvant (additive)
designed to weaken the immune system, and replicated RNA from the
virus responsible for the 1918 pandemic Spanish flu, causing global
sickness and mass death.

Joseph Moshe was soon after his arrest sent or let go to Israel.
Nothing has been heard from him since. The Secret Service was not the
agency involved in the surveillance of Moshe at his home in
California. This was done by the FBI, who had orders to detain or
arrest him. Mounted on top of a large black vehicle used in his arrest
was a microwave weapon that possibly damaged the electronics in Moshes
car as well as any communication devices he had which might have been
used to contact the media or others who could help him.
Baxter Pharmaceutical has been caught, red-handed, in spreading a
live, genetically engineered H5N1 Bird flu vaccine as a lethal
biological weapon all over the world, destined to be used for human
vaccinations. This happened just a few months ago.

Baxter International Inc. had mixed live, genetically engineered avian
flue viruses in vaccine material shipped to 18 countries.

Baxter knew full well that their vaccine was lethal, because the year
before they had tested it on a few hundred homeless Polish people
dozens died as a result.

Qui bono? We think it may be profit-motivated, but for the conspiracy-
minded: The latter complaint alludes to intentional culling of the
herd. Have you heard of the Georgia Guidestones? An enormous monument
loaded with Masonic symbolism costing millions of dollars, it has been
erected by unknown, powerful elites (multimillionaires with the clout
to erect monuments wherever they please, obviously) around 30 years
ago. It gives an alternative ten commandments, of which the first is
the extermination of six and a half billion people from the face of
the Earth. Half a billion will remain. This is the number of people
the planet can sustain indefinitely, so that the descendents of the
Rothschilds and Rockefellers can live in peace and affluence
indefinitely. Slaves are needed to produce that luxury, but 500
million will do just fine. But how does one go about killing off most
of the world?

Vaccinating the planet with a bioweapon with near-100% mortality would
do the trick. Baxter would provide both the bioweapon as well as the
vaccine against it to civilized Western peoples. Result: We can
plunder Africa, we have no more competition from SE Asia, the oil is
for our taking and only Western and perhaps Chinese sheeple remain.

Rockefeller said this in 1994 at a U.N. dinner: We are on the verge of
a global transformation. All we need is the right major crisis, and
the nations will accept the New World Order. PNAC said something
similar right before 9/11.

A Spanish Doctor in Internal Medicine largely agrees with the above
article:

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: delegation pattern via descriptor

2010-07-03 Thread kedra marbun
if we limit our discussion to py:
why __{get|set|delete}__ don't receive the 'name' & 'class' from
__{getattribute|{set|del}attr}__
'name' is the name that is searched
'class' is the class whose __dict__ has 'name' bound to descriptor

delegator & delegator are terms from delegation pattern (oop) which is
a specialized  area of IoC
delegate refers to helper obj, which is descriptor obj in the case of
descriptor
delegator is the obj that delegates task to helper obj

oh crap, brazil lost, but i admit effort of the dutch is awesome
if fifa['wc']['2010'].winner is not netherlands: raise SystemError
#bugfix
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: delegation pattern via descriptor

2010-07-03 Thread Mark Lawrence

On 02/07/2010 14:28, kedra marbun wrote:

hello, friendliest prog lang community on earth ;)

Flattery will get you everywhere.



[snip]


wow, it's almost time for brazil to beat the dutch, sorry Guido ;)
if fifa['wc']['2010'].winner is not brazil: raise SystemError

Have you run this and get your SystemError yet? :)

Kindest regards.

Mark Lawrence


--
http://mail.python.org/mailman/listinfo/python-list


Re: delegation pattern via descriptor

2010-07-03 Thread Thomas Jollans
On 07/03/2010 10:59 AM, kedra marbun wrote:
> if we limit our discussion to py:
> why __{get|set|delete}__ don't receive the 'name' & 'class' from
> __{getattribute|{set|del}attr}__
> 'name' is the name that is searched
> 'class' is the class whose __dict__ has 'name' bound to descriptor

http://users.rcn.com/python/download/Descriptor.htm#descriptor-protocol

descr.__get__(self, obj, type=None) --> value

descr.__set__(self, obj, value) --> None

descr.__delete__(self, obj) --> None

These methods are passed the object they're operating on. If the name is
in any way important, which is almost certainly is not, it can either be
passed in to the constructor of the descriptor or determined by
introspection.

> 
> delegator & delegator are terms from delegation pattern (oop) which is
> a specialized  area of IoC
> delegate refers to helper obj, which is descriptor obj in the case of
> descriptor
> delegator is the obj that delegates task to helper obj

you are making no sense.

> 
> oh crap, brazil lost, but i admit effort of the dutch is awesome
> if fifa['wc']['2010'].winner is not netherlands: raise SystemError
> #bugfix

-- 
http://mail.python.org/mailman/listinfo/python-list


loading configuration files that are themselves python

2010-07-03 Thread Matthew Vernon
Hi,

Is there a more idiomatic way of loading in a configuration file
that's python code than:

_temp=__import__(path,fromlist='cachestrs')
cachestrs=_temp.cachestrs

? I mean, that's pretty ugly...Plain "import" doesn't work in this
case because 'path' is a variable defined elsewhere

TIA,

Matthew

-- 
Rapun.sel - outermost outpost of the Pick Empire
http://www.pick.ucam.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: loading configuration files that are themselves python

2010-07-03 Thread Peter Otten
Matthew Vernon wrote:

> Is there a more idiomatic way of loading in a configuration file
> that's python code than:
> 
> _temp=__import__(path,fromlist='cachestrs')
> cachestrs=_temp.cachestrs
> 
> ? I mean, that's pretty ugly...Plain "import" doesn't work in this
> case because 'path' is a variable defined elsewhere

execfile(path) 

in a module with a fixed name that you can import wherever you need access 
to your configuration data?

Peter

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Sorting dicts inside dicts

2010-07-03 Thread Eli Bendersky
On Sat, Jul 3, 2010 at 03:34, MRAB  wrote:

> abhijeet thatte wrote:
>
>> Hi,
>> I have a huge dict structure like below:
>>
>> /*{'module':{'reg_dict_0':{'name':'abc','reg_addr':'2004'},'reg_dict_1':{'name':'xyz','reg_addr':'2002'},'reg_dict_2':{'name':'pqr','reg_addr':'2008'}}*/
>>
>> Module dict and reg_dicts contain many elements than shown.
>> I want to sort this 'module' dictionary as per 'reg_addr' element in every
>> 'reg_dict'.
>> There is no relation between 'reg_dict' suffix and address. So, reg_dict_0
>> can contain reg_address = 2000/72 (any number)
>> I do not want output in a list format as the actual dict size is huge
>> which I want to use based on key value pair.
>>
>> So, I want output as :
>>
>>
>> /*{'module':{'reg_dict_1':{'name':'xyz','reg_addr':'2002'},'reg_dict_0':{'name':'abc','reg_addr':'2004'},'reg_dict_2':{'name':'pqr','reg_addr':'2008'}}*/
>> /*
>> */
>>
>> Is it possible to sort the things? What I guess is Python stores dicts in
>> a tree like structure but I am forcing it to store the way I want. Is it
>> possible  to do something like that.
>>
>>  Python dicts are implemented as hash tables, not trees, for speed, and
> they are unordered.
>
> If the order matters then you should use an ordered dict instead. You
> should be able to find an implementation of one.
>
> The easiest way to find such an implementation is in the standard library
of Python, starting with Python 3.1 (collections.OrderedDict)

Eli
-- 
http://mail.python.org/mailman/listinfo/python-list


Join July Global Python meetings via VOIP - Free SW HW Culture Mtgs - BerkeleyTIP

2010-07-03 Thread giovanni_re
Watch some videos. Mark your calendar. Invite your friends.
Join in on IRC or Voice.  Join the mailing list, say "Hi.  :)"

=  1)  2010.7 Videos:
Building the Python Community, Steve Holden, PyCon 2010
How Python, TurboGears, and MongoDB are Transforming SourceForge.net,
  Rick Copeland, PyCon
Introducing Numpy Arrays, unpingco

Motorola Droid Metro PCS Apps, makeitcricket.com
How to write VOIP client in less then 2 minutes, rpdammu
Open Wonderland virtual worlds platform, Nicole Yankelovich, iED
How to Succeed in Mobile, Girl Geek Dinner, Kris Corzine
Using KDE Marble to research your next vacation, Justin Kirby 
Schizophrenic Firewalls - virtualized net stack OpenBSD, Claudio Jeker
Meet Google Founder Larry Page, Google Faculty Summit 2009

http://sites.google.com/site/berkeleytip/talk-videos/2010-7-videos

==  July Meetings  -  Mark your calendar:
 3 Sat 12N-3P PST = 3-6P EST = 19-22 UTC
12 Mon  5 -6P PST = 8-9P EST =  0- 1 UTC Tues 13
18 Sun 12N-3P PST = 3-6P EST = 19-22 UTC
27 Tue  5 -6P PST = 8-9P EST =  0- 1 UTC Wed 28


=
You're invited to join in with the friendly people at the BerkeleyTIP
global meeting  -  newbie to Ph.D. -  everyone is invited.

Get a headset & join using VOIP online, or come to Berkeley.

1st step: Join the mailing list:
http://groups.google.com/group/BerkTIPGlobal

Watch the videos.  Discuss them on VOIP.
10 great videos/talks this month.

Join with us at the Golden Bear Cafe, Upper Sproul Plaza, UCB
 at the University of California at Berkeley,
or join from your home via VOIP,
or send this email locally, create a local meeting, & join via VOIP:
  Tip: a wifi cafe is a great place to meet. :)

PLEASE VIEW THE BTIP WEBSITE & MAILING LIST FOR LATEST DETIALS.
http://sites.google.com/site/berkeleytip

BerkeleyTIP  -  Educational, Productive, Social
For Learning about, Sharing, & Producing, All Free SW HW & Culture.
TIP ==  Talks, Installfest, Project & Programming Party


=  CONTENTS:  1) 2010 JULY VIDEOS;  2) 2010 JULY MEETING DAYS,
TIMES, LOCATIONS;  3) LOCAL MEETING AT U. C. Berkeley;
4) HOT TOPICS;  5) PLEASE  RSVP  PROBABILISTICALLY, THANKS :) ;
6) INSTALLFEST;  7) ARRIVING FIRST AT THE MEETING: MAKE A
"BerkeleyTIP" SIGN;  8) IRC: #berkeleytip  on  irc.freenode.net; 9) VOIP
FOR GLOBAL MEETING;  10) VOLUNTEERING, TO DOs;  11) MAILING LISTS:
BerkeleyTIP-Global, LocalBerkeley, Announce;  12) ANYTHING I FORGOT TO
MENTION?;  13) FOR FORWARDING


===
=  1)   -  See videos list at top of this email.
Thanks to all the speakers, organizations, & videographers. :)
[Please alert the speakers that their talks are scheduled for 
BTIP (if you are with the group that recorded their talk), because I may
not have time to do that.  Thanks. :)  ]

Download & watch these talks before the BTIP meetings. Discuss at the
meeting.

Email the mailing list, tell us what videos you'll watch & want to
discuss.

Know any other video sources? - please email me.

_Your_ group should video record & post online your meeting's talks!


=  2)  2010 JULY MEETING DAYS, TIMES, LOCATIONS
http://sites.google.com/site/berkeleytip/schedule
http://sites.google.com/site/berkeleytip/directions

In person meetings on 1st Saturday & 3rd Sunday, every month.
July 3 & 18, 12N-3P USA-Pacific time, Saturday, Sunday
July 3  = Golden Bear Cafe, Upper Sproul Plaza, UCB
July 18 = Free Speech Cafe, Moffitt Library, UCB

Online only meeting using VOIP - 9 days after weekend meetings:
July 12 & 27, 5-6P   USA-Pacific time, Monday, Tuesday

Mark your calendars.


=  3)  LOCAL MEETING AT  U. C. BERKELEY
http://sites.google.com/site/berkeleytip/directions

RSVP please.  See below.  It greatly helps my planning.  But, _do_ come
if you forgot to RSVP.

ALWAYS BE SURE TO CHECK THE BTIP WEBSITE _&_ MAILING LIST FOR THE LATEST
LAST MINUTE DETAILS & CHANGES, BEFORE COMING TO THE MEETING! :)

DO BRING A VOIP HEADSET, available for $10-30 at most electronics retail
stores, & a laptop computer, so you are able to communicate with the
global BTIP community via VOIP.  It is highly recommended that you have
a voip headset, & not rely on a laptop's built in microphone & speakers,
because the headphones keep the noise level down.  Bringing a headset is
not required, but is a great part of the being able to communicate with
the global community. :)

Clothing: Typically 55-80 degrees F.  Weather:
http://www.wunderground.com/auto/sfgate/CA/Berkeley.html

Other location local meeting possibilities:
http://sites.google.com/site/berkeleytip/local-meetings
Create a local meeting in your town. Invite your friends.  :)  


=  4)  HOT TOPICS
Android phones - Besting iPhone? worthwhile? How knowable is the hw?
iPad, iPhone4 & iPod- rooting & running GNU(Linux)
Skype for group video conferencing?
Open Wonderland virtual worlds platform


=  5)  PLEASE  RSVP  PROBABILISTICALLY, THANKS  :)
If you think there is a >70% chance ("likely") you'll come to the in
person 

Re: loading configuration files that are themselves python

2010-07-03 Thread Bruno Desthuilliers
Matthew Vernon a écrit :
> Hi,
> 
> Is there a more idiomatic way of loading in a configuration file
> that's python code than:
> 
> _temp=__import__(path,fromlist='cachestrs')
> cachestrs=_temp.cachestrs
> 
> ? I mean, that's pretty ugly...Plain "import" doesn't work in this
> case because 'path' is a variable defined elsewhere

At least you have a way to do it, so you should be happy !-)

Another solution would be to add the path to sys.path, but it wouldn't
necessarily be the best thing to do here.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: loading configuration files that are themselves python

2010-07-03 Thread Matthew Vernon
Peter Otten <__pete...@web.de> writes:

> Matthew Vernon wrote:
> 
> > Is there a more idiomatic way of loading in a configuration file
> > that's python code than:
> > 
> > _temp=__import__(path,fromlist='cachestrs')
> > cachestrs=_temp.cachestrs
> > 
> > ? I mean, that's pretty ugly...Plain "import" doesn't work in this
> > case because 'path' is a variable defined elsewhere
> 
> execfile(path) 
> 
> in a module with a fixed name that you can import wherever you need access 
> to your configuration data?

That looks like what I want, thanks :)

Matthew

-- 
Rapun.sel - outermost outpost of the Pick Empire
http://www.pick.ucam.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: delegation pattern via descriptor

2010-07-03 Thread Bruno Desthuilliers
kedra marbun a écrit :
> if we limit our discussion to py:
> why __{get|set|delete}__ don't receive the 'name' & 'class' from
> __{getattribute|{set|del}attr}__
> 'name' is the name that is searched

While it would have been technically possible, I fail to imagine any use
case for this.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-03 Thread Nobody
On Fri, 02 Jul 2010 12:07:33 -0700, John Nagle wrote:

>> I think one point which needs to be emphasized more is what does
>> python 3 bring to people. The" what's new in python 3 page" gives
>> the impression that python 3 is about removing cruft. That's a very
>> poor argument to push people to switch.
> 
> That's the real issue, not parentheses on the "print" statement.
> Where's the business case for moving to Python 3?

If you're going to be doing a lot of Unicode text processing, I would
expect that using Python 3 would make the task somewhat simpler.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread D'Arcy J.M. Cain
On Fri, 02 Jul 2010 22:40:34 -0700
John Nagle  wrote:
>  Not according to Vex's published package list:
> 
>   http://www.vex.net/info/tech/pkglist/

As it says on that page it may not be up to date.  Look at the
generated list link.  I guess I should update the static page as well.

> "vex.net" isn't exactly a major hosting service.

OK, I'll give you that.  It is on the backbone of the net at 151 Front
Street in Toronto, has almost 100% uptime and uses high speed servers
but we don't have 15 layers of bureaucracy between the owner and the
user and I certainly know of no "real" hosting provider that invites
all their clients out for dinner once a year.  And how can we be a real
ISP when the president knows most of his clients on a first name basis?

I know what being "major" means to the owners and stockholders but what
features of being major matter to the client?

-- 
D'Arcy J.M. Cain  |  Democracy is three wolves
http://www.druid.net/darcy/|  and a sheep voting on
+1 416 425 1212 (DoD#0082)(eNTP)   |  what's for dinner.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread D'Arcy J.M. Cain
On Fri, 02 Jul 2010 22:40:34 -0700
John Nagle  wrote:
>  Not according to Vex's published package list:
> 
>   http://www.vex.net/info/tech/pkglist/

Hold on.  That *is* the generated list and Python 3.1 is on it.  We
have both 2.6 and 3.1.  The 3.1 version is listed right below the 2.6
one.  The page is generated from pkg_info(1) and includes everything we
have installed from FreeBSD ports.

-- 
D'Arcy J.M. Cain  |  Democracy is three wolves
http://www.druid.net/darcy/|  and a sheep voting on
+1 416 425 1212 (DoD#0082)(eNTP)   |  what's for dinner.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread Steven D'Aprano
On Sat, 03 Jul 2010 08:46:57 -0400, D'Arcy J.M. Cain wrote:

> On Fri, 02 Jul 2010 22:40:34 -0700
> John Nagle  wrote:
>>  Not according to Vex's published package list:
>> 
>>  http://www.vex.net/info/tech/pkglist/
> 
> Hold on.  That *is* the generated list and Python 3.1 is on it.  We have
> both 2.6 and 3.1.  The 3.1 version is listed right below the 2.6 one. 
> The page is generated from pkg_info(1) and includes everything we have
> installed from FreeBSD ports.

Pfft! Facts! You can prove anything you like with facts!


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


subprocess query

2010-07-03 Thread Sudheer
Hi,
 What's wrong with the following code. The program waits indefenitely
at  'output = p2.stdout.read()'


from subprocess import *

p1=Popen(['tr', 'a-z', 'A-Z'],stdin=PIPE,stdout=PIPE)
p2=Popen(['tr','A-Z', 'a-z'],stdin=p1.stdout,stdout=PIPE)
p1.stdin.write("hello")
p1.stdin.close()

output = p2.stdout.read()

print output


-- 
Thanks
Sudheer
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: subprocess query

2010-07-03 Thread Chris Rebert
On Sat, Jul 3, 2010 at 7:33 AM, Sudheer  wrote:
> Hi,
>  What's wrong with the following code. The program waits indefenitely
> at  'output = p2.stdout.read()'
>
>
> from subprocess import *
>
> p1=Popen(['tr', 'a-z', 'A-Z'],stdin=PIPE,stdout=PIPE)
> p2=Popen(['tr','A-Z', 'a-z'],stdin=p1.stdout,stdout=PIPE)
> p1.stdin.write("hello")
> p1.stdin.close()
>
> output = p2.stdout.read()
>
> print output

Try using .communicate() instead of reading and writing to .stdin and .stdout.
Adding a newline (i.e. "hello\n") may also help.

Cheers,
Chris
--
http://blog.rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread Alf P. Steinbach /Usenet

* Steven D'Aprano, on 03.07.2010 16:24:

On Sat, 03 Jul 2010 08:46:57 -0400, D'Arcy J.M. Cain wrote:


On Fri, 02 Jul 2010 22:40:34 -0700
John Nagle  wrote:

  Not according to Vex's published package list:

http://www.vex.net/info/tech/pkglist/


Hold on.  That *is* the generated list and Python 3.1 is on it.  We have
both 2.6 and 3.1.  The 3.1 version is listed right below the 2.6 one.
The page is generated from pkg_info(1) and includes everything we have
installed from FreeBSD ports.


Pfft! Facts! You can prove anything you like with facts!


:-)

--
blog at http://alfps.wordpress.com>
--
http://mail.python.org/mailman/listinfo/python-list


Re: Crash in PyThread_acquire_lock

2010-07-03 Thread Antoine Pitrou

Hello,

> 'thelock->locked' is for sure still locked, but I can't identify the
> problem.
> Its just waiting, but it gets a 'EXC_BAD_ACCESS'. The line of the
> crash
> in PyThread_acquire_lock is the following one:
> 
> while ( thelock->locked ) {
> status = pthread_cond_wait(&thelock->lock_released, &thelock-
> >mut);  <<

Are you sure the crash happens in this thread and not another one?



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread Aahz
In article ,
D'Arcy J.M. Cain  wrote:
>On Fri, 02 Jul 2010 22:40:34 -0700
>John Nagle  wrote:
>>
>> "vex.net" isn't exactly a major hosting service.
>
>OK, I'll give you that.  It is on the backbone of the net at 151 Front
>Street in Toronto, has almost 100% uptime and uses high speed servers
>but we don't have 15 layers of bureaucracy between the owner and the
>user and I certainly know of no "real" hosting provider that invites
>all their clients out for dinner once a year.  And how can we be a real
>ISP when the president knows most of his clients on a first name basis?

vex.net is Canada's Panix.  ;-)
-- 
Aahz (a...@pythoncraft.com)   <*> http://www.pythoncraft.com/

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: drag & drop in a python GUI application

2010-07-03 Thread John Posner

On 7/2/2010 11:20 AM, Michael Torrie wrote:

On 07/01/2010 08:57 AM, Alan wrote:

I know drag&  drop is not possible with TK.


Is this a Python Tk limitation or a Tk limitation in general?  Google
suggests that Tk itself supports some form of dnd.


Which widget could I use for my
python application to be able to work with drag&  drop?


PyQt will do drag and drop on all platforms.  GTK does drag and drop on
Unix/X11, and to a lesser degree Win32--not sure about OS X support.  I
believe wxWidgets also does some level of dnd on all platforms.


Drag-and-drop *is* quite doable with Tkinter. But it's certainly easier 
in PyQt:


  self.setFlag(G.QGraphicsItem.ItemIsMovable, True)

You can contact me off-list if you'd like to see a drag-and-drop 
application that I first wrote using Tkinter, then reimplemented using PyQt.


HTH,
John
--
http://mail.python.org/mailman/listinfo/python-list


Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread D'Arcy J.M. Cain
On 03 Jul 2010 14:24:49 GMT
Steven D'Aprano  wrote:
> Pfft! Facts! You can prove anything you like with facts!

Argumentum ad Dragnet?

-- 
D'Arcy J.M. Cain  |  Democracy is three wolves
http://www.druid.net/darcy/|  and a sheep voting on
+1 416 425 1212 (DoD#0082)(eNTP)   |  what's for dinner.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread John Nagle

On 7/3/2010 5:46 AM, D'Arcy J.M. Cain wrote:

On Fri, 02 Jul 2010 22:40:34 -0700
John Nagle  wrote:

  Not according to Vex's published package list:

http://www.vex.net/info/tech/pkglist/


Hold on.  That *is* the generated list and Python 3.1 is on it.  We
have both 2.6 and 3.1.  The 3.1 version is listed right below the 2.6
one.  The page is generated from pkg_info(1) and includes everything we
have installed from FreeBSD ports.


   The base Python 3.1 is installed there, but without any modules.
Below is the list of Python 2.6 modules installed.  Search that
page for "py3", and you get nothing.

   On a hosting service, a raw Python with none of those modules isn't
very useful.

   This is what I mean about Python 3 not being ready for prime time.

John Nagle

Python packages on Vex:

py26-MySQLdb-1.2.2  Access a MySQL database through Python
py26-PyGreSQL-4.0,1	A Python interface to PostgreSQL, both classic and 
DP-API 2.0

py26-gdbm-2.6.4 Python bindings to the GNU dbm library
py26-psycopg-1.1.21_1   The high performance Python adapter for PostgreSQL
py26-pyPgSQL-2.5.1_3	A Python DB-API 2 compliant library for using 
PostgreSQL databases
py26-rrdtool_lgpl-1.0b1	Python interface to RRDTool, the graphing and 
logging utility

py26-sqlite3-2.6.4_1Standard Python binding to the SQLite3 library
py26-asn1-0.0.9a_1  ASN.1 toolkit for Python
py26-cElementTree-1.0.5_1   A fast C implementation of the ElementTree API
py26-cheetah-2.2.1  HTML template engine for Python
py26-elementtree-1.2.6_1	Container for hierarchical data structures 
written in Python
py26-setuptools-0.6c11	Download, build, install, upgrade, and uninstall 
Python packages

py26-statgrab-0.5   A set of Python bindings for libstatgrab
py26-twisted-8.2.0  Metaport of Twisted, an event-driven networking engine
py26-twistedCore-8.2.0	An asynchronous networking framework for Python - 
Core module

py26-twistedFlow-8.0.0  Generator based asynchronous result flows
py26-twistedRunner-8.2.0	Runner has process management, including an 
inetd replacement

py26-zopeInterface-3.5.2Zope.interface package from Zope 3
py26-twistedMail-8.2.0	An SMTP, IMAP and POP protocol implementation 
with clients and servers

py26-twistedPair-8.0.0  Twisted Pair can do low level TCP work

py26-twistedWords-8.2.0 Twisted Words has more chat than you can handle

py26-snmp-3.4.4 SNMP framework for Python
py26-twistedSNMP-0.3.13 Twisted Python framework for doing SNMP stuff
news
py26-twistedNews-8.2.0	An NNTP protocol implementation with client and 
server
py26-fail2ban-0.8.3_2	scans log files and bans IP that makes too many 
password failures.

py26-openssl-0.8_1  Python interface to the OpenSSL library
py26-paramiko-1.7.6 A python library for making SSH2 connections
py26-posix1e-0.4.0  Python module for manipulating POSIX.1e ACLs
py26-pycrack-0.5.1  Python bindings to cracklib
py26-pycrypto-2.1.0_1   The Python Cryptography Toolkit
py26-twistedConch-8.2.0	An SSH and SFTP protocol implementation with 
clients and servers

py26-docutils-0.5   Python Documentation Utilities
py26-dsv-1.4.0	A Python module to parse or write delimeter-separated 
(e.g. CSV) files

py26-twistedLore-8.2.0  Documentation generator with HTML and LaTeX support
py26-xml-0.8.4_2PyXML: Python XML library enhancements
py26-cherrypy-3.1.2 A pythonic, object-oriented web development framework
py26-django-1.1.1   High-level Python Web framework
py26-flup-1.0.2 Random assortment of WSGI servers, middleware
py26-twistedWeb-8.2.0	An HTTP protocol implementation together with 
clients and servers
py26-twistedWeb2-8.1.0	The next generation Web Server Framework built 
with Twisted

--
http://mail.python.org/mailman/listinfo/python-list


My extension code generator for C++

2010-07-03 Thread Rouslan Korneychuk
It's still in the rough, but I wanted to give an update on my C++ 
extension generator. It's available at http://github.com/Rouslan/PyExpose


The documentation is a little slim right now but there is a 
comprehensive set of examples in test/test_kompile.py (replace the k 
with a c. For some reason, if I post this message with the correct name, 
it doesn't show up). The program takes an input file like


 
 
 module doc string

 
 class doc string
 
 
 
 
 return-semantic="copy"/>

 
 
 

and generates the code for a Python extension.

The goal has been to generate code with zero overhead. In other words I 
wanted to eliminate the tedium of creating an extension without 
sacrificing anything. In addition to generating a code file, the 
previous input would result in a header file with the following:


extern PyTypeObject obj_DVectorType;
inline PyTypeObject *get_obj_DVectorType() { return &obj_DVectorType; }
struct obj_DVector {
PyObject_HEAD
storage_mode mode;
std::vector > base;

PY_MEM_NEW_DELETE
obj_DVector() : base() {

PyObject_Init(reinterpret_cast(this),get_obj_DVectorType());
mode = CONTAINS;
}
obj_DVector(std::allocator const & _0) : base(_0) {

PyObject_Init(reinterpret_cast(this),get_obj_DVectorType());
mode = CONTAINS;
}
obj_DVector(long unsigned int _0,double const & 
_1,std::allocator const & _2) : base(_0,_1,_2) {


PyObject_Init(reinterpret_cast(this),get_obj_DVectorType());
mode = CONTAINS;
}
obj_DVector(std::vector > const & _0) 
: base(_0) {


PyObject_Init(reinterpret_cast(this),get_obj_DVectorType());
mode = CONTAINS;
}
};

so the object can be allocated in your own code as a single block of 
memory rather than having a PyObject contain a pointer to the exposed type.


storage_type is an enumeration, adding very little to the size of the 
Python object (or maybe nothing depending on alignment), but if you add 
new-initializes="true" to the  tag and the exposed type never 
needs to be held by a pointer/reference (as is the case when the exposed 
type is inside another class/struct), even that variable gets omitted.


The code also never uses PyArg_ParseTuple or its variants. It converts 
every argument using the appropriate PyX_FromY functions. I noticed 
PyBindGen does the following when a conversion is needed for one argument:


py_retval = Py_BuildValue((char *) "(O)", value);
if (!PyArg_ParseTuple(py_retval, (char *) "i", &self->obj->y)) {
Py_DECREF(py_retval);
return -1;
}
Py_DECREF(py_retval);

On the other hand, here's the implementation for __sequence__getitem__:

PyObject * obj_DVector___sequence__getitem__(obj_DVector 
*self,Py_ssize_t index) {

try {
std::vector > &base = 
cast_base_DVector(reinterpret_cast(self));

return PyFloat_FromDouble(base.at(py_ssize_t_to_ulong(index)));

} EXCEPT_HANDLERS(0)
}

(cast_base_DVector checks that base is initialized and gets a reference 
to it with regard to how it's stored in obj_DVector. If the class is 
new-initialized and only needs one means of storage, it's code will just 
be "return obj_DVector->base;" and should be inlined by an optimizing 
compiler.)



I'm really interested in what people think of this little project.
--
http://mail.python.org/mailman/listinfo/python-list


python app development

2010-07-03 Thread mo reina
an anyone recommend a resource (book,tutorial,etc.) that focuses on
application development in python? something similar to Practical
Django Projects, but for stand alone applications instead of web apps
(for now).

i'm in a bit of a funny place, i have a decent/good grasp of python
syntax and my logic isn't bad, but i have no clue on how to assemble
an application, i seem to be stuck on writing scripts.

i've looked at the source of a few projects but the flow is way over
my head, i understand the syntax but not the logic, which is why i'm
looking for a project-cenetered learning resource, instead of a
reference or language-feature resource. also, it seems that a lot of
app programming is 90% gui bindings, with very little actual code, or
am i totally way off mark?

i recently picked up the django practical projects book, and in a few
days i re-wrote a website i did with django. i feel it was the book's
project-centric approach that made this possible.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: My extension code generator for C++

2010-07-03 Thread Thomas Jollans
On 07/03/2010 07:22 PM, Rouslan Korneychuk wrote:
> It's still in the rough, but I wanted to give an update on my C++
> extension generator. It's available at http://github.com/Rouslan/PyExpose

Question that pops to mind immediately: How does this differentiate
itself from SWIG? ( I can't say I'm familiar with SWIG, but the question
had to be posed. )

> 
> The documentation is a little slim right now but there is a
> comprehensive set of examples in test/test_kompile.py (replace the k
> with a c. For some reason, if I post this message with the correct name,
> it doesn't show up). The program takes an input file like
> 
>  
>  
>  module doc string
> 
>  
>  class doc string
>  
>  
>  
>  
>   return-semantic="copy"/>

func="operator[]" would also work, I assume?

>  
>  
>  
> 
> and generates the code for a Python extension.
> 
> [snip]
> 
> I'm really interested in what people think of this little project.

How does it deal with pointers? What if something returns a const
pointer - is const correctness enforced?

All in all, it looks rather neat.

Thomas
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python app development

2010-07-03 Thread Andre Alexander Bell
On 07/03/2010 07:48 PM, mo reina wrote:
> an anyone recommend a resource (book,tutorial,etc.) that focuses on
> application development in python? something similar to Practical
> Django Projects, but for stand alone applications instead of web apps
> (for now).

I think you are referring to GUI applications. There are plenty of GUI
Libraries out there. One of my favorites is the Qt library by Nokia
(former by Trolltech) for which you can get python bindings PyQt and PySide.

http://doc.qt.nokia.com/4.7-snapshot/index.html
http://www.riverbankcomputing.co.uk
http://www.pyside.org

You might want to read through the tutorials given in the documentation
at the Nokia site and possibly take a look at the examples provided
with, e.g. PyQt.

I'm sure other will add in more valuable links and suggestions.

Best regards


Andre
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread D'Arcy J.M. Cain
On Sat, 03 Jul 2010 09:48:09 -0700
John Nagle  wrote:
> The base Python 3.1 is installed there, but without any modules.

We install modules as clients ask for them.  No one has yet requested a
Python 3 module.

> On a hosting service, a raw Python with none of those modules isn't
> very useful.

Well, it isn't useless.

-- 
D'Arcy J.M. Cain  |  Democracy is three wolves
http://www.druid.net/darcy/|  and a sheep voting on
+1 416 425 1212 (DoD#0082)(eNTP)   |  what's for dinner.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: loading configuration files that are themselves python

2010-07-03 Thread Terry Reedy

On 7/3/2010 5:15 AM, Matthew Vernon wrote:

Hi,

Is there a more idiomatic way of loading in a configuration file
that's python code than:

_temp=__import__(path,fromlist='cachestrs')
cachestrs=_temp.cachestrs

? I mean, that's pretty ugly...Plain "import" doesn't work in this
case because 'path' is a variable defined elsewhere


cachestrs=__import__(path,fromlist='cachestrs').cachestrs
?

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


RE: drag & drop in a python GUI application

2010-07-03 Thread jyoung79
Hi Alan,

What OS are you running on?  And by 'drag and drop' are you meaning you want to 
drag and drop on a GUI window, or are you wanting a droplet where you can drop 
your file/folder on the application icon?

Jay

--

> Hello there,

> I know drag & drop is not possible with TK. Which widget could 
> I use for my python application to be able to work with drag & 
> drop?

> Thanks,

> Alan
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python app development

2010-07-03 Thread Terry Reedy

On 7/3/2010 1:48 PM, mo reina wrote:

an anyone recommend a resource (book,tutorial,etc.) that focuses on
application development in python? something similar to Practical
Django Projects, but for stand alone applications instead of web apps
(for now).

i'm in a bit of a funny place, i have a decent/good grasp of python
syntax and my logic isn't bad, but i have no clue on how to assemble
an application, i seem to be stuck on writing scripts.

i've looked at the source of a few projects but the flow is way over
my head, i understand the syntax but not the logic, which is why i'm
looking for a project-cenetered learning resource, instead of a
reference or language-feature resource. also, it seems that a lot of
app programming is 90% gui bindings, with very little actual code, or
am i totally way off mark?


If the app is a gui app and if logic is overly intermixed with gui 
stuff, I am sure it can seem like that. Many recommend the MVC 
model-view-controller model for app design. Even that can be confusing; 
to me it should be model-controller-view, even though that is harder to 
say. What are the data (values and objects) and how are they stored? 
What are the rules for manipulating the data and objects? And then, and 
only then, how to communicate with the user?


i recently picked up the django practical projects book, and in a few
days i re-wrote a website i did with django. i feel it was the book's
project-centric approach that made this possible.


Another issue is who controls the flow of interactions, the user or the 
code. For instance, a gui form used for input tends to direct the user 
along a linear path. The same form, used for edit, presents existing 
data and allows the user to pick and choose the fields to edit. This 
distinction, along with MVC ideas, is important for reading source code.


I have mostly seen this issue discussed in game reviews and game design 
writing. In computer games, there is the same general difference between 
a linear obstacle course game and a world to be explored in whatever 
order one wants. (And there are some with both an explorable world *and* 
a (somewhat optional) linear main quest line.)


I am not familiar with any general app design books, but I have seen 
game design articles and books that are on a par with writing about web 
design. There are other books on business apps.


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Re: subprocess query

2010-07-03 Thread Nobody
On Sat, 03 Jul 2010 10:33:49 -0400, Sudheer wrote:

>  What's wrong with the following code. The program waits indefenitely
> at  'output = p2.stdout.read()'
> 
> 
> from subprocess import *
> 
> p1=Popen(['tr', 'a-z', 'A-Z'],stdin=PIPE,stdout=PIPE)
> p2=Popen(['tr','A-Z', 'a-z'],stdin=p1.stdout,stdout=PIPE)
> p1.stdin.write("hello")
> p1.stdin.close()
> 
> output = p2.stdout.read()
> 
> print output

The problem is that p2 is inheriting Python's copy of the write end of the
pipe corresponding to p1.stdin, which means that it's impossible to
generate EOF on the pipe (i.e. p1.stdin.close() is a no-op):

  PID TTY  STAT   TIME COMMAND
30437 pts/1S+ 0:00 /usr/bin/python2.6 ./test.py
30438 pts/1S+ 0:00 tr a-z A-Z
30439 pts/1S+ 0:00 tr A-Z a-z

/proc/30437/fd:
total 0
lrwx-- 1 user users 64 Jul  3 20:51 0 -> /dev/pts/1
lrwx-- 1 user users 64 Jul  3 20:51 1 -> /dev/pts/1
lrwx-- 1 user users 64 Jul  3 20:51 2 -> /dev/pts/1
lr-x-- 1 user users 64 Jul  3 20:51 3 -> pipe:[31472684]

/proc/30438/fd:
total 0
lr-x-- 1 user users 64 Jul  3 20:51 0 -> pipe:[31472681] <= ***
l-wx-- 1 user users 64 Jul  3 20:51 1 -> pipe:[31472682]
lrwx-- 1 user users 64 Jul  3 20:51 2 -> /dev/pts/1

/proc/30439/fd:
total 0
lr-x-- 1 user users 64 Jul  3 20:51 0 -> pipe:[31472682]
l-wx-- 1 user users 64 Jul  3 20:51 1 -> pipe:[31472684]
lrwx-- 1 user users 64 Jul  3 20:51 2 -> /dev/pts/1
l-wx-- 1 user users 64 Jul  3 20:51 4 -> pipe:[31472681] <= ***

On Unix, you can add close_fds=True when creating p2, but that won't work
on Windows (it prevents redirection of stdin/stdout/stderr). OTOH, I don't
know whether the problem exists on Windows; if it doesn't just set
close_fds to True on Unix and False on Windows.

Alternatively, on Unix you should be able to use:

fcntl(fd, F_SETFD, FD_CLOEXEC)

(from the fcntl module) to prevent the write end of the pipe from being
inherited.

Worse still, killing the script with Ctrl-C will leave both of the child
processes behind.

In C, you would typically close the unused ends of the pipes within the
child half of the fork(), before the exec(), but you don't have that
degree of control with subprocess.

On Windows, you can chose whether a handle is inheritable or not, but I
don't know whether you can do that from within Python.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: My extension code generator for C++

2010-07-03 Thread Rouslan Korneychuk

On 07/03/2010 01:54 PM, Thomas Jollans wrote:

On 07/03/2010 07:22 PM, Rouslan Korneychuk wrote:

It's still in the rough, but I wanted to give an update on my C++
extension generator. It's available at http://github.com/Rouslan/PyExpose


Question that pops to mind immediately: How does this differentiate
itself from SWIG? ( I can't say I'm familiar with SWIG, but the question
had to be posed. )



I have never tried swig, but as far as I understand, SWIG uses a layered 
approach where part of the extension is defined C/C++ and that is 
wrapped in Python code. Mine implements the extension completely in C++.




The documentation is a little slim right now but there is a
comprehensive set of examples in test/test_kompile.py (replace the k
with a c. For some reason, if I post this message with the correct name,
it doesn't show up). The program takes an input file like

  
  
  module doc string

  
  class doc string
  
  
  
  
  


func="operator[]" would also work, I assume?


  
  
  

and generates the code for a Python extension.

[snip]

I'm really interested in what people think of this little project.


How does it deal with pointers? What if something returns a const
pointer - is const correctness enforced?



When returning pointers or references, you either have to specify a 
conversion explicitly or use the "return-semantic" attribute. The 
current options are "copy", which dereferences the pointer and copies by 
value, and "managed-ref" which is for exposed classes, where the 
returned PyObject stores the value as a reference and holds on to a 
reference-counted pointer to the object the returned the value (there is 
also "self" which has nothing to do with returning pointers. With 
"self", the return value of the wrapped method is ignored and a pointer 
to the class is returned).


I can easily add other options for "return-semantic", such as keeping a 
pointer and deleting it upon destruction. I just implemented the ones I 
need for the thing I'm working on.


As far as returning const pointers and const correctness, I'm not sure 
exactly what you mean. If you mean is there a mechanism to hold on to 
const objects and prevent them form being modified, the answer is no. 
It's not something I need.



All in all, it looks rather neat.

Thomas


Thanks for the comment.

--
http://mail.python.org/mailman/listinfo/python-list


Re: My extension code generator for C++

2010-07-03 Thread Rouslan Korneychuk

I missed one:


func="operator[]" would also work, I assume?



Yes, you can also supply a function if the first parameter accepts the 
type being wrapped (__rop__ methods will even accept the second 
parameter taking the wrapped type).

--
http://mail.python.org/mailman/listinfo/python-list


IMAP Problems

2010-07-03 Thread Paul Jefferson
Hi,
I'm trying to write a simple script which displays the basic details
of a person's mailbox. My problem is that it causes all the messages
to be marked as read on the server, which is not what I'm after, and I also
can't get the imap.sort command to work properly (currently
commented out as I replaced it with a imap.search to get the thing
working.
These are probably very simple things, but I've not tried this library
before so am a bit stuck so any help wwould be very gratefully
received.
Thanks,
Paul

Code:

# -*- coding: cp1252 -*-
import imaplib,email

# you want to connect to a server; specify which server
server= imaplib.IMAP4_SSL('imap.googlemail.com')
# after connecting, tell the server who you are
server.login('x...
@gmail.com', 'xxx')
# this will show you a list of available folders
# possibly your Inbox is called INBOX, but check the list of mailboxes
code, mailboxen= server.list()
print mailboxen
# if it's called INBOX, then…
server.select("INBOX")

typ, data = server.search(None, 'ALL')
#typ, data = server.sort("Date","UTF-8", 'ALL')
print len(data[0].split())
for num in data[0].split():
typ, data = server.fetch(num, '(RFC822)')
#print 'Message %s\n%s\n' % (num, data[0][1])
msg = email.message_from_string(data[0][1])
print msg["From"]
print msg["Subject"]
print msg["Date"]
print "___"

server.close()
server.logout()
-- 
http://mail.python.org/mailman/listinfo/python-list


Confusion over etree.ElementTree.Element.getiterator

2010-07-03 Thread Ben Sizer
It seems that getiterator isn't returning the tags I ask for.

>>> tree = parse('gdlibs.html')
>>> root = tree.getroot()
>>> for el in root.getiterator():
...print el
[much output snipped]
http://www.w3.org/1999/xhtml}a at d871e8>
http://www.w3.org/1999/xhtml}a at d87288>
http://www.w3.org/1999/xhtml}script at d87300>
http://www.w3.org/1999/xhtml}script at d87378>

>>> it = root.getiterator('script')
>>> all_scripts = list(it)
>>> print len(all_scripts)
0

I would have expected at least 2 script tags to be found, considering
iterating over the whole lot found at least 2 at the end there.

What am I doing wrong?

>>> import sys
>>> print sys.version
2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]


I will upgrade to 2.6.5 ASAP, but I don't see anything in the
changelog that implies a bug that has been fixed here.

--
Ben Sizer



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Confusion over etree.ElementTree.Element.getiterator

2010-07-03 Thread Ben Sizer
On Jul 3, 11:12 pm, Ben Sizer  wrote:

> >>> for el in root.getiterator():
>
> ...        print el
> [much output snipped]
> http://www.w3.org/1999/xhtml}a at d871e8>
> http://www.w3.org/1999/xhtml}a at d87288>
> http://www.w3.org/1999/xhtml}script at d87300>
> http://www.w3.org/1999/xhtml}script at d87378>

Hmm, I think I've worked it out. Apparently the XML namespace forms
part of the tag name in this case. Is that what is intended? I didn't
see any examples of this in the docs.

--
Ben Sizer
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python app development

2010-07-03 Thread Nathan Rice
Expert Python Programming by Tarek Ziade is a fairly good book, covers a lot
of core stuff, though it doesn't really cover gui app development at all.

On Sat, Jul 3, 2010 at 1:48 PM, mo reina wrote:

> an anyone recommend a resource (book,tutorial,etc.) that focuses on
> application development in python? something similar to Practical
> Django Projects, but for stand alone applications instead of web apps
> (for now).
>
> i'm in a bit of a funny place, i have a decent/good grasp of python
> syntax and my logic isn't bad, but i have no clue on how to assemble
> an application, i seem to be stuck on writing scripts.
>
> i've looked at the source of a few projects but the flow is way over
> my head, i understand the syntax but not the logic, which is why i'm
> looking for a project-cenetered learning resource, instead of a
> reference or language-feature resource. also, it seems that a lot of
> app programming is 90% gui bindings, with very little actual code, or
> am i totally way off mark?
>
> i recently picked up the django practical projects book, and in a few
> days i re-wrote a website i did with django. i feel it was the book's
> project-centric approach that made this possible.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Watch Russian Spies in REAL TIME !!! - Video Evidence For Icompetento FBI Bustards

2010-07-03 Thread small Pox
Watch Russian Spies in REAL TIME !!! - Video Evidence For Icompetento
FBI Bustards



Watch Russian Spies in REAL TIME !!! - Video Evidence For Icompetento
FBI Bustards


http://www.youtube.com/watch?v=0q7yEnMjQ6U&feature=related
http://www.youtube.com/watch?v=a3E2NcC0x20&feature=related
http://www.youtube.com/watch?v=fRZSzdQuOqM&feature=related



http://www.venusproject.com/911/911RussianSatellite1.html
Russia Watched 9/11
In Real Time On Satellite

By Jon Carlson

Your countrymen have been murdered and the more you delve into it
the more it looks as though they were murdered by our government, who
used it

as an excuse to murder other people thousands of miles away.
If you ridicule others who have sincere doubts and who know
factual information that directly contradicts the official report and
who want

explanations from those who hold the keys to our government, and have
motive, means, and opportunity to pull off a 9/11, but you are too
lazy or

fearful, or ... to check into the facts yourself, what does that make
you?

Full Statement of Lt. Col. Shelton F. Lankford, US Marine Corps (ret)
Retired U.S. Marine Corps Fighter Pilot
February 20, 2007

http://www.patriotsquestion911.com/Statement%20Lankford.html

In April, 2006, Journalist Webster Tarpley interviewed Thierry
Meyssan, President of the Voltaire Network, an organization of 20
different news

agencies in Europe, Middle East and Africa, with correspondents in
many countries. Thierry trumped America's pseudo-journalists with his
2002 book,

Pentagate, drawing first blood on the Pentagon 9/11 Hoax.

TM:. He (Gen. Ivashov) was the chief of armed forces in Russia on
9/11. He says the Russian forces were watching North America because
of the

large military exercises being carried out by the US that day, so they
saw in real time by satellite what was happening on that day.

TM: When they heard about the attacks, Pres. Putin tried to call
Bush to tell him that the Russians were not involved. He was not able
to reach

him. But they understood already that the collapse of the buildings
could not have been done by the planes. They already realized it was
controlled

demolition - an internal problem and not an external attack

WGT. How did US government, the State Dept respond to your
(Pentagate) critique?
TM. First they said I would not be allowed to go your country any
more. Then Ms. Clark of State Dept said that if any journalist talks
about my

book in the US they will not be allowed to attend press conferences at
the Pentagon. They published on their website a page trying to refute
my

book.

http://www.waronfreedom.org/tarpley/rbn/RBN-42206-Meyssan.html

In April, 2005, writer Chevalier Désireé, from France but formerly
USA, revealed that Russia watched on their satellite as the A3
Skywarrior left a

carrier and impacted the Pentagon:

It seems that it is common knowledge in these circles that Russian
satellites photographed a ship-launched craft (seems to have been a
drone

type plane rather than a missle) that ended up impacting the Pentagon
on Sept 11, 2001, and that, for various reasons this information has
been

withheld from the public.
I was naturally startled to hear this even though I have long held
the opinion that it was NOT a commercial jetliner that hit the
Pentagon. I

think the thing that startled me was the fact that, if Russia (and
perhaps other countries with satellites?) had proof that Flight 77 did
not hit

the Pentagon, why weren't they revealing this?

http://web.archive.org/web/20050728121017/http://perfectinfidel.blogspot.com/2005/04/david-beckham-and-flight-77-in-paris.html

In 2002 some US spy satellite photos from the sixties were released to
the public domain:

"It's a welcome move," said Steven Aftergood of the Project on
Government Secrecy, an effort of the Federation of American Scientists
and based

in Washington, D.C.
"First and foremost, these images are of historical interest. They
feature images of national security significance that served as an
important

input to the U.S. Government policy process. So they can help
historians shed some light on that process," Aftergood told
SPACE.com.



Considering that the Pentagon STILL hasn't released over 80 videos of
the Pentagon Hoax, release of the satellite photos of the 9/11 mass
murder is

not in the cards.

In our last installment the strong case was made that aircraft carrier
USS George Washington anchored off Long Island just a short helicopter
ride

from Manhattan served as base of operations for 9/11:

The 9/11 Base Of Operations:
Aircraft Carrier USS George Washington
http://home.att.net/~south.tower/911AirBase1.htm

Of course, a satellite image of the USS George Washington plying the
waters off Long Island during the 9/11 mass murder would be the final
nail in

the coffin.

SPOT Satellite Images of World Trade Center Fires on September 11 at
11:55 AM:

http://www.globalsecurity.org/eye/html/wtc_nyc-091101-2.htm

Image fro

Re: IMAP Problems

2010-07-03 Thread MRAB

Paul Jefferson wrote:
Hi, 
I'm trying to write a simple script which displays the basic details 
of a person's mailbox. My problem is that it causes all the messages 
to be marked as read on the server, which is not what I'm after, and 
I also can't get the imap.sort command to work properly (currently 
commented out as I replaced it with a imap.search to get the thing 
working. 
These are probably very simple things, but I've not tried this library 
before so am a bit stuck so any help wwould be very gratefully 
received. 
Thanks, 
Paul 

Code: 

# -*- coding: cp1252 -*- 
import imaplib,email 

# you want to connect to a server; specify which server 
server= imaplib.IMAP4_SSL('imap.googlemail.com 
') 
# after connecting, tell the server who you are 
server.login('x... 
@gmail.com 
', 'xxx') 
# this will show you a list of available folders 
# possibly your Inbox is called INBOX, but check the list of mailboxes 
code, mailboxen= server.list() 
print mailboxen 
# if it's called INBOX, then… 
server.select("INBOX") 

typ, data = server.search(None, 'ALL') 
#typ, data = server.sort("Date","UTF-8", 'ALL') 
print len(data[0].split()) 
for num in data[0].split(): 
typ, data = server.fetch(num, '(RFC822)') 
#print 'Message %s\n%s\n' % (num, data[0][1]) 
msg = email.message_from_string(data[0][1]) 
print msg["From"] 
print msg["Subject"] 
print msg["Date"] 
print "___" 

server.close() 
server.logout() 


You might want to read what it says here:

http://tools.ietf.org/html/rfc2060.html#page-41

If you can use '(BODY[])' instead of '(RFC822)' then you could use
'(BODY.PEEK[])'.

Alternatively, try:

server.store(num, '-FLAGS', r'\Seen')

to mark it as unread after fetching.
--
http://mail.python.org/mailman/listinfo/python-list


Re: [farther OT] Re: Why Is Escaping Data Considered So Magical?

2010-07-03 Thread Lawrence D'Oliveiro
In message , Rami 
Chowdhury wrote:

> I'm sorry, perhaps you've misunderstood what I was refuting. You posted:
>> >> macro:
>> >> #define Descr(v) &v, sizeof v
>> >> 
>> >> As written, this works whatever the type of v: array, struct,
>> >> whatever.
> 
> With my code example I found that, as others have pointed out,
> unfortunately it doesn't work if v is a pointer to a heap-allocated area.

It still correctly passes the address and size of that pointer variable. It 
that’s not what you intended, you shouldn’t use it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why Is Escaping Data Considered So Magical?

2010-07-03 Thread Lawrence D'Oliveiro
In message , Robert 
Kern wrote:

> On 2010-06-25 19:47 , Lawrence D'Oliveiro wrote:
>
>> In message, Cameron
>> Simpson wrote:
>>
>>> On 25Jun2010 15:38, Lawrence
>>> D'Oliveiro  wrote:
>>>
>>> | In message<2010062422432660794-angrybald...@gmailcom>, Owen Jacobson
>>> | wrote:
>>>
>>> |>  Why would I write this when SQLAlchemy, even without using its ORM
>>> |>  features, can do it for me?
>>> |
>>> | SQLAlchemy doesn’t seem very flexible. Looking at the code examples
>>> |, they’re very
>>> |procedural: build object, then do a string of separate method calls to
>>> |add data to it. I prefer the functional approach, as in my table-update
>>> |example.
>>>
>>> He said "without using its ORM".
>>
>> I noticed that. So were those examples I referenced above “using its
>> ORM”? Can you offer better examples “without using its ORM”?
> 
> http://www.sqlalchemy.org/docs/sqlexpression.html

Still full of very repetitive boilerplate. Doesn’t look like it can create a 
simpler alternative to my example at all.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why Is Escaping Data Considered So Magical?

2010-07-03 Thread Lawrence D'Oliveiro
In message , Robert 
Kern wrote:

> On 2010-06-25 19:49 , Lawrence D'Oliveiro wrote:
>
>> Why do people consider input sanitization so hard?
> 
> It's not hard per se; it's just repetitive, prone to the occasional
> mistake, and, frankly, really boring.

But as a programmer, I’m not in the habit of doing “repetitive” and 
“boring”. Look at the example I posted, and you’ll see. It’s the ones trying 
to come up with alternatives to my code who produce things that look 
“reptitive” and “boring”.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why are String Formatted Queries Considered So Magical?

2010-07-03 Thread Lawrence D'Oliveiro
In message , Nobody wrote:

> On Tue, 29 Jun 2010 12:30:36 +1200, Lawrence D'Oliveiro wrote:
> 
>>> Seriously, almost every other kind of library uses a binary API. What
>>> makes databases so special that they need a string-command based API?
>> 
>> HTML is also effectively a string-based API.
> 
> HTML is a data format. The sane way to construct or manipulate HTML is via
> the DOM, not string operations.

What is this “DOM” of which you speak? I looked here 
, but can find nothing that sounds like 
that, that is relevant to HTML.

>> And what about regular expressions?
> 
> What about them? As the saying goes:
> 
> Some people, when confronted with a problem, think
> "I know, I'll use regular expressions."
> Now they have two problems.
> 
> They have some uses, e.g. defining tokens[1]. Using them to match more
> complex constructs is error-prone ...

What if they’re NOT more complex, but they can simply contain user-entered 
data?

>> And all the functionality available through the subprocess
>> module and its predecessors?
> 
> The main reason why everyone recommends subprocess over its predecessors
> is that it allows you to bypass the shell, which is one of the most
> common sources of the type of error being discussed in this thread.

How would you deal with this, then: I wrote a script called ExtractMac, to 
convert various old Macintosh-format documents accumulated over the years 
(stored in AppleDouble form by uploading to a Netatalk server) to more 
cross-platform formats. This has a table of conversion commands to use. For 
example, the entries for PICT and TEXT Macintosh file types look like this:

"PICT" :
  {
"type" : "image",
"ext" : ".png",
"act" : "convert %(src)s %(dst)s",
  },
"TEXT" :
  {
"type" : "text",
"ext" : ".txt",
"act" : "LineEndings unix <%(src)s >%(dst)s",
  },
 
The conversion code that uses this table looks like

Cmd = \
  (
Act.get("act", "cp -p %(src)s %(dst)s")
%
  {
"src" : ShellEscape(Src),
"dst" : ShellEscape(DstFileName),
  }
  )
sys.stderr.write("Doing: %s\n" % Cmd)
Status = os.system(Cmd)

How much simpler would your alternative be? I don’t think it would be 
simpler at all.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why are String Formatted Queries Considered So Magical?

2010-07-03 Thread Rami Chowdhury
On Saturday 03 July 2010 19:33:44 Lawrence D'Oliveiro wrote:
> In message , Nobody wrote:
> > On Tue, 29 Jun 2010 12:30:36 +1200, Lawrence D'Oliveiro wrote:
> >>> Seriously, almost every other kind of library uses a binary API. What
> >>> makes databases so special that they need a string-command based API?
> >> 
> >> HTML is also effectively a string-based API.
> > 
> > HTML is a data format. The sane way to construct or manipulate HTML is
> > via the DOM, not string operations.
> 
> What is this “DOM” of which you speak? I looked here
> , but can find nothing that sounds like
> that, that is relevant to HTML.
> 

The Document Object Model - I don't think the standard library has an HTML DOM 
module but there's certainly one for XML (and XHTML): 
http://docs.python.org/library/xml.dom.html


Rami Chowdhury
"Any sufficiently advanced incompetence is indistinguishable from malice."
-- Grey's Law
+1-408-597-7068 / +44-7875-841-046 / +88-01819-245544
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: delegation pattern via descriptor

2010-07-03 Thread Gregory Ewing

Bruno Desthuilliers wrote:

kedra marbun a écrit :


if we limit our discussion to py:
why __{get|set|delete}__ don't receive the 'name' & 'class' from
__{getattribute|{set|del}attr}__
'name' is the name that is searched



While it would have been technically possible, I fail to imagine any use
case for this.


I think he wants to have generic descriptors that are
shared between multiple attributes, but have them do
different things based on the attribute name.

That's not the way property descriptors are designed to
be used -- it's assumed that each attribute will have its
own descriptor, tailored for that particular attribute.

If you want to handle attributes more generically, you
need to intervene at the level of __getattribute__,
__getattr__ and __setattr__.

--
Greg
--
http://mail.python.org/mailman/listinfo/python-list


Re: IMAP Problems

2010-07-03 Thread Grant Edwards

> I'm trying to write a simple script which displays the basic details 
> of a person's mailbox. My problem is that it causes all the messages 
> to be marked as read on the server,
>
> code, mailboxen= server.list() 
> print mailboxen 
> # if it's called INBOX, then… 
> server.select("INBOX")

You probably want to try examine() instead of select().  That opens
the mailbox in a read-only mode which and should avoid changing any
flag values.

>From RFC3501:

  The EXAMINE command is identical to SELECT and returns the same
  output; however, the selected mailbox is identified as
  read-only. No changes to the permanent state of the mailbox,
  including per-user state, are permitted; in particular, EXAMINE
  MUST NOT cause messages to lose the \Recent flag.
  
-- 
Grant

-- 
http://mail.python.org/mailman/listinfo/python-list


Lua is faster than Fortran???

2010-07-03 Thread sturlamolden

I was just looking at Debian's benchmarks. It seems LuaJIT is now (on
median) beating Intel Fortran!

C (gcc) is running the benchmarks faster by less than a factor of two.
Consider that Lua is a dynamically typed scripting language very
similar to Python.

LuaJIT also runs the benchmarks faster than Java 6 server, OCaml, and
SBCL.

I know it's "just a benchmark" but this has to count as insanely
impressive. Beating Intel Fortran with a dynamic scripting language,
how is that even possible? And what about all those arguments that
dynamic languages "have to be slow"?

If this keeps up we'll need a Python to Lua bytecode compiler very
soon. And LuaJIT 2 is rumoured to be much faster than the current...

Looking at median runtimes, here is what I got:

   gcc   1.10

   LuaJIT1.96

   Java 6 -server2.13
   Intel Fortran 2.18
   OCaml 3.41
   SBCL  3.66

   JavaScript V8 7.57

   PyPy 31.5
   CPython  64.6
   Perl 67.2
   Ruby 1.9 71.1

The only comfort for CPython is that Ruby and Perl did even worse.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Lua is faster than Fortran???

2010-07-03 Thread Steven D'Aprano
On Sat, 03 Jul 2010 20:30:30 -0700, sturlamolden wrote:

> I know it's "just a benchmark" but this has to count as insanely
> impressive. Beating Intel Fortran with a dynamic scripting language, how
> is that even possible? 

By being clever, using Just In Time compilation as much as possible, and 
almost certainly using masses of memory at runtime. (The usual trade-off 
between space and time.)

See the PyPy project, which aims to do the same thing for Python as Lua 
have done. Their ultimate aim is to beat the C compiler and be faster 
than C. So far they've got a bit to go, but they're currently about twice 
as fast as CPython.


> And what about all those arguments that dynamic
> languages "have to be slow"?

They're bullshit, of course. It depends on the nature of the dynamicism. 
Some things are inherently slow, but not everything.

Fast, tight, dynamic: pick any two.


> If this keeps up we'll need a Python to Lua bytecode compiler very soon.

"Need" is a bit strong. There are plenty of applications where if your 
code takes 0.1 millisecond to run instead of 0.001, you won't even 
notice. Or applications that are limited by the speed of I/O rather than 
the CPU.

But I'm nitpicking... this is a nice result, the Lua people should be 
proud, and I certainly wouldn't say no to a faster Python :)

[...]
> The only comfort for CPython is that Ruby and Perl did even worse.

It's not like this is a race, and speed is not the only thing which a 
language is judged by. Otherwise you'd be programming in C, not Python, 
right?


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Lua is faster than Fortran???

2010-07-03 Thread sturlamolden
On 4 Jul, 06:15, Steven D'Aprano  wrote:

> "Need" is a bit strong. There are plenty of applications where if your
> code takes 0.1 millisecond to run instead of 0.001, you won't even
> notice. Or applications that are limited by the speed of I/O rather than
> the CPU.

> But I'm nitpicking... this is a nice result, the Lua people should be
> proud, and I certainly wouldn't say no to a faster Python :)

Need might be too strong, sorry. I'm not a native speaker of
English :)

Don't read this as a complaint about Python being too slow. I don't
care about milliseconds either. But I do care about libraries like
Python's standard library, wxPython, NumPy, and matplotlib. And when I
need C, C++ or Fortran I know where to fint it. Nobody in the
scientific community would be sad if Python was so fast that no C or
Fortran would have to be written. And I am sure Google and many other
users of Python would not mind either. And this is kind of a proof
that it can be. Considering that Lua is to Python what C is to C++
(more or less), it means that it is possible to make Python run very
fast as well.

Yes the LuaJIT team should be proud. Making a scripting language run
faster than Fortran on CPU-bound work is a superhuman result.

-- 
http://mail.python.org/mailman/listinfo/python-list


How to disable readline when building Python?

2010-07-03 Thread Sridhar Ratnakumar
For licensing reasons, I need to disable readline, except editline on 
OSX, when building Python. For the life of me, I cannot figure out how 
this can be done ("./configure --help" does not show anything relevant); 
I've tried the following, and readline.so will still be built:


- ./configure --without-readline
- ./configure --disable-readline
- Set `do_readline = False` in setup.py

This is for Python 2.6; and I am yet to port the same to 2.7.

-srid
--
http://mail.python.org/mailman/listinfo/python-list


Re: Confusion over etree.ElementTree.Element.getiterator

2010-07-03 Thread Stefan Behnel

Ben Sizer, 04.07.2010 00:32:

On Jul 3, 11:12 pm, Ben Sizer  wrote:


>>> for el in root.getiterator():

...print el
[much output snipped]
http://www.w3.org/1999/xhtml}a at d871e8>
http://www.w3.org/1999/xhtml}a at d87288>
http://www.w3.org/1999/xhtml}script at d87300>
http://www.w3.org/1999/xhtml}script at d87378>


Hmm, I think I've worked it out. Apparently the XML namespace forms
part of the tag name in this case. Is that what is intended?


Sure.



I didn't see any examples of this in the docs.


Admittedly, it's three clicks away from the library docs on docs.python.org.

http://effbot.org/zone/element.htm#xml-namespaces

Stefan

--
http://mail.python.org/mailman/listinfo/python-list


Re: My extension code generator for C++

2010-07-03 Thread Stefan Behnel

Rouslan Korneychuk, 03.07.2010 19:22:

The code also never uses PyArg_ParseTuple or its variants. It converts
every argument using the appropriate PyX_FromY functions. I noticed
PyBindGen does the following when a conversion is needed for one argument:

py_retval = Py_BuildValue((char *) "(O)", value);
if (!PyArg_ParseTuple(py_retval, (char *) "i", &self->obj->y)) {
Py_DECREF(py_retval);
return -1;
}
Py_DECREF(py_retval);

On the other hand, here's the implementation for __sequence__getitem__:

PyObject * obj_DVector___sequence__getitem__(obj_DVector
*self,Py_ssize_t index) {
try {
std::vector > &base =
cast_base_DVector(reinterpret_cast(self));
return PyFloat_FromDouble(base.at(py_ssize_t_to_ulong(index)));

} EXCEPT_HANDLERS(0)
}


Check the code that Cython uses for these things. It generates specialised 
type conversion code that has received a lot of careful benchmarking and 
testing on different platforms.


Stefan

--
http://mail.python.org/mailman/listinfo/python-list