PyCon DE 2011 - Only Four Days Left to Submit your Proposal

2011-07-12 Thread Mike Müller

PyCon DE 2011 - Only Four Days Left to Submit your Proposal
===

The deadline for talk proposals is July 15, 2011.

You would like to talk about your Python project to the German-speaking
Python community? Just submit your proposal within the next two weeks:
http://de.pycon.org/2011/speaker/

About PyCon DE 2011
---

The first PyCon DE will be held October 4-9, 2011 in Leipzig, Germany.

The conference language will be German. Talks in English are possible. Please
contact us for details.

The call for proposals is now open. Please submit your talk by June 30, 2011
online.
There are two types of talks: standard talks (20 minutes + 5 minutes QA) and
long talks (45 minutes + 10 minutes QA).

More details about the call can be found on the PyCon DE website:
http://de.pycon.org/2011/Call_for_Papers/

Since the conference language will be German, the call is in German
too.


PyCon DE 2011 -  Nur noch vier Tage für Vortragsvorschläge
==

Noch bis zum 15.7.2011 kann jeder, der sich für Python interessiert, einen
Vortragsvorschlag für die PyCon DE 2011 einreichen. Es gibt nur zwei
Bedingungen: das Thema sollte interessant sein und etwas mit Python
zu tun haben. Für die erste deutsche Python-Konferenz sind wir an
einer breiten Themenpalette interessiert, die das ganze Spektrum der
Entwicklung, Nutzung und Wirkung von Python zeigt.

Mögliche Themen sind zum Beispiel:

* Webanwendungen mit Python
* Contentmanagement mit Python
* Datenbankanwendungen mit Python
* Testen mit Python
* Systemintegration mit Python
* Python für große Systeme
* Python im Unternehmensumfeld
* Pythonimplementierungen (Jython, IronPython, PyPy, Unladen
  Swallow und andere)
* Python als erste Programmiersprache
* Grafische Nutzerschnittstellen (GUIs)
* Parallele Programmierung mit Python
* Python im wissenschaftlichen Bereich (Bioinformatik, Numerik,
  Visualisierung und anderes)
* Embedded Python
* Marketing für Python
* Python, Open Source und Entwickler-Gemeinschaft
* Zukünftige Entwicklungen
* mehr ...

Ihr Themenbereich ist nicht aufgelistet, wäre aber aus Ihrer Sicht
für die PyCon DE interessant? Kein Problem. Reichen Sie Ihren
Vortragsvorschlag einfach ein. Auch wir können nicht alle
Anwendungsbereiche von Python überschauen.

Vortragstage sind vom 5. bis 7. Oktober 2011. Es gibt zwei
Vortragsformate:

* Standard-Vortrag -- 20 Minuten Vortrag + 5 Minuten Diskussion
* Lang-Vortrag -- 45 Minuten Vortrag + 10 Minuten Diskussion

Die Vortragszeit wird strikt eingehalten. Bitte testen Sie die Länge
Ihres Vortrags. Lassen Sie gegebenenfalls ein paar Folien weg.

Die Vortragsprache ist Deutsch. In begründeten Ausnahmefällen können
Vorträge auch auf Englisch gehalten werden. Bitte fragen Sie uns dazu.

Bitte reichen Sie Ihren Vortrag auf der Konferenz-Webseite
http://de.pycon.org bis zum 15.07.2011 ein.

Wir entscheiden bis zum 31. Juli 2011 über die Annahme des Vortrags.


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

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


[ANN] Passlib 1.5 Released

2011-07-12 Thread Eli Collins
I'm happy to announce the release of Passlib 1.5.

Passlib is a comprehensive password hashing library for Python,
supporting over 20 different hash schemes and an extensive
framework for managing existing hashes.

This release brings a long-requested feature: Python 3 support!
Other not-so-major features include support 
for the hash formats used by FSHP, Cryptacular, and Django.

Homepage - http://passlib.googlecode.com
Docs - http://packages.python.org/passlib
PyPI - http://pypi.python.org/pypi/passlib

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

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Announcing Python Tools for Visual Studio RC1

2011-07-12 Thread Dino Viehland
Hello,
We're pleased to announce the release of Python Tools for Visual Studio - RC 1 
[http://pytools.codeplex.com/releases/view/64009]. This release includes lots 
of bug fixes and several new features selected from the top voted features on 
CodePlex.  Some of the most significant changes are support for refactoring 
(renaming variables and extracting methods), several REPL features such as 
history search and support for attaching the debugger, support for breaking 
only on unhandled exceptions in the debugger and enabling the File-New Project 
from existing code for Python projects.
This release also fixes nearly 200 bugs reported by users on CodePlex and 
through our own internal testing.  Some of the more significant changes include 
performance fixes for debugging, improvements to the code analysis in 
particular in understanding packages and modules, fixes for working with 
projects under source control, and many improvements to the interactive REPL 
window including better IronPython support.
A complete list of issues fixed for this release is available here: 
http://pytools.codeplex.com/workitem/list/advanced?keyword=status=Fixed|Closedtype=Feature|Issuepriority=Allrelease=1.0%20Release%20Candidate%201assignedTo=Allcomponent=AllsortField=LastUpdatedDatesortDirection=Descendingpage=0
We'd like to thank all of the users who took the time to report issues and 
feedback: 445363200, alegault, asqui, bobsh, CalebMB, chuckjacobs, cspwcspw, 
HugoRien, joxn, jrade, lifning, MichaelBaker, mloskot, ohaynold, OldWarhorse, 
PingLin, pymab, roxtar, sei_empower, SpudInNZ, stevedeitz, sumitbasu, unplugea, 
wesley0423 , and Zooba.

Thanks,
The Python Tools for Visual Studio Team

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

Support the Python Software Foundation:
http://www.python.org/psf/donations/


PyModel-0.9: Model-based testing in Python

2011-07-12 Thread Jon Jacky

PyModel-0.9, an open-source model-based testing framework in Python,
has been released.  Code, documents, and downloads are available:

 http://staff.washington.edu/jon/pymodel/www/

 http://pypi.python.org/pypi/PyModel

 https://github.com/jon-jacky/PyModel

Version 0.9 adds new functionality, new samples, and some changes to
internals to be more consistent with recommended Python style and
programming practices.  For details see see
pymodel/notes/release-0.9.txt at the above site.  Version 0.85 was
announced here in March 2010.

There will be talk on PyModel at SciPy 2011 on Wednesday, July
13 in Austin, Texas:

 http://conference.scipy.org/scipy2011/

---

In unit testing, the programmer codes the test cases, and also codes
assertions that check whether each test case passed.  In model-based
testing, the programmer codes a model that generates as many test
cases as desired and also acts as the oracle that checks the cases.

PyModel supports on-the-fly testing, which can generate indefinitely
long nonrepeating tests as the test run executes.  PyModel can focus
test cases on scenarios of interest by composition, a versatile
technique that combines models by synchronizing shared actions and
interleaving unshared actions.  PyModel can guide test coverage
according to programmable strategies coded by the programmer.

PyModel provides three programs:

 - pma, pymodel analyzer: generates a finite state machine (FSM) and
   computes properties by exploring a model program, FSM, test suite,
   or a product of these.

 - pmg, pymodel graphics: generates a file of graphic commands from an
FSM.

 - pmt, pymodel tester: displays traces, generates tests offline,
   executes offline tests, or generates and executes tests on-the-fly.

Use pma and pmg to visualize and preview the behavior of pmt.  Every
path through the graph created by pma (and drawn by pmg) is a trace
(test run) that may be generated by pmt, when pma and pmt are invoked
with the same arguments.





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

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Python bug? Indexing to matrices

2011-07-12 Thread Ben Finney
David davidb...@gmail.com writes:

 Should the following line work for defining a matrix with zeros?

 c= [[0]*col]*row

No. Python lists are not matrixes and are not arrays.

If you want good implementations of arrays and matrices, use NumPy
URL:http://numpy.scipy.org/.

-- 
 \  “Properly read, the Bible is the most potent force for atheism |
  `\ever conceived.” —Isaac Asimov |
_o__)  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Virtual functions are virtually invisible!

2011-07-12 Thread Chris Angelico
On Tue, Jul 12, 2011 at 7:46 AM, rantingrick rantingr...@gmail.com wrote:
 Actually no i was purposely implying Mt. Vesuvius. You know, the
 VOLCANO that erupted and left poor Pompeii in ruins? Here is some text
 from the wiki verbatim:


Yes, I do know that mountain. But it doesn't have very many gods
sitting on it... maybe a magma elemental, but that's all. Anyhow, this
is quite off-topic for Python I think. (Though not off-topic for
rantingrick.)

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


Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread Steven D'Aprano
Thorsten Kampe wrote:

 * sturlamolden (Mon, 11 Jul 2011 06:44:22 -0700 (PDT))
 On 11 Jul, 14:39, Ben Finney ben+pyt...@benfinney.id.au wrote:
  The Unix model is: a collection of general-purpose, customisable
  tools, with clear standard interfaces that work together well, and
  are easily replaceable without losing the benefit of all the others.
 
 This is opposed to the Windows model of a one-click installer for a
 monolithic application. Many Windows users get extremely frustrated
 when they have to use more than one tool.
 
 *sigh* There is no Windows nor Unix model. There is only you-get-what-
 you-pay-for.
 
 On Windows, you're a customer and the developer wants to make using his
 application as convenient as possible for you, the customer.

That's an astonishing statement.

Today, I started to update a commercial, proprietary Windows application,
Quickbooks. I didn't actually get around to running the installer
application yet, on account of the installer having trouble if your data is
on a network share. (Apparently the developers of Quickbooks never
considered that when you have multiple users connected to the same database
at once, at least one of them must be accessing it over the network.) But
in preparation for the process, I took note of the information needed to
make QB run. I don't have the list in front of me, but there were something
like 6 or 8 keys needed to make the software work:

Customer account number
Licence key
Upgrade key
Validation code
etc.

(I don't remember the full list. I try not to bring that part of my work
home :)

Or consider the Windows licence key, product activation code, etc. If as
convenient as possible was their aim (as opposed to making a profit from
licencing), then you wouldn't need all that.

Why on earth should I have to install a Amazon MP3 Downloader app to
purchase mp3s? Or the iTunes app? The internet and web browsers excel at
making it easy to download files. Rather than taking advantage of that
convenience, commercial vendors put barriers in the way and try to carve
out little walled gardens. Did they not learn anything from AOL?

Where is the Windows equivalent of yum or apt-get? Why isn't there a central
repository of independent and third party Windows software? It seems clear
to me that it is the major open source communities that aim for
convenience, at the cost of the opportunity to sell licences.

In fairness though, open source developers' idea of convenient is not
always the same as mine.


 On Unix you don't pay and the developer couldn't care less if his
 application works together with application b or how much it takes you
 to actually get this damn thing running.

That might have been true, oh, 20 years ago, but today, that's far less of a
rule. Linux distros make interoperability far simpler. Some level of savvy
is needed, but it is remarkable how much Linux software Just Works.

In my experience, two categories of Linux software are generally hard to
deal with: one-man projects (usually stuck on version 0.2b for the last
seven years), and big, popular projects that have been taken over by
developers from the Windows world (I'm looking at you, Firefox). YMMV.


 And as soon as developers start developing for Unix customers (say
 Komodo, for instance), they start following the Windows model - as you
 call it.

Surely that's because Komodo started off as a Windows application before
being ported to Unix?



-- 
Steven

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


Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160

On 2011.07.12 05:24 AM, Steven D'Aprano wrote:
 Rather than taking advantage of that convenience, commercial vendors
 put barriers in the way and try to carve out little walled gardens.
 Did they not learn anything from AOL?
DRM and activation schemes will /always/ make things harder, but that is
the cost of doing business, at least in the minds of commercial software
vendors.

There are actually a lot of good freeware (proprietary, but zero cost)
apps out there. Some even better than open-source alternatives. I avoid
commercial apps, though, since they tend to be far inferior to the
alternatives (inconvenience aside).

 Where is the Windows equivalent of yum or apt-get? Why isn't there a
 central repository of independent and third party Windows software?
If Microsoft made such a repository, how much of the repository would be
high-quality open-source software, and how much would be commercial
shovelware?

Attempts at independent repos have been made, but they all fail because
there's no effort among developers (especially developers of proprietary
software), to package their software this way. These attempts also fail
because they fail to gain support from users (a catch-22 where users
don't bother because there's not much in the repo and there's not much
in the repo because users don't bother).

 It seems clear to me that it is the major open source communities
 that aim for convenience, at the cost of the opportunity to sell
 licences.
The developers of open-source projects often aim to please the user
rather than make money. You'd think pleasing the user and making money
would go hand-in-hand, but history has shown that the latter can be
achieved with little thought of the former.

 That might have been true, oh, 20 years ago, but today, that's far
 less of a rule. Linux distros make interoperability far simpler. Some
 level of savvy is needed, but it is remarkable how much Linux
 software Just Works.
At first, Linux had to learn how to crawl and then walk. Now it's doing
gymnastics. :)

 In my experience, two categories of Linux software are generally hard
 to deal with: one-man projects (usually stuck on version 0.2b for the
 last seven years), and big, popular projects that have been taken
 over by developers from the Windows world (I'm looking at you,
 Firefox). YMMV.
Firefox (and Thunderbird with it) are falling into the same trap that
many fall into when they become popular. This is more prevalent among
commercial apps, but it's not too surprising considering Firefox's
popularity. The trap is making things shiny. That is, using UI designs
(and to a lesser extent adding neat, but generally useless features)
that appeal to the computer-illiterate masses who cling to something
that looks neat, regardless of how useful it ultimately is. AFAICT,
Mozilla's problem isn't that incompetent Windows-centric devs took over,
but rather that Google and MS were stepping up their game with their
respective browsers and is desperately trying not to lose market share.

- -- 
CPython 3.2 | Windows NT 6.1.7601.17592 | Thunderbird 5.0
PGP/GPG Public Key ID: 0xF88E034060A78FCB
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAwAGBQJOHC4EAAoJEPiOA0Bgp4/Lgm0IAOT+/LQNalPHm5pvt4ilF1yt
RM9fPBSgAF5k9U8jWBuQy/V6QJ/a1Sfkzu8ulZ8TyAYS64quucIqTwMJugdTUmct
KsGbDsyXg0FObMxNiKKFuZblVYOtnULkYtYZOxeE33qy+85X6NMuFUv7ARHaLi/3
1Bdmnsj43hRrzJ1Rwb8x+xbOmiq+fJ7199loPQ+unSu7s37NJoL1e1vFNnsmGz8A
Jg58Q0MbGiwettPdM9ZySYWgTJhiawtEX4SF6YiQqf22e04OyPWyxUfejixnZNoQ
7vbksr9k8PQzuTlG2y3G1pJx6XGrxgOQuEoVjInMGbZW0tx43paJLEWCOcd38FI=
=3FGv
-END PGP SIGNATURE-
-- 
http://mail.python.org/mailman/listinfo/python-list


What Programing Language are the Largest Website Written In?

2011-07-12 Thread Xah Lee

maybe this will be of interest.

〈What Programing Language Are the Largest Website Written In?〉
http://xahlee.org/comp/website_lang_popularity.html

-

i don't remember how, but today i suddenly got reminded that Facebook
is written in PHP. So, on the spur of the moment, i twitted:

  “Remember folks, the world's largest sites {Facebook, Wikipedia,
“Yahoo!”, etc} are written in Pretty Home Page!”

and followed with:

  “To Chinese friends, what's Baido, QQ, Taobao, Sina written in?”

Then, this question piqued me, even i tried to not waste my time. But
it overpowered me before i resisted, becuase i quickly spend 15 min to
write this list (with help of Google):

1 Google ◇ Java
2 Facebook ◇ PHP
3 YouTube ◇ Python
4 Yahoo! ◇ PHP
5 blogger.com ◇ Java
6 baidu.com ◇ C/C++. perl/python/ruby
7 Wikipedia ◇ PHP
8 Windows Live live.com
9 Twitter.com ◇ Scala and Ruby?
10 QQ.com ◇ ?
11 MSN.com ◇ ?
13 LinkedIn ◇ PHP?
15 TaoBao.com ◇ ?
16 sina.com.cn ◇ ?
17 Amazon.com ◇ ?
18 WordPress.com ◇ PHP
22 eBay.com ◇ ?
23 yandex.ru (Russian) ◇ ?
24 Bing ◇ ?
27 Microsoft.com ◇ ?
28 网易 163.com ◇ ?
29 PayPal.com ◇ Java?
31 新浪微博 weibo.com ◇ ?
32 Flickr.com ◇ ?
34 mail.ru ◇ ?
35 Craiglist.org ◇ perl
36 FC2.com ◇ ?
38 Apple.com ◇ Objective J?
39 imdb.com ◇ ?
41 VKontakte.ru ◇ ?
43 搜狐网 sohu.com ◇ ?
44 Ask.com ◇ ?
45 BBC.co.uk ◇ ?
46 tumblr.com ◇ PHP
47 LiveJasmin.com (porn) ◇ ?
48 xvideos.com (porn) ◇ ?
…
56 土豆网 Todou.com ◇ ?
81 YouPorn.com ◇ ?
StumbleUpon.com ◇ PHP, Perl, C++
…

the numbers is site ranking, from alexa.com. (missing ones are mostly
duplicates, such as google japan, google india, etc.)

i think notable interest is that twitter stands out, with Scala and
Ruby.

Those with perl are probably going back to the first dot com era (aka
Web 1.0, ~1995 to ~2002). At that time, perl was basically the only
game in town (secondarily: Java). (i don't recall what amazon and ebay
were in... was it perl or php? how about imdb.com?)

most php follows starting in early 2000s, that's when PHP quietly
surpassed perl in all battle fronts.

it'd be interesting to know what some of the chinese sites uses, and
porn sites (e.g. livejasmin, xvideos, youporn)

as for Microsoft sites... are they in C/C++ and or dotnet?

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


Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread Chris Angelico
On Tue, Jul 12, 2011 at 8:24 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
 Where is the Windows equivalent of yum or apt-get? Why isn't there a central
 repository of independent and third party Windows software? It seems clear
 to me that it is the major open source communities that aim for
 convenience, at the cost of the opportunity to sell licences.


The nearest commercial equivalent is probably Apple's iTunes store. It
manages to be the one place to go for iphone apps, many of which
cost money. Upside: Developers know where to host their stuff if they
want it to sell. Downside: Developers have to host it there if they
want it to sell - and Apple snag 30% on the way through.

I've not seen a Windows equivalent, but Microsoft could make one if
they wanted to. All they need is for the next version of Windows to
recommend that all software be signed, and make it somewhat awkward to
install unsigned software, and that would be that. It would probably
be the knell of Windows, but it could be done.

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


Re: Python bug? Indexing to matrices

2011-07-12 Thread sturlamolden
On 12 Jul, 07:39, David davidb...@gmail.com wrote:
 Should the following line work for defining a matrix with zeros?

 c= [[0]*col]*row

No. The rows will be aliased.

This will work:

c = [[0]*col for i in range(row)]

Note that Python lists are not ment to be used as matrices. We have
NumPy or the array module for that.


 If this a valid way of initializing a matrix in Python 3.2.1, then it
 appears to me that a bug surfaces in Python when performing this line:

 c[i][j] = c[i][j] + a[i][k] * b[k][j]

 It writes to the jth column rather than just the i,j cell.

That is due to aliasing.


 I'm new at Python and am not sure if I'm just doing something wrong if
 there is really a bug in Python.  The script works fine if I
 initialize the matrix with numpy instead:

 c = np.zeros((row,col))

 So, I know my matrix multiply algorithm is correct (I know I could use
 numpy for matrix multiplication, this was just to learn Python).

Like so:

   np.dot(a,b)

or

   ma = np.matrix(a)
   mb = np.matrix(b)
   a*b

or call BLAS directly:

   scipy.linalg.fblas.dgemm


Sturla


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


Re: Python bug? Indexing to matrices

2011-07-12 Thread sturlamolden
On 12 Jul, 14:59, sturlamolden sturlamol...@yahoo.no wrote:

    ma = np.matrix(a)
    mb = np.matrix(b)
    a*b

ma*mb

Sorry for the typo.



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


Re: Python bug? Indexing to matrices

2011-07-12 Thread David
Thank all for the very helpful replies.  The goal of the matrix
multiply exercise was just to help my son and I learn Python better.
I now understand *why* my initialization of [c] was wrong and I am
continuing to check out numpy and scipy.

Regards,
David
-- 
http://mail.python.org/mailman/listinfo/python-list


Set run vars with each call

2011-07-12 Thread Gnarlodious
Question. Is there a special method or easy way to set default values
with each call to an instance? Any ideas to make it easier? What I
want to do is have a constantly updating set of values which can be
overridden. Just thought there was an easy way to set that up.

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


Re: Set run vars with each call

2011-07-12 Thread Alister Ware
On Tue, 12 Jul 2011 06:32:32 -0700, Gnarlodious wrote:

 Question. Is there a special method or easy way to set default values
 with each call to an instance? Any ideas to make it easier? What I want
 to do is have a constantly updating set of values which can be
 overridden. Just thought there was an easy way to set that up.
 
 -- Gnarlie

I thought that was the role of the __init__ function

class Something:
def __init__(self):
self.value=some value




-- 
No matter how subtle the wizard, a knife in the shoulder blades will 
seriously
cramp his style.
-- 
http://mail.python.org/mailman/listinfo/python-list


How to write a file generator

2011-07-12 Thread Billy Mays
I want to make a generator that will return lines from the tail of 
/var/log/syslog if there are any, but my function is reopening the file 
each call:


def getLines():
with open('/var/log/syslog', 'rb') as f:
while True:
line = f.readline()
if line:
yield line
else:
raise StopIteration


I know the problem lies with the StopIteration, but I'm not sure how to 
tell the caller that there are no more lines for now.


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


Re: Lisp refactoring puzzle

2011-07-12 Thread Terry Reedy

On 7/11/2011 11:37 PM, Xah Lee wrote:

it's funny, in all these supposedly modern high-level langs, they
don't provide even simple list manipulation functions such as union,
intersection, and the like. Not in perl, not in python,


Union and intersection are set operations, not list operations. Python 
has had a set type with a full set of set operations for several years. 
It has list concatenation, which is the list equivalent of union. It has 
lots of other useful list operations.


 Mathematica has Union, Intersection, and a host of others
 some 20 years ago, and today it has a complete set of combinatorics
 functions as *builtin* functions

Python has the basic combinatoric function in the itertools module, 
though they are not used much. If Mathematica has Catalan sequences 
builtin, I wonder how much they are used. Since Python is free, in both 
meanings, it does not have paid people sitting around writing things to 
pad numbers to justify a $2k price tag. On the other hand, lots of 
people have added and made available lots of good add-ons. Mathematica 
should probably be most fairly compared with Python+numpy+scipy and 
maybe a few other things.


--
Terry Jan Reedy

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


Re: Lisp refactoring puzzle

2011-07-12 Thread jvt
I might argue that it isn't quite right (or politic) to call those who
resist technological changes idiots so much as to observe they often
have goals which cannot wait for the ideal expressive system.  People
love python not because Python is the platonic programming language,
but because it does what they need it to do right now.  Ditto (often)
for Lisp.

It is easy to point out an example of forward thinking languages like
Mathematica, and who knows, perhaps it will be the template upon which
languages are built in the next 100 years.  But if it is, there will
be tons of other technologies which _didn't_ make it but which might
have seemed equally advanced.  Early adoption is always a risk, and
few people want to deal with it when technology exists now that solves
their problem now, however sub-optimally. That is hardly idiotic, Xah.

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


Re: Lisp refactoring puzzle

2011-07-12 Thread WJ
Xah Lee wrote:

 it's funny, in all these supposedly modern high-level langs, they
 don't provide even simple list manipulation functions such as union,
 intersection, and the like. Not in perl, not in python, not in lisps.

Ruby has them.

Intersection:

[2,3,5,8]  [0,2,4,6,8]
==[2, 8]

Union:

[2,3,5,8] | [0,2,4,6,8]
==[2, 3, 5, 8, 0, 4, 6]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Lisp refactoring puzzle

2011-07-12 Thread Chris Kaynor
On Mon, Jul 11, 2011 at 8:37 PM, Xah Lee xah...@gmail.com wrote:

 it's funny, in all these supposedly modern high-level langs, they
 don't provide even simple list manipulation functions such as union,
 intersection, and the like. Not in perl, not in python, not in lisps.
 (sure, lib exists, but it's a ride in the wild)


Python has them, but, as they are set functions, not list functions, they
exist for the set type:

Intersection:
 set((1, 2, 3))  set((2,3,4))
set([2, 3])

Union:
 set((1, 2, 3)) | set((2,3,4))
set([1, 2, 3, 4])

Symmetric Difference:
 set((1, 2, 3)) ^ set((2,3,4))
set([1, 4])


You can also get a non-symmetric difference by calling the difference method
of the set:
 set((1, 2, 3)).difference(set((2,3,4)))
set([1])
 set((2, 3, 4)).difference(set((1,2,3)))
set([4])


In Python 3 (2.7?) there is even more syntactical sugar for them: {1, 2, 3}
^ {2, 3, 4} produces {1, 4}.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to write a file generator

2011-07-12 Thread bruno.desthuilli...@gmail.com
On Jul 12, 4:46 pm, Billy Mays no...@nohow.com wrote:
 I want to make a generator that will return lines from the tail of
 /var/log/syslog if there are any

Err... I must have missed something, but python files are their own
iterators.

Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type help, copyright, credits or license for more information.
pythonrc start
pythonrc done
 f = open(/var/log/syslog)
 for line in f:
... print line
...
(snip unintersting syslog stuff))

, but my function is reopening the file
 each call:

How do you know, and how do you call your function ?

 def getLines():
      with open('/var/log/syslog', 'rb') as f:
          while True:
              line = f.readline()
              if line:
                  yield line
              else:
                  raise StopIteration

 I know the problem lies with the StopIteration, but I'm not sure how to
 tell the caller that there are no more lines for now.

If you want the generator to wait until new content is available, just
remove the raise part - but you'll have a blocking call... Else, I
don't see what behaviour you are expecting exactly.




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


Re: How to write a file generator

2011-07-12 Thread Thomas Jollans
On 07/12/2011 04:46 PM, Billy Mays wrote:
 I want to make a generator that will return lines from the tail of
 /var/log/syslog if there are any, but my function is reopening the file
 each call:
 
 def getLines():
 with open('/var/log/syslog', 'rb') as f:
 while True:
 line = f.readline()
 if line:
 yield line
 else:
 raise StopIteration
 
 
 I know the problem lies with the StopIteration, but I'm not sure how to
 tell the caller that there are no more lines for now.
 
 -- 
 Bill

http://stackoverflow.com/questions/1475950/tail-f-in-python-with-no-time-sleep
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Lisp refactoring puzzle

2011-07-12 Thread fortunatus
I think the problem with so-called forward looking or highest
level languages is that they tend to become domain specific.  What
Lispers are always saying is construct your own high level language
out of your favorite Lisp.  Of course no one else will use it then, or
even discuss it, unless you have some good buddies.

What happens is that high level languages don't end up addressing
needs across a large community.  The lower down languages can be
common denominators across wide swaths of programmers.  So we live in
this world of roll-your-own on top of the common denominator language.

One exception to this is in data base development, where there were
some 4th generation languages that had some success, where the needs
of mapping business data models onto data base oriented implementation
has had a large community.

I guess Mathematica, or MatLab in my environment, also address a
community of needs for modelling mathematical algorithms, or for doing
analysis of data sets.

However both the data base field and the math/arithmetic tool field
are examples of domains that are narrower than programming in
general.  Hence those higher level languages could be seen as domain
specific, but for domains with lots of users.
-- 
http://mail.python.org/mailman/listinfo/python-list


Python Wizard, with apologies to The Who

2011-07-12 Thread John Keisling
After too much time coding Python scripts and reading Mark Lutz's
Python books, I was inspired to write the following lyrics. For those
too young to remember, the tune is that of Pinball Wizard, by The
Who. May it bring you as much joy as it brought me!


I cut my teeth on BASIC
At scripting I'm no pawn
From C++ to Java
My code goes on and on
But I ain't seen nothing like this
In any place I've gone
That modeling and sim guy
Sure codes some mean Python!

He knows his dictionaries
His exceptions never pass
His polymorphic methods
Extend each superclass
He uses indentation
Its lines are clearly drawn
That modeling and sim guy
Sure codes some mean Python!

He's a Python wizard
His code just never wrecks
A Python wizard
He knows simple beats complex

How do you think he does it?
(I don't know)
What makes him so good?

He codes with TkInter
He can render treble clefs
He uses lamdba functions
With *args in their defs
Defines his module search path
Of tuples he's the don
That modeling and sim guy
Sure codes some mean Python!

I thought I was
The scripting language king
But I just handed
My Python crown to him

He links in to libraries
All optimized in C
He always uses docstrings
For readability
He knows file iterators
He bids all bugs begone
That modeling and sim guy
Sure codes some mean Python!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to write a file generator

2011-07-12 Thread Billy Mays

On 07/12/2011 11:52 AM, Thomas Jollans wrote:

On 07/12/2011 04:46 PM, Billy Mays wrote:

I want to make a generator that will return lines from the tail of
/var/log/syslog if there are any, but my function is reopening the file
each call:

def getLines():
 with open('/var/log/syslog', 'rb') as f:
 while True:
 line = f.readline()
 if line:
 yield line
 else:
 raise StopIteration


I know the problem lies with the StopIteration, but I'm not sure how to
tell the caller that there are no more lines for now.

--
Bill


http://stackoverflow.com/questions/1475950/tail-f-in-python-with-no-time-sleep



That was actually the behavior I was trying to avoid.  If there is no 
data to be read, the call will hang.  That function is actually called 
by a webserver (from wsgiref) so it cannot hang indefinitely.


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


Re: Python Wizard, with apologies to The Who

2011-07-12 Thread Matty Sarro
I don't know whether to LOL or mourn the part of me that just died inside :-P

j/k j/k
clever song, and it made me laugh :)

On Tue, Jul 12, 2011 at 12:40 PM, John Keisling
maththespia...@gmail.com wrote:
 After too much time coding Python scripts and reading Mark Lutz's
 Python books, I was inspired to write the following lyrics. For those
 too young to remember, the tune is that of Pinball Wizard, by The
 Who. May it bring you as much joy as it brought me!


 I cut my teeth on BASIC
 At scripting I'm no pawn
 From C++ to Java
 My code goes on and on
 But I ain't seen nothing like this
 In any place I've gone
 That modeling and sim guy
 Sure codes some mean Python!

 He knows his dictionaries
 His exceptions never pass
 His polymorphic methods
 Extend each superclass
 He uses indentation
 Its lines are clearly drawn
 That modeling and sim guy
 Sure codes some mean Python!

 He's a Python wizard
 His code just never wrecks
 A Python wizard
 He knows simple beats complex

 How do you think he does it?
 (I don't know)
 What makes him so good?

 He codes with TkInter
 He can render treble clefs
 He uses lamdba functions
 With *args in their defs
 Defines his module search path
 Of tuples he's the don
 That modeling and sim guy
 Sure codes some mean Python!

 I thought I was
 The scripting language king
 But I just handed
 My Python crown to him

 He links in to libraries
 All optimized in C
 He always uses docstrings
 For readability
 He knows file iterators
 He bids all bugs begone
 That modeling and sim guy
 Sure codes some mean Python!
 --
 http://mail.python.org/mailman/listinfo/python-list

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


Re: Lisp refactoring puzzle

2011-07-12 Thread Terry Reedy

On 7/11/2011 11:37 PM, Xah Lee wrote:

watch the first episode of Douglas Crockford's talk here:
  http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-1


The link includes a transcript of the talk, which I read

I suspect Lee likes Crockford because they both think they are smarter 
than everyone else. Writing about Smalltalk, for instance, Crockford says:


I don't know why it is, but a lot of programmers just couldn't get used 
to this syntax. [everything is done by sending a message with arguments 
to some object] ...So this may be a superior notation, but it was 
profoundly rejected. By who? By us, by the programmers, because we 
couldn't understand it.


Actually, I and others see Smalltalk as deeply flawed because its 
message passing syntax arbitrarily breaks symmetries in operations. For 
instance, in the expression 'a+b', both operands have equivalent roles 
in the operation for all normal interpretations of '+'.# On the other 
hand, in the expression 'a.extend(b)', where a is a list and b any 
iterable and the result is to mutate a but not b, a and b have very 
different roles in both the operation and the expression that invokes it.


# Under the covers, Python implements 'a+b' as first 'a.__add__(b)', but 
it also tries 'b.__radd__(a)' if the first does not work. This 
introduces a slight asymmetry in that a gets first say at defining the 
meaning of 'a+b', but it does not get the only say. And, as far as I can 
presently remember, this asymmetry is never visible with builtins. In 
fact, this implementation makes it possible for 'a+b' and 'b+a' to both 
give the same answer when a is a builtin and b is a user-class instance.


Crockford is right that he does not 'know why it is' that not everyone 
loves Smalltalk. He should have stopped there instead of projecting his 
ignorance on everyone else.


As a side note, the same principle of expressions matching operations in 
symmetry suggest that majority of up are quite sensible and not dumb 
idiots for preferring 'f(x)' to the '(f x)' of Lisp. In a function call, 
the function has a different role than the arguments, so it is 
appropriate that it have a different role in the expression.


--
Terry Jan Reedy

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


Re: How to write a file generator

2011-07-12 Thread sturlamolden
On 12 Jul, 16:46, Billy Mays no...@nohow.com wrote:

 I know the problem lies with the StopIteration, but I'm not sure how to
 tell the caller that there are no more lines for now.

Try 'yield None' instead of 'raise StopIteration'.

Sturla


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


Re: Python Wizard, with apologies to The Who

2011-07-12 Thread Tim Daneliuk
On 7/12/2011 11:40 AM, John Keisling said this:
 After too much time coding Python scripts and reading Mark Lutz's
 Python books, I was inspired to write the following lyrics. For those
 too young to remember, the tune is that of Pinball Wizard, by The
 Who. May it bring you as much joy as it brought me!
 

SNIP

You realize that you must now reprise this with,
I'm your wicked Uncle Guido ... right?


-- 

Tim Daneliuk
tun...@tundraware.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Set run vars with each call

2011-07-12 Thread Gnarlodious
On Jul 12, 8:46 am, Alister Ware wrote:

 I thought that was the role of the __init__ function

 class Something:
         def __init__(self):
                 self.value=some value


OK, that sets a value at init time. But is there a similar built-in to
run whenever the class instance is called?

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


Re: Python Wizard, with apologies to The Who

2011-07-12 Thread Tim Daneliuk
On 7/12/2011 12:08 PM, Tim Daneliuk said this:
 On 7/12/2011 11:40 AM, John Keisling said this:
 After too much time coding Python scripts and reading Mark Lutz's
 Python books, I was inspired to write the following lyrics. For those
 too young to remember, the tune is that of Pinball Wizard, by The
 Who. May it bring you as much joy as it brought me!

 
 SNIP
 
 You realize that you must now reprise this with,
 I'm your wicked Uncle Guido ... right?
 
 

While were on the subject:

  T-t-t-alking 'bout my generator 

-- 

Tim Daneliuk
tun...@tundraware.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Set run vars with each call

2011-07-12 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160

On 2011.07.12 12:32 PM, Gnarlodious wrote:
 OK, that sets a value at init time. But is there a similar built-in 
 to run whenever the class instance is called?
What do you mean by call an instance? Do you want to run certain code
whenever any method is called? Do you want to want certain code to run
whenever an attribute is accessed? Calling an instance doesn't make any
sense, especially if you're not referring to the __init__() method.

- -- 
CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0
PGP/GPG Public Key ID: 0xF88E034060A78FCB
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAwAGBQJOHImDAAoJEPiOA0Bgp4/LEzYH/1R+cXobysF02GiB45LcXjHm
oQsSkrbXtlvutgOlVHOI8MRVRzMndgK+0jWsujYD4nZYf45GO3b0hw/zb9jy3bUI
7BafZMRAz+wI1BJFlDD3P+IjPDoW4WvpMP0q09H4f664DYwQNuXfeveNOwAQnPXl
SpqpcvnTm0fqocC0o2G9jUuV50QXFFPntz/VVwl+3UpJLS95pCuAq+URs4OVhLM2
QB1ulmZ35PyfArdz5pYvoXvtfeURldfZhhAm1/mkVThzffUxAcCTANg6AeYd2JNb
QO0jSCedhrzWfsK5J63Ax+nrmjvms8+gZ3TxNkdMaz0zICtDuq5lLSIml1JuUfk=
=EMT2
-END PGP SIGNATURE-
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to write a file generator

2011-07-12 Thread Terry Reedy

On 7/12/2011 10:46 AM, Billy Mays wrote:

I want to make a generator that will return lines from the tail of
/var/log/syslog if there are any, but my function is reopening the file
each call:

def getLines():
with open('/var/log/syslog', 'rb') as f:
while True:
line = f.readline()
if line:
yield line
else:
raise StopIteration


Please use spaces rather than (disappearing) tabs in posted code.


I know the problem lies with the StopIteration, but I'm not sure how to
tell the caller that there are no more lines for now.


The same way you currently decide when to raise StopIteration

def tail(filename):
  with open(filename, 'rb') as f:
while True:
  yield f.readline()

When the caller gets '', it should go and do something else for awhile.

--
Terry Jan Reedy

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


new python contracts library

2011-07-12 Thread Rodney Gomes
Hey I recently created a contracts library for python and was wondering if 
anyone finds it useful or wants to have additional features added ? Feel free 
to open new issues on the github project. 

https://github.com/rlgomes/contracts

This is just a v0.1 and I welcome any and all suggestions to make it into 
something really useful. I've found it useful for when I start putting together 
a few other project ideas I have and want to make sure that the certain 
functions are being used correctly and that bad arguments or return values 
don't end up blowing up the application in a completely unrelated function call 
sometime later than the original point where the bug actually occurred.

If this is not the correct forum for this posting let me know and i'll move it 
elsewhere.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Wizard, with apologies to The Who

2011-07-12 Thread Phlip
 That modeling and sim guy
 Sure codes some mean Python!

C-;

And he changes key on the fly, too!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Lisp refactoring puzzle

2011-07-12 Thread gene heskett
On Tuesday, July 12, 2011 02:08:02 PM Terry Reedy did opine:

 On 7/11/2011 11:37 PM, Xah Lee wrote:
  watch the first episode of Douglas Crockford's talk here:
http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-1
 
 The link includes a transcript of the talk, which I read
 
 I suspect Lee likes Crockford because they both think they are smarter
 than everyone else. Writing about Smalltalk, for instance, Crockford
 says:
 
 I don't know why it is, but a lot of programmers just couldn't get used
 to this syntax. [everything is done by sending a message with arguments
 to some object] ...So this may be a superior notation, but it was
 profoundly rejected. By who? By us, by the programmers, because we
 couldn't understand it.
 
 Actually, I and others see Smalltalk as deeply flawed because its
 message passing syntax arbitrarily breaks symmetries in operations. For
 instance, in the expression 'a+b', both operands have equivalent roles
 in the operation for all normal interpretations of '+'.# On the other
 hand, in the expression 'a.extend(b)', where a is a list and b any
 iterable and the result is to mutate a but not b, a and b have very
 different roles in both the operation and the expression that invokes
 it.
 
 # Under the covers, Python implements 'a+b' as first 'a.__add__(b)', but
 it also tries 'b.__radd__(a)' if the first does not work. This
 introduces a slight asymmetry in that a gets first say at defining the
 meaning of 'a+b', but it does not get the only say. And, as far as I can
 presently remember, this asymmetry is never visible with builtins. In
 fact, this implementation makes it possible for 'a+b' and 'b+a' to both
 give the same answer when a is a builtin and b is a user-class instance.
 
 Crockford is right that he does not 'know why it is' that not everyone
 loves Smalltalk. He should have stopped there instead of projecting his
 ignorance on everyone else.
 
I have my own reasons to hate smalltalk but won't elaborate.

 As a side note, the same principle of expressions matching operations in
 symmetry suggest that majority of up are quite sensible and not dumb
 idiots for preferring 'f(x)' to the '(f x)' of Lisp. In a function call,
 the function has a different role than the arguments, so it is
 appropriate that it have a different role in the expression.

Which should be well documented if one expects the programmers to use it 
properly.  So far, I have only found two languages that are adequately 
defined and implemented.  KR C, and the now essentially defunct Amiga 
ARexx.  But I should preface that by saying that I have not yet adequately 
studied python, one of the reasons I joined this list.

Specifically, I am trying to install the altera quartus software so I can 
program one of their DE1 boards, but because the majority of the linux 
distro's have not kept their repo's zlib packages up to date, one of the 
quartus imports, gzdirect is on the missing list and I am dead in the water 
until I install zlib version 1.2.5.

I hope this list serves me as a tutorial to fill in the gaps of my python 
knowledge which at the moment seem too wide to jump over.  I hope I can ask 
intelligent, if newbie, questions occasionally.

Now, I hate to mention it Terry, but your clock seems to be about 126 
months behind the rest of the world.  Does your system not run ntpd by 
default?  The date in the header from your machine is 
Mon Jan 1 14:11:11 2001.

Cheers, gene
-- 
There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order.
-Ed Howdershelt (Author)
What makes us so bitter against people who outwit us is that they think
themselves cleverer than we are.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread CM

  One reason there hasn't been much demand for a GUI builder is that, in
  many cases, it's just as simpler or simpler to code a GUI by hand.

I use a GUI builder because I'd rather click less than type more. I
just
tried that in Boa Constructor; with ~10 mouse clicks I produced 964
characters of Python code.  Now, sure, depending on how I wrote the
code I could do better than that, but for me, I just find it more
intuitive
and easier to use a GUI to make a GUI.

 Often a GUI builder is used as a bad replacement for sketch-pad and
 pencil.

I would use a sketch-pad and pencil and *then* use the GUI builder.
What's nice about a builder is one can move things around quickly
and see the results in the real application, which one can never
really
see well on a paper sketch.  You could use a mock-up program of
course, but I feel you might as well do it in the builder because when
you're satisfied with it you have a real runnable application instead
of just a picture.

 Using a GUI builder with layout managers might actually
 feel awkward.

It takes some getting used to in Boa, in my experience, but then
it feels intuitive and I really like using sizers with Boa.  It helps
if
you give your sizers descriptive names.

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


Re: Python Wizard, with apologies to The Who

2011-07-12 Thread John Keisling
On Jul 12, 11:34 am, Tim Daneliuk tun...@tundraware.com wrote:
 On 7/12/2011 12:08 PM, Tim Daneliuk said this:

  On 7/12/2011 11:40 AM, John Keisling said this:
  After too much time coding Python scripts and reading Mark Lutz's
  Python books, I was inspired to write the following lyrics. For those
  too young to remember, the tune is that of Pinball Wizard, by The
  Who. May it bring you as much joy as it brought me!

  SNIP

  You realize that you must now reprise this with,
  I'm your wicked Uncle Guido ... right?

 While were on the subject:

   T-t-t-alking 'bout my generator 

 --
 
 Tim Daneliuk
 tun...@tundraware.com

Brilliant! LOL!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Set run vars with each call

2011-07-12 Thread Ian Kelly
On Tue, Jul 12, 2011 at 11:50 AM, Andrew Berg bahamutzero8...@gmail.com wrote:
 On 2011.07.12 12:32 PM, Gnarlodious wrote:
 OK, that sets a value at init time. But is there a similar built-in
 to run whenever the class instance is called?
 What do you mean by call an instance? Do you want to run certain code
 whenever any method is called? Do you want to want certain code to run
 whenever an attribute is accessed? Calling an instance doesn't make any
 sense, especially if you're not referring to the __init__() method.

If I'm understanding correctly, I think the OP wants to do something like this:

class Gadget:
def do_something(self, some_argument=some_default_value):
# do stuff

where the exact default value of some_argument depends on the current
state of the Gadget instance.  The canonical approach here would be:

class Gadget:
def do_something(self, some_argument=None):
if some_argument is None:
some_argument = self._some_argument_default
# do stuff

And then the other instance methods of Gadget can update the default
by setting the value of the _some_argument_default attribute.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Wizard, with apologies to The Who

2011-07-12 Thread Carl Banks
On Tuesday, July 12, 2011 9:40:23 AM UTC-7, John Keisling wrote:
 After too much time coding Python scripts and reading Mark Lutz's
 Python books, I was inspired to write the following lyrics. For those
 too young to remember, the tune is that of Pinball Wizard, by The
 Who. May it bring you as much joy as it brought me!
 
 
 I cut my teeth on BASIC
 At scripting I'm no pawn
 From C++ to Java
 My code goes on and on
 But I ain't seen nothing like this
 In any place I've gone
 That modeling and sim guy
 Sure codes some mean Python!


That's pretty funny.  I knew what it would be even when I saw the cut-off 
subject line, and I am too young to remember it.


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


Re: How to write a file generator

2011-07-12 Thread Thomas Jollans
On 07/12/2011 06:42 PM, Billy Mays wrote:
 On 07/12/2011 11:52 AM, Thomas Jollans wrote:
 On 07/12/2011 04:46 PM, Billy Mays wrote:
 I want to make a generator that will return lines from the tail of
 /var/log/syslog if there are any, but my function is reopening the file
 each call:

 def getLines():
  with open('/var/log/syslog', 'rb') as f:
  while True:
  line = f.readline()
  if line:
  yield line
  else:
  raise StopIteration


 I know the problem lies with the StopIteration, but I'm not sure how to
 tell the caller that there are no more lines for now.

 -- 
 Bill

 http://stackoverflow.com/questions/1475950/tail-f-in-python-with-no-time-sleep

 
 
 That was actually the behavior I was trying to avoid.  If there is no
 data to be read, the call will hang.  That function is actually called
 by a webserver (from wsgiref) so it cannot hang indefinitely.

In that case, what Bruno said.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Lisp refactoring puzzle

2011-07-12 Thread Petter Gustad
Xah Lee xah...@gmail.com writes:

 it's funny, in all these supposedly modern high-level langs, they
 don't provide even simple list manipulation functions such as union,
 intersection, and the like. Not in perl, not in python, not in lisps.

In Common Lisp you have:

CL-USER (union '(a b c) '(b c d))
(A B C D)
CL-USER (intersection '(a b c) '(b c d))
(C B)

//Petter
-- 
.sig removed by request. 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to write a file generator

2011-07-12 Thread Thomas Jollans
On 07/12/2011 06:42 PM, Billy Mays wrote:
 On 07/12/2011 11:52 AM, Thomas Jollans wrote:
 On 07/12/2011 04:46 PM, Billy Mays wrote:
 I want to make a generator that will return lines from the tail of
 /var/log/syslog if there are any, but my function is reopening the file
 each call:

 def getLines():
  with open('/var/log/syslog', 'rb') as f:
  while True:
  line = f.readline()
  if line:
  yield line
  else:
  raise StopIteration


 I know the problem lies with the StopIteration, but I'm not sure how to
 tell the caller that there are no more lines for now.

 -- 
 Bill

 http://stackoverflow.com/questions/1475950/tail-f-in-python-with-no-time-sleep

 
 
 That was actually the behavior I was trying to avoid.  If there is no
 data to be read, the call will hang.  That function is actually called
 by a webserver (from wsgiref) so it cannot hang indefinitely.


What Terry said, then. (Not Bruno, I confused that. Sorry for sending a
mail both short and wrong.)
-- 
http://mail.python.org/mailman/listinfo/python-list


Complete Google Advertising Solutions

2011-07-12 Thread Amelia Grace
TheItValley is a capable web development application, software
combination, search engine optimization, E-commerce, E-banking and
complete Google advertising solution Organization based in UK main
branches office in Sweden, Norway and Pakistan.
The Internet is the most efficient and greatest growing sales channel
for many organizations. Through internet every organization can
enhance the sale and purchase volume which is very effective and
significant way.  Therefore TheitValley is offering complete Google
advertising solutions to evaluate the E commerce and E business
solutions using the Internet to increase customers and generate more
sales. Choosing the right E commerce supplier is a key decision:
choosing one with a proven track record, experience and deep
familiarity with all aspects of the online marketing, TIV is aimed at
providing elevated quality and cost-induced web application/software
solutions from small to medium organizations worldwide by combining
the onsite analysis phase with offshore development  testing phase,
followed by onsite implementation. With the help of TIV’s Global
Delivery Model, software project costs of its clients worldwide can be
reduced by about 50% without having to compromise on absolute quality
and delivery schedules. The projects are executed on Fixed-Price or
Time  Material basis, depending upon the nature of each project.
Internet marketing is the origin link building for any quality
Internet marketing operation. We Build Pages views links as “votes”
for your website, justification from the Internet society that your
website and associated services and resources are valuable. The
additional links, the more popular the website, and the higher it will
rank in the search engines; but there is a catch, not all votes are
the same. The more authoritative the site that links to another site,
the more “votes” its worth. We Build Pages targets the most
authoritative sites to ensure that your link building efforts get the
most bang for your buck. We all want more traffic, and more
importantly, we want that traffic to turn into customers. With this
common goal in mind, We Build Pages is dedicated to providing our
clients with the tools and feedback to make your website and services
successful.
Search engine optimization is the permanent performance of civilizing
search engine position of a website. We Build Pages Internet Marketing
Services believes that by growing traffic to a website using link
building services, proactive Internet marketing, and original SEO
content creation to improve search engine positioning. With the latest
organic link building services, We Build Pages provides the most
significant and modified SEO services accessible.
Web design and web application development is a complex process that
requires a extensive range of creative, business and technical skills.
Good design must impressively communicate key marketing messages and
well as providing simple intuitive navigation. In web development
felid, we have successfully established ourselves in providing high
quality web design and web development from our wide range and verity
to our client all around the world.  The design also lays down a
sequence of “calls to action” designed to engage and facilitate the
business process.
TheitValley is the biggest and largest providing complete Google
advertising solution after Google. The first and foremost priority of
the TIV is to attain the customer objective without any compromise.
The work procedure of the TIV is planning and analysis, user interface
design, project management, documentation, onsite testing,
implementation, post implementation, warranty support achieving the
goal with effectively and efficiently work. http://www.theitvalley.com/seo.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Lisp refactoring puzzle

2011-07-12 Thread Neil Cerutti
On 2011-07-12, Petter Gustad newsmailco...@gustad.com wrote:
 Xah Lee xah...@gmail.com writes:

 it's funny, in all these supposedly modern high-level langs, they
 don't provide even simple list manipulation functions such as union,
 intersection, and the like. Not in perl, not in python, not in lisps.

 In Common Lisp you have:

 CL-USER (union '(a b c) '(b c d))
 (A B C D)
 CL-USER (intersection '(a b c) '(b c d))
 (C B)

What's the rationale for providing them? Are the definitions
obvious for collections that a not sets?

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


Re: Lisp refactoring puzzle

2011-07-12 Thread WJ
Petter Gustad wrote:

 Xah Lee xah...@gmail.com writes:
 
  it's funny, in all these supposedly modern high-level langs, they
  don't provide even simple list manipulation functions such as union,
  intersection, and the like. Not in perl, not in python, not in lisps.
 
 In Common Lisp you have:
 
 CL-USER (union '(a b c) '(b c d))
 (A B C D)
 CL-USER (intersection '(a b c) '(b c d))
 (C B)

The order was changed.

COBOL Lisp is always mindless.


* (union '(2 2 3 4) '(7 7 8 9))

(4 3 2 2 7 7 8 9)


The right way (MatzLisp):

[2,2,3,4] | [7,7,8,9]
==[2, 3, 4, 7, 8, 9]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Wizard, with apologies to The Who

2011-07-12 Thread Phlip
 That's pretty funny.  I knew what it would be even when I saw the cut-off 
 subject line, and I am too young to remember it.

 Carl Banks

TTTO [She put the lime in the] Coconut:

  Brother wrote a database, he finish it on time
  His sister add requirements, refactor every line
  She change design in the database, she mix it all up
  She change design in the database, she mix it all up
  She change design in the database, she mix it all up
  She change design in that database, she called the doctor, woke him
up,

  Sayin' Doctor, now I got to pay my dues,
  I say, Doctor, to debug away my blues,
  I say, Doctor, such a big change has to break,
  I say, Doctor! I must'a made a bug mistake!

  Now let me get this straight,
  You change the design in the database, mix things all up
  You change the design in the database, mix it all up,
  You change the design in the database, mix it all up...

http://c2.com/cgi/wiki?SheChangeDesignInTheDatabase
-- 
http://mail.python.org/mailman/listinfo/python-list


Building Python 2.5.6 on Ubuntu Natty

2011-07-12 Thread Ricardo Bánffy
Hi folks.

Has anyone succeeded in building Python 2.5.6 from sources in Ubuntu Natty?
I installed all the build dependencies and keep getting

running build_ext
/usr/include/sqlite3.h: version 3.7.4
Traceback (most recent call last):
  File ./setup.py, line 1545, in module
main()
  File ./setup.py, line 1540, in main
'Lib/smtpd.py']
  File /tmp/Python-2.5.6/Lib/distutils/core.py, line 151, in setup
  File /tmp/Python-2.5.6/Lib/distutils/dist.py, line 974, in run_commands
  File /tmp/Python-2.5.6/Lib/distutils/dist.py, line 994, in run_command
  File /tmp/Python-2.5.6/Lib/distutils/command/build.py, line 112, in run
  File /root/Python-2.5.6/Lib/cmd.py, line 333, in run_command
del help[cmd]
  File /tmp/Python-2.5.6/Lib/distutils/dist.py, line 994, in run_command
  File /tmp/Python-2.5.6/Lib/distutils/command/build_ext.py, line 290, in
run
  File ./setup.py, line 97, in build_extensions
self.detect_modules()
  File ./setup.py, line 810, in detect_modules
sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))]
  File /root/Python-2.5.6/Lib/posixpath.py, line 119, in dirname
return split(p)[0]
  File /root/Python-2.5.6/Lib/posixpath.py, line 77, in split
i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'
make: *** [sharedmods] Error 1

when I do make test and

Compiling /opt/python2.5/lib/python2.5/zipfile.py ...
make: *** [libinstall] Error 1

when I do make install

Any ideas?

-- 
Ricardo Bánffy
http://www.dieblinkenlights.com
http://twitter.com/rbanffy
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Enhanced dir() function

2011-07-12 Thread Ethan Furman

Ethan Furman wrote:

Tim Chase wrote:
If it came in as an effortless (i.e. O(1) where I do it once and never 
again; not an O(n) where n=the number of times I invoke Python) 
default replacement for dir(), I'd reach for it a lot more readily.  I 
seem to recall there's some environment-var or magic file-name that 
gets sourced on every startup.


interact.py
8---
import os, sys
sys.ps1 = '-- '

from cookbook.utils import dir  # or whereever you keep your copy
sys.modules['__builtin__'].dir = dir
8---



Imagine my amusement when I went to change an environment variable today 
and found:


PYTHONSTARTUP=c:\python25\interact.py

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


Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread rantingrick
On Jul 12, 1:43 pm, CM cmpyt...@gmail.com wrote:
   One reason there hasn't been much demand for a GUI builder is that, in
   many cases, it's just as simpler or simpler to code a GUI by hand.

 I use a GUI builder because I'd rather click less than
 type more. I just tried that in Boa Constructor; with ~10
 mouse clicks I produced 964 characters of Python code.

Remember, it's NOT the length of the code that matters, no, it's the
motion of the sources ocean. Did it produce rough seas full of
spaghetti monsters? Or tranquil fjords worth pining over (sadly to
death apparently?)?

 1. Never judge the quality of code simply by it's length. Because if
you do, some folks might suffer from source envy!

Also, you MAY have created 964 chars of code with your ten or so
clicks HOWEVER that is just template code. You'll need to set many
attributes for the widgets before they are ready for prime time. Your
supposed ten or so click estimate is very naive. It takes MUCH more
to create even a simple GUI, because, we have NOT even discussed logic
yet!

 Now, sure, depending on how I wrote the code I could do
 better than that, but for me, I just find it more
 intuitive and easier to use a GUI to make a GUI.

Personal opinions should always be respected, and as such i respect
yours but later i would outline my GUI design workflow so pay close
attention.

  Often a GUI builder is used as a bad replacement for
  sketch-pad and pencil.

 I would use a sketch-pad and pencil and *then* use the GUI builder.

But do you really? Your following statements lead me to believe that
you don't.

 What's nice about a builder is one can move things around
 quickly and see the results in the real application, which
 one can never really see well on a paper sketch. 

I prefer to skip any pencil and paper completely myself. I just use my
imagination. UNLESS the GUI is EXTREMELY complicated. For me the
design of a GUI starts in my brain. No pencil, no paper, no three
hours using Auto Cad GUI designer. Next i start creating widgets and
laying them out using geometry managers (in CODE). Finally i run a few
tests, make a few changes, and design phase is over. Time for logic.

-
My argument against GUI builders is two fold.
-

 1. GUI builders remove us from the initial mental design phase and
temp us to let our inner click-ity-click and drag-ity-drag child
loose. This inner child likes to play but he hates to plan. Very soon
he has the play room floor (source code) overflowing with toys (code)
arranged in a completely haphazard way. Unlike the child however,
there is no code mommy to spank this bad little boy when he is a
programmer. So he just keeps messing up play room after play room
making a complete fool of himself along the way.

 2. GUI builders remove us from the source code. When you are playing
clicky-click with yourself you could be in the trenches fighting the
spaghetti code monster. Instead you are losing mental focus. Remember,
playing with yourself makes you lazy!
--

What happens is... you get lost playing and fail to keep your mental
focus. A programmers metal focus is his most valuable weapon in the
fight against the spaghetti code monster. I am a programmer. I love my
source code more than i love most people in this world. I do not want
to be away from my source. I am jealous of my source! And so too
should you be.

Kevin made the argument earlier that Tkinter (and others) are so easy
to use that they render needing a GUI builder useless -- and he is
correct! But did you know that there are GUI libraries EVEN more
highly abstracted than Tkinter? Oh yes! So your OMG, this typing and
using my imagination is so difficult *crap* is really making me
laugh.

That is my argument people. Opinions may vary. Keep watch for the
spaghetti code monster!
Cheers folks.

PS: if you don't like to type, programming IS NOT the best career (or
hobby) choice for you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Set run vars with each call

2011-07-12 Thread Ben Finney
Gnarlodious gnarlodi...@gmail.com writes:

 OK, [the ‘__init__’ method] sets a value at init time. But is there a
 similar built-in to run whenever the class instance is called?

You can write a ‘__call__’ method which will be called when the instance
is called.

But I suspect that's still not what you're asking.

Maybe it will be quicker to ask: What is it you want to achieve?

-- 
 \  “Compulsory unification of opinion achieves only the unanimity |
  `\of the graveyard.” —Justice Roberts in 319 U.S. 624 (1943) |
_o__)  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Enhanced dir() function

2011-07-12 Thread rantingrick
On Jun 30, 11:29 pm, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info wrote:
 The dir() function is designed for interactive use, inspecting objects for
 the names of attributes and methods.

 Here is an enhanced version that allows you to pass a glob to filter the
 names you see:

meh,

I have always believed in keeping my namespace squeaky clean so i
never have this problem. Modules like Tkinter (where you yourself have
supported the global import!) i always import as tk. I think this IS
more a housekeeping issue than a nail on patch issue.

PS: However pay attention because i have some interesting ideas about
dir culling in my next post to this thread.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Enhanced dir() function

2011-07-12 Thread rantingrick
On Jul 1, 12:20 pm, Tim Chase python.l...@tim.thechases.com wrote:

 If it came in as an effortless (i.e. O(1) where I do it once and
 never again; not an O(n) where n=the number of times I invoke
 Python) default replacement for dir(), I'd reach for it a lot
 more readily.  I seem to recall there's some environment-var or
 magic file-name that gets sourced on every startup.

 I use the list-comp version on a regular basis:

I strongly agree with this statement because i prefer the LC myself.
HOWEVER i've always lamented the verbosity of dir().
---
 Case in Point
---
 dir([])
['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
'__delslice__', '__doc__', '__eq__', '__format__', '__ge__',
'__getattribute__', '__getitem__', '__getslice__', '__gt__',
'__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__',
'__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__reversed__', '__rmul__',
'__setattr__', '__setitem__', '__setslice__', '__sizeof__', '__str__',
'__subclasshook__', 'append', 'count', 'extend', 'index', 'insert',
'pop', 'remove', 'reverse', 'sort']
---

Do we really need to see all the built in methods EVERY time? I don't,
i've had them memorized for years. HOWEVER i do understand the fact
that n00bs need to see them every time. So why should old hats need to
type this every time...

 [x for x in dir([]) if not x.startswith('_')]
['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
'reverse', 'sort']

Because we have plenty of room for args in this function...

 dir(verbose=False)
['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
'reverse', 'sort']

Ahhh, i love it when a plan comes together!
-- 
http://mail.python.org/mailman/listinfo/python-list


Installing PyPy alongside Python 2.7 on Windows?

2011-07-12 Thread Ben Sizer
I'd like to evaluate the recent build of PyPy on the project I'm
currently working on, but am not sure how best to go about it. So my
question is simply - how would I go about installing PyPy alongside
Python 2.7 on Windows? In particular, unzipping PyPy and adding it to
the PATH is easy enough, but what about getting setuptools and
easy_setup working to install various packages for it? Is there a
virtualenv-based method I can use here? (And is pip a decent
replacement for setuptools on Windows yet?)

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


Re: Python Wizard, with apologies to The Who

2011-07-12 Thread Ethan Furman

John Keisling wrote:

After too much time coding Python scripts and reading Mark Lutz's
Python books, I was inspired to write the following lyrics. For those
too young to remember, the tune is that of Pinball Wizard, by The
Who. May it bring you as much joy as it brought me!



Absolutely hilarious!  Thanks!

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


Re: Lisp refactoring puzzle

2011-07-12 Thread Pascal J. Bourguignon
Neil Cerutti ne...@norwich.edu writes:

 What's the rationale for providing them? Are the definitions
 obvious for collections that a not sets?

The rational is to prove that Xah is dumb.

-- 
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to write a file generator

2011-07-12 Thread Thomas Rachel

Am 12.07.2011 16:46 schrieb Billy Mays:

I want to make a generator that will return lines from the tail of
/var/log/syslog if there are any, but my function is reopening the file
each call


...

I have another solution: an object which is not an iterator, but an 
iterable.


class Follower(object):
def __init__(self, file):
self.file = file
def __iter__(self):
while True:
l = self.file.readline()
if not l: return
yield l

if __name__ == '__main__':
f = Follower(open(/var/log/messages))
while True:
for i in f: print i,
print foo
import time
time.sleep(4)

Here, you iterate over the object until it is exhausted, but you can 
iterate again to get the next entries.



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


Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread CM
On Jul 12, 5:18 pm, rantingrick rantingr...@gmail.com wrote:
 On Jul 12, 1:43 pm, CM cmpyt...@gmail.com wrote:

One reason there hasn't been much demand for a GUI builder is that, in
many cases, it's just as simpler or simpler to code a GUI by hand.

  I use a GUI builder because I'd rather click less than
  type more. I just tried that in Boa Constructor; with ~10
  mouse clicks I produced 964 characters of Python code.

 Remember, it's NOT the length of the code that matters, no, it's the
 motion of the sources ocean. Did it produce rough seas full of
 spaghetti monsters? Or tranquil fjords worth pining over (sadly to
 death apparently?)?

In my experience, the GUI builder I use creates reasonable code
that deals with the GUI in a separate portion of the code.  It does
not strike me as spaghetti-ish (though it's not perfect).

 Also, you MAY have created 964 chars of code with your ten or so
 clicks HOWEVER that is just template code. You'll need to set many
 attributes for the widgets before they are ready for prime time. Your
 supposed ten or so click estimate is very naive. It takes MUCH more
 to create even a simple GUI, because, we have NOT even discussed logic
 yet!

Sure.  But my point was just that to even get as far as I did (which
was
just a frame and two unspecified widgets) takes 964+ keystrokes, but
only ~10 clicks.  So the pacing of keystrokes:clicks is favorable.
If I built a small functioning GUI application, it  might take 100
clicks
and 9,640 keystrokes (very roughly).  But it is the same point.

  I would use a sketch-pad and pencil and *then* use the GUI builder.

 But do you really? Your following statements lead me to believe that
 you don't.

  What's nice about a builder is one can move things around
  quickly and see the results in the real application, which
  one can never really see well on a paper sketch. 

I just meant that though I might start on paper, once it is on
the screen I sometimes will shift things around a bit at that point
to see how it looks.  This is easily done with sizers and a sizer
collection manager and an up/down arrow, so it is worth an
extra minute to just see how it looks.

  1. GUI builders remove us from the initial mental design phase and
 temp us to let our inner click-ity-click and drag-ity-drag child
 loose. This inner child likes to play but he hates to plan. Very soon
 he has the play room floor (source code) overflowing with toys (code)
 arranged in a completely haphazard way. Unlike the child however,
 there is no code mommy to spank this bad little boy when he is a
 programmer. So he just keeps messing up play room after play room
 making a complete fool of himself along the way.

  2. GUI builders remove us from the source code. When you are playing
 clicky-click with yourself you could be in the trenches fighting the
 spaghetti code monster. Instead you are losing mental focus. Remember,
 playing with yourself makes you lazy!

I've certainly heard of others who feel that working with only code
is cleaner for them, mentally speaking.  I can understand that.  I
think it just depends on what one is used to.  I don't find the GUI
builder disrupts my ability to plan or keep things orderly.  In fact,
most of my disorder and spaghetti problems have been in the logic
side of the applications, the part which the GUI builder doesn't have
anything to do with.  (That's my own issue to keep working on).

 Kevin made the argument earlier that Tkinter (and others) are so easy
 to use that they render needing a GUI builder useless -- and he is
 correct! But did you know that there are GUI libraries EVEN more
 highly abstracted than Tkinter? Oh yes! So your OMG, this typing and
 using my imagination is so difficult *crap* is really making me
 laugh.

My attitude is, if I could speak in English to an AI to tell it what
I'd like
the program to do, I'd do it. Yes, since I can't do that, I inevitably
do
sometimes enjoy puzzling things out, but only because I have to.

 PS: if you don't like to type, programming IS NOT the best career (or
 hobby) choice for you.

I guess it is not so much that I dislike typing, as I dislike having
to
switch from visual mode to code mode, remember the keywords and
such for the widgets, rather than quickly clicking around.  The
keystroke count is really just a proxy for that sort of effort.

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


Re: Set run vars with each call

2011-07-12 Thread Steven D'Aprano
Gnarlodious wrote:

 Question. Is there a special method or easy way to set default values
 with each call to an instance? Any ideas to make it easier? What I
 want to do is have a constantly updating set of values which can be
 overridden. Just thought there was an easy way to set that up.

All the words are in English, but the sentences make no sense :)

Seriously, I don't understand what you mean. Call to an instance? Do mean
treating instances as a callable (like a function), or do you mean calling
an arbitrary method?

To make an instance itself callable, define a __call__ method.

What do you mean, constantly updating set of values that can be
overridden? Perhaps a simple example might help.

The closest thing I can think of, might be: you want to store a data
attribute in an instance, and use that if the caller doesn't specify
differently. Something like:

class Parrot:
name = Polly
def speak(self, name=None):
if name is None:
name = self.name
print(%s wants a cracker! % name)

And in use:

 p = Parrot()
 p.speak()
Polly wants a cracker!
 p.speak(Peter)
Peter wants a cracker!
 p.name = Penelope
 p.speak()
Penelope wants a cracker!



If None is a legitimate value, then you can define your own sentinel to use
instead:

MISSING = object()  # Unique object guaranteed not to be used by the caller.
# (Guarantee void on planet Earth.)

then replace None by MISSING in the code above.

Is this the sort of scenario you are talking about? If not, I'm completely
lost.


-- 
Steven

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


mrjob v0.2.7 released

2011-07-12 Thread Jimmy Retzlaff
What is mrjob?
-
mrjob is a Python package that helps you write and run Hadoop Streaming
jobs.

mrjob fully supports Amazon's Elastic MapReduce (EMR) service, which allows
you to buy time on a Hadoop cluster on an hourly basis. It also works with
your own Hadoop cluster.

Some important features:

 * Run jobs on EMR, your own Hadoop cluster, or locally (for testing).
 * Write multi-step jobs (one map-reduce step feeds into the next)
 * Duplicate your production environment inside Hadoop
   * Upload your source tree and put it in your job's $PYTHONPATH
   * Run make and other setup scripts
   * Set environment variables (e.g. $TZ)
   * Easily install python packages from tarballs (EMR only)
   * Setup handled transparently by mrjob.conf config file
 * Automatically interpret error logs from EMR
 * SSH tunnel to hadoop job tracker on EMR
 * Minimal setup
   * To run on EMR, set $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY
   * To run on your Hadoop cluster, install simplejson and make sure
$HADOOP_HOME is set.

More info:

 * Install mrjob: python setup.py install
 * Documentation: http://packages.python.org/mrjob/
 * PyPI: http://pypi.python.org/pypi/mrjob
 * Development is hosted at github: http://github.com/Yelp/mrjob


What's new?
-
Big thank you to Yelp intern Steve Johnson, who wrote the majority of the
code for this release. Wahbeh Qardaji, another Yelp intern, contributed as
well, and has been working hard on features for v0.3.0.

v0.2.7, 2011-07-12 -- Hooray for interns!
 * All runner options can be set from the command line (Issue #121)
  * Including for mrjob.tools.emr.create_job_flow (Issue #142)
 * New EMR options:
  * availability_zone (Issue #72)
  * bootstrap_actions (Issue #69)
  * enable_emr_debugging (Issue #133)
 * Read counters from EMR log files (Issue #134)
 * Clean old files out of S3 with mrjob.tools.emr.s3_tmpwatch (Issue #9)
 * EMR parses and reports job failure due to steps timing out (Issue #15)
 * EMR boostrap files are no longer made public on S3 (Issue #70)
 * mrjob.tools.emr.terminate_idle_job_flows handles custom hadoop streaming
  jars correctly (Issue #116)
 * LocalMRJobRunner separates out counters by step (Issue #28)
 * bootstrap_python_packages works regardless of tarball name (Issue #49)
 * mrjob always creates temp buckets in the correct AWS region (Issue #64)
 * Catch abuse of __main__ in jobs (Issue #78)
 * Added mr_travelling_salesman example
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Wizard, with apologies to The Who

2011-07-12 Thread Steven D'Aprano
John Keisling wrote:

 After too much time coding Python scripts and reading Mark Lutz's
 Python books, I was inspired to write the following lyrics. For those
 too young to remember, the tune is that of Pinball Wizard, by The
 Who. May it bring you as much joy as it brought me!
[...]


I wouldn't know a good song parody if it kicked me in the head, but my wife
is a (retired) professional musician with a history of writing parodies.
She's not impressed by the work of most filk singers and supposed
parodies, most of which are seventeen kinds of crap... but she gives you
full marks. And trust me on this, she does not give compliments lightly.

She says you got the rhyming scheme and number of syllables spot on.
Technically, That modeling and sim guy needs to be slurred to make it
fit, That mod'ling and sim guy, but that's acceptable.

(Most parodies get the syllable count wrong -- if a lyric goes
dum-de-dum-de-dum, the parody ends up like dum-dum-de-dum-de-dum or
dum-de-dum-de.)

Have a +1 from me and the missus.



-- 
Steven

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


Re: Lisp refactoring puzzle

2011-07-12 Thread Gregory Ewing

Xah Lee wrote:

they
don't provide even simple list manipulation functions such as union,
intersection, and the like. Not in perl, not in python, not in lisps.


Since 2.5 or so, Python has a built-in set type that
provides these (which is arguably a better place for them
than lists).

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


Re: Lisp refactoring puzzle

2011-07-12 Thread Roy Smith
In article 4e1cf936.4050...@canterbury.ac.nz,
 Gregory Ewing greg.ew...@canterbury.ac.nz wrote:

 Xah Lee wrote:
  they
  don't provide even simple list manipulation functions such as union,
  intersection, and the like. Not in perl, not in python, not in lisps.
 
 Since 2.5 or so, Python has a built-in set type that
 provides these (which is arguably a better place for them
 than lists).

Set is the best addition to Python since string methods.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Set run vars with each call

2011-07-12 Thread Gnarlodious
On Jul 12, 6:44 pm, Steven D'Aprano wrote:

 All the words are in English, but the sentences make no sense :)
LOL, impressive powers of mind-reading! Exactly what I needed:

import time
class Event:
epoch=time.time()
def doSomething(self, epoch=None):
if epoch is None:
epoch = self.epoch
print(epoch)

e = Event()
e.doSomething()
e.doSomething(123456789)
e.epoch = 1310522110.404471
e.doSomething()

Thanks for the help!

-- Gnarlie
http://Gnarlodious.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Enhanced dir() function

2011-07-12 Thread Chris Angelico
On Wed, Jul 13, 2011 at 7:46 AM, rantingrick rantingr...@gmail.com wrote:
 [x for x in dir([]) if not x.startswith('_')]
 ['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
 'reverse', 'sort']

 Because we have plenty of room for args in this function...

 dir(verbose=False)
 ['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
 'reverse', 'sort']


#define my_dir(o,verbose) verbose?dir(o):[x for x in dir(o) if not
x.startswith('_')]

And there you are, out of your difficulty at once. Granted, you now
have to run your code through cpp, but is that so big a problem?

ChrisA
(For the sarcasm-impaired: I am NOT advocating this.)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Lisp refactoring puzzle

2011-07-12 Thread Terry Reedy

On 7/12/2011 2:23 PM, gene heskett wrote:


Now, I hate to mention it Terry, but your clock seems to be about 126
months behind the rest of the world.


Please do not hate to be helpful. It was a bad malfunction perhaps due 
to a run-down battery on a machine turned off for two weeks. I will keep 
watch to see if it happens again overnight.




Does your system not run ntpd by default?


Is that *nix or Windows? My XP system only checks the net time 
automatically once a week and refused to update at first on request 
because the dates did not match. Typically windows stupidity. If I click 
'Update from internet', it should believe that I really mean it.


--
Terry Jan Reedy

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


Re: Lisp refactoring puzzle

2011-07-12 Thread rusi
On Jul 13, 9:39 am, Terry Reedy tjre...@udel.edu wrote:
 On 7/12/2011 2:23 PM, gene heskett wrote:

  Now, I hate to mention it Terry, but your clock seems to be about 126
  months behind the rest of the world.

 Please do not hate to be helpful.

Ha Ha. Cute one. Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Virtual functions are virtually invisible!

2011-07-12 Thread alex23
rantingrick rantingr...@gmail.com wrote:
 i cannot force others

If only you really understood that.
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue12531] documentation index entries for * and **

2011-07-12 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
nosy: +eli.bendersky

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12531
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12522] Implement `os.startfile` under Linux and Mac

2011-07-12 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12522
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12539] multiprocessing.Event.wait(n) doesn't time out properly

2011-07-12 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

Are you using a 2.6.38 kernel?
There was a regression in early 2.6.38 kernels that caused FUTEX_WAIT with a 
timeout to never return after a suspend-resume, see:
https://lkml.org/lkml/2011/4/13/23

It's been fixed by this commit:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0cd9c6494ee5c19aef085152bc37f3a4e774a9e1

Could you try with a more recent kernel (it should be fixed in 2.6.38.4)?

--
nosy: +neologix

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12539
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12436] Provide reference to detailed installation instructions

2011-07-12 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Nice, I didn't know we have those comprehensive using docs. However, they 
should be linked from http://docs.python.org/dev/tutorial/interpreter.html 
(definitely inline and perhaps a see also).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12436
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12535] Chained tracebacks are confusing because the first traceback is minimal

2011-07-12 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

The ordering is as it is so that the last line in the displayed traceback 
corresponds to the exception that was actually caught. That is, the last line 
remains the same regardless of whether or not there was an earlier exception in 
the chain. Without that, the caught exception would be buried in the middle of 
a wall of text:

Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/rdmurray/python/email6/Lib/mailbox.py, line 1631, in set_flags
self.replace_header('Status', status_flags)
  File /home/rdmurray/python/email6/Lib/email/message.py, line 495, in 
replace_header
print('rep', self.header_factory)
  File /home/rdmurray/python/email6/Lib/email/message.py, line 469, in 
__getattr__
self.__class__.__name__, key))
AttributeError: 'mboxMessage' object has no attribute 'header_factory'
CAUGHT THIS
This exception was caught while handling:
Traceback (most recent call last):
  File /home/rdmurray/python/email6/Lib/email/message.py, line 466, in 
__getattr__
return getattr(self._headers, key)
AttributeError: '_Header_List' object has no attribute 'header_factory'
NOT THIS

The consequence is that the outermost call in the call stack ends up buried in 
the middle of a wall of text instead. That's not optimal either, but we have to 
choose one or the other and I think the status quo is the better choice.

However, not closing this yet, as I think RDM may have a valid point: should we 
put something at the *start* of the truncated traceback to indicate that it was 
cut short due to another exception? For example:

Traceback (truncated due to later exception, most recent call last):
  File /home/rdmurray/python/email6/Lib/email/message.py, line 466, in 
__getattr__
return getattr(self._headers, key)
AttributeError: '_Header_List' object has no attribute 'header_factory'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/rdmurray/python/email6/Lib/mailbox.py, line 1631, in set_flags
self.replace_header('Status', status_flags)
  File /home/rdmurray/python/email6/Lib/email/message.py, line 495, in 
replace_header
print('rep', self.header_factory)
  File /home/rdmurray/python/email6/Lib/email/message.py, line 469, in 
__getattr__
self.__class__.__name__, key))
AttributeError: 'mboxMessage' object has no attribute 'header_factory'

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12535
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4376] Nested ctypes 'BigEndianStructure' fails

2011-07-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Is there a unit test about the actual feature: that the bytes are actually 
swapped in the structure?

For example, with a
class T(BigEndianStructure): _fields_ = [(a, c_int), (b, c_int)]
cast a pointer to T into a pointer to c_int, and read the values.

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4376
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12539] multiprocessing.Event.wait(n) doesn't time out properly

2011-07-12 Thread mokrates

mokrates mmo...@gmx.net added the comment:

 Are you using a 2.6.38 kernel?

Yes

 There was a regression in early 2.6.38 kernels that caused FUTEX_WAIT
 with a timeout to never return after a suspend-resume, see:
 https://lkml.org/lkml/2011/4/13/23

Ah, thank you, that explains why gajim has problems too...

  Could you try with a more recent kernel (it should be fixed in
 2.6.38.4)?

I will, when it comes with my ubuntu... Thank you very much.

mo

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12539
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12540] Restart Shell command leaves pythonw.exe processes running

2011-07-12 Thread Peter Caven

New submission from Peter Caven pca...@gmail.com:

On Windows Vista (x64) the IDLE Restart Shell command leaves a pythonw.exe 
process running each time that the command is used.
Observed in Python 3.2.1 release and RC2.

--
components: IDLE
messages: 140179
nosy: Peter.Caven
priority: normal
severity: normal
status: open
title: Restart Shell command leaves pythonw.exe processes running
type: resource usage
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12540
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12485] textwrap.wrap: new argument for more pleasing output

2011-07-12 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12485
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12219] tkinter.filedialog.askopenfilename XT dialog on Windows 7

2011-07-12 Thread digi proc

digi proc grant...@gmail.com added the comment:

Almost certainly a tkinter bug.

A work around is below. First build a DLL from the following C++ source (and 
add a similar function for the 'save' dlg rather than the 'open' dlg):

#include windows.h
#include Commdlg.h
#include tchar.h

extern C{

 __declspec(dllexport)  wchar_t * _cdecl GetOpenFileNamePlus(HWND 
Parent,LPCWSTR InitDir,LPCWSTR FilenameIn,LPCWSTR Filter,LPCWSTR DefExt,LPCWSTR 
Title)
{
OPENFILENAME OpenFile;

//  MessageBox(NULL,Title,L,MB_OK);

memset (OpenFile, 0, sizeof(OPENFILENAME));

static wchar_t Filename[MAX_PATH*2];

_tcscpy(Filename,FilenameIn);

OpenFile.lpstrInitialDir=InitDir;
OpenFile.lStructSize = sizeof(OPENFILENAME);
OpenFile.hwndOwner = Parent;
OpenFile.lpstrFile = Filename;
OpenFile.nMaxFile = MAX_PATH*2+10;
OpenFile.lpstrFilter = Filter;
OpenFile.nFilterIndex = 0;
OpenFile.lpstrDefExt=DefExt;
OpenFile.lpstrTitle = Title;

OpenFile.Flags=OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | 
OFN_NOCHANGEDIR;

long Stat=GetOpenFileName(OpenFile);

if(Stat)
return Filename;
else
return NULL;
}


}

Then in python call it like this, for example:

import ctypes

commdlg=ctypes.windll.commdlg_plus
commdlg.GetOpenFileNamePlus.argtypes= [ctypes.c_void_p, ctypes.c_wchar_p, 
ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_wchar_p]
commdlg.GetOpenFileNamePlus.restype= ctypes.c_wchar_p
s=commdlg.GetOpenFileNamePlus(0, StartDir, DefFilename, Text 
files\0*.txt\0Image files\0*.jpg;*.gif\0\0,txt, Select a file)

--
nosy: +digiproc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12219
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12219] tkinter.filedialog.askopenfilename XT dialog on Windows 7

2011-07-12 Thread digi proc

digi proc grant...@gmail.com added the comment:

By the way, that above C++ function is not re-entrant! I was lazy and just made 
a static return buffer. To make it re-entrant, you'd need to figure out how to 
allocate enough space in the DefFile string so the C function could write the 
selected filename to that buffer instead of making its own.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12219
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8668] Packaging: add a 'develop' command

2011-07-12 Thread higery

higery shoulderhig...@gmail.com added the comment:


 ** After the package has been installed in-place (using the develop
 command), how does one identify it as an in development project (or in
 development mode)? -- Case 3 and 6 touch on this topic (case 3 is a little
 vague at this time), but doesn't explain what type of action is intended. So
 if we install in-place (aka, develop), how does the python interpreter find
 the package? Are we using PYTHONPATH at this point (which would be
 contradict a requirement in  case 6)?


There is an .egg-link file that will be used by pkg_resources to find the
develop-installed packages, so my current implementation of develop command
in packaging module also adds a .distinfo-link file in the site-packages
which will be used to identify a project is installed in development mode or
not.

--
Added file: http://bugs.python.org/file22628/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8668
___div class=gmail_quoteblockquote class=gmail_quote style=margin: 0pt 0pt 
0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;

** After the package has been installed in-place (using the develop command), 
how does one identify it as an in development project (or in development mode)? 
-- Case 3 and 6 touch on this topic (case 3 is a little vague at this time), 
but doesn#39;t explain what type of action is intended. So if we install 
in-place (aka, develop), how does the python interpreter find the package? Are 
we using PYTHONPATH at this point (which would be contradict a requirement in 
 case 6)?br
/blockquotedivbrThere is an .egg-link file that will be used by 
pkg_resources to find the develop-installed packages, so my current 
implementation of develop command in packaging module also adds a 
.distinfo-link file in the site-packages which will be used to identify a 
project is installed in development mode or not.br
/div/divbr
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9254] __import__ docstring should recommend importlib.import_module()

2011-07-12 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

The docstring of __import__ was updated to mention importlib in 3d490c3a019e, 
for #7397.  Attached patch edits the docs.

--
keywords: +patch
versions:  -Python 3.1
Added file: http://bugs.python.org/file22629/__import__-mention-importlib.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9254
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8668] Packaging: add a 'develop' command

2011-07-12 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


Removed file: http://bugs.python.org/file22628/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8668
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8668] Packaging: add a 'develop' command

2011-07-12 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

For now, you should not worry about pkg_resources.  Write a simple 
pure-packaging implementation compatible with packaging; the setuptools and 
distribute developers will see if they want to add forward compatibility with 
our system.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8668
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12539] multiprocessing.Event.wait(n) doesn't time out properly

2011-07-12 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

 Are you using a 2.6.38 kernel?

 Yes

Alright, closing as invalid then.

--
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12539
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8668] Packaging: add a 'develop' command

2011-07-12 Thread higery

higery shoulderhig...@gmail.com added the comment:

2011/7/12 Michael Mulich rep...@bugs.python.org


 Michael Mulich michael.mul...@gmail.com added the comment:

 The wiki page has been edited to note what the develop command will
 write to the file system. I'll restate it here as well...

 The develop command writes three pieces of information to the filesystem:
  1. It calls upon the build action(s) to build the package relative to
 the package's root directory.
  2. It calls the [build|install]_distinfo action to write the
 .dist-info metadata inside the build directory. (see also Issue 12279)
  3. It adds the build directory's path to a .pth file.


You are right, what you listed above are also the things done by the
'develop' command of my current implementation. In addition, as I replied
earlier, we can also add a .distinfo-link file  more than the .pth file.

--
Added file: http://bugs.python.org/file22630/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8668
___brdiv class=gmail_quote2011/7/12 Michael Mulich span dir=ltrlt;a 
href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;/spanbrblockquote
 class=gmail_quote style=margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid 
rgb(204, 204, 204); padding-left: 1ex;
br
Michael Mulich lt;a 
href=mailto:michael.mul...@gmail.com;michael.mul...@gmail.com/agt; added 
the comment:brbr
The wiki page has been edited to note what the develop command willbr
write to the file system. I#39;ll restate it here as well...br
br
The develop command writes three pieces of information to the filesystem:br
 1. It calls upon the build action(s) to build the package relative tobr
the package#39;s root directory.br
 2. It calls the [build|install]_distinfo action to write thebr
.dist-info metadata inside the build directory. (see also Issue 12279)br
 3. It adds the build directory#39;s path to a .pth 
file.br/blockquotedivbrYou are right, what you listed above are also 
the things done by the #39;develop#39; command of my current implementation. 
In addition, as I replied earlier, we can also add a .distinfo-link file  more 
than the .pth file.br
/div/div
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7559] TestLoader.loadTestsFromName swallows import errors

2011-07-12 Thread Alex Garel

Alex Garel alex.ga...@gmail.com added the comment:

May I just add that I also ran into this and give my +1 for any fix :-)

--
nosy: +alexgarel

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7559
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8668] Packaging: add a 'develop' command

2011-07-12 Thread higery

Changes by higery shoulderhig...@gmail.com:


Removed file: http://bugs.python.org/file22630/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8668
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12279] Add build_distinfo command to packaging

2011-07-12 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 So if we include the RECORD file (point number 2) without the checksum
 and size (two columns in the RECORD csv format),
Well, three columns, the last one being empty.

 we will still be PEP376 valid (maybe?), but the file verification
 information will be missing. And we don't really want this
 information because if we edit a file, the checksum and size will be
 incorrect anyhow. This missing information is not important when
 using the develop or test commands, because we are running the
 commands on a trusted local copy.
Good thinking.

 What are the consequences of not writing the checksum or size to the
 RECORD file? And does that solve the issue?
I think checksum was intended for use by uninstallers, so we’re good.  I don’t 
know why the size is included.


 I don't really think the invalid PEP 376 issue is a problem: PEP
 376 describes the metadata for installed distributions; it has
 nothing to say about built metadata for a distribution which has not
 yet been installed.
The problem is that develop is a kind of install.

 For purposes of the develop command, if a pth file is used to
 implement develop, then ideally when develop is run a RECORD file
 would be added containing only the path to that pth file, as thats
 the only file that has actually been installed
Yeah!

 (and the only one that should be removed if the develop-installed
 package is uninstalled).
Are you saying that such a RECORD file would allow any installer compatible 
with PEP 376 to undo a develop install?  Clever!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12279
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3565] array documentation, method names not 3.x-compliant

2011-07-12 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

It was Antoine in fa8b57f987c5, for #8990.

--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3565
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10968] threading.Timer should be a class so that it can be derived

2011-07-12 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Attached patch removes the indirection functions; the _Verbose shenanigans are 
left alone.  The test suite passes; I haven’t edited the doc yet.

--
keywords: +patch
Added file: http://bugs.python.org/file22631/threading-classes.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10968
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8668] Packaging: add a 'develop' command

2011-07-12 Thread higery

Changes by higery shoulderhig...@gmail.com:


Added file: http://bugs.python.org/file22632/2750cd9e2111.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8668
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2011-07-12 Thread Alex Leon

New submission from Alex Leon ael...@gmail.com:

It looks like some servers using basic authentication don't include quotes 
around the realm (example https://api.connect2field.com) as required by rfc 
2617. urllib wont handle these requests and silently fails, but a simple change 
to the regex in AbstractBasicAuthHandler from
 
'realm=([\'])(.*?)\\2', re.I)
to
'realm=([\']?)([\']*)\\2', re.I)

would make authentication more flexible.

--
components: Library (Lib)
messages: 140191
nosy: Alex.Leon
priority: normal
severity: normal
status: open
title: Accepting Badly formed headers in urllib HTTPBasicAuth
type: behavior
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12541
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8668] Packaging: add a 'develop' command

2011-07-12 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


Removed file: http://bugs.python.org/file22614/b1b9da3b3d20.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8668
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12417] Inappropriate copyright on profile files

2011-07-12 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

The former license was also present in the reST documentation.  Attached patch 
removes it, and also cleans up two lines: it removes a comment that duplicates 
a docstring, and removes the docstring from profile that you added to pstats :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12417
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12417] Inappropriate copyright on profile files

2011-07-12 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


Added file: http://bugs.python.org/file22633/profile-free-followup.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12417
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12542] Remove duplicates of cmp_to_key used in tests

2011-07-12 Thread Éric Araujo

New submission from Éric Araujo mer...@netwok.org:

Two test files still use their own CmpToKey after the introduction of 
functools.cmp_to_key.

--
components: Tests
files: remove-custom-cmptokey.diff
keywords: patch
messages: 140193
nosy: eric.araujo, rhettinger
priority: normal
severity: normal
stage: commit review
status: open
title: Remove duplicates of cmp_to_key used in tests
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22634/remove-custom-cmptokey.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12542
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2011-07-12 Thread Senthil Kumaran

Changes by Senthil Kumaran sent...@uthcode.com:


--
assignee:  - orsenthil
nosy: +orsenthil

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12541
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12542] Remove duplicates of cmp_to_key used in tests

2011-07-12 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
resolution:  - accepted

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12542
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8668] Packaging: add a 'develop' command

2011-07-12 Thread Michael Mulich

Michael Mulich michael.mul...@gmail.com added the comment:

On Tue, Jul 12, 2011 at 9:39 AM, higery rep...@bugs.python.org wrote:
 The develop command writes three pieces of information to the filesystem:
  1. It calls upon the build action(s) to build the package relative to
 the package's root directory.
  2. It calls the [build|install]_distinfo action to write the
 .dist-info metadata inside the build directory. (see also Issue 12279)
  3. It adds the build directory's path to a .pth file.


 You are right, what you listed above are also the things done by the
 'develop' command of my current implementation. In addition, as I replied
 earlier, we can also add a .distinfo-link file  more than the .pth file.

I don't like the idea of a .distinfo-link file. Would it even be
necessary if we already have a .pth entry?

We should probably just use one of these files, either .distinfo-link
or .pth. The .pth implementation has the least impact on code base and
is already implemented. If we add support for a .distinfo-link, we
would then need to modify database module to support that extension.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8668
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8668] Packaging: add a 'develop' command

2011-07-12 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Oh, I just realized that one thing I insisted on was wrong.

I pushed for the modules to be built in the build dir, as well as the dist-info 
dir, so that the build dir can be added to sys.path to let both import and 
packaging.database find the files.  But this breaks one important develop 
feature: editions to the code should be visible immediately, without having to 
re-run develop or build.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8668
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >