Re: Typed python comparison / code analysis questions

2012-01-04 Thread Terry Reedy
On 1/4/2012 3:42 PM, Lucas Vickers wrote: At the moment python3 isn't an option. There's a variety of dependencies I'm working around. Please consider telling the authors of libraries you need that you would like a Python 3 version and say why. One reason given for not upgrading packages is

Re: a little help

2012-01-04 Thread Terry Reedy
On 1/4/2012 7:29 PM, Andres Soto wrote: As you explain me, Python behave like a compiled language: any time I make a change in the code, I have to "compile" it again, and re-run (and re-load the data). While you are developing a program and expect to make changes, you can try working with a s

Re: help me get excited about python 3

2012-01-04 Thread Evan Driscoll
On 1/4/2012 9:56 AM, Sean Wolfe wrote: > I am still living in the 2.x world because all the things I want to do > right now in python are in 2 (django, pygame). But I want to be > excited about the future of the language. I understand the concept of > needing to break backwards compatibility. But i

Re: can a subclass method determine if called by superclass?

2012-01-04 Thread Steven D'Aprano
On Wed, 04 Jan 2012 15:37:55 -0800, Peter wrote: > I am trying to create a subclass with slightly different functionality > and use it with an existing code base i.e. there is already one or > more modules that instantiate the current superclass and I want to > just drop in this new class to repla

Re: .format vs. %

2012-01-04 Thread 88888 Dihedral
alex23於 2012年1月5日星期四UTC+8上午8時23分06秒寫道: > On Jan 4, 6:25 pm, 8 Dihedral > wrote: > > > And what are you contributing to the situation other than > > > misinformation and markov-generated spam? > > > > Do you know what can attract newbies to support python? > > I'm sure other people doing all t

Trouble getting Python 2.7.2 to recognize Tk in Scientific Linux Release 6

2012-01-04 Thread Jeffrey Wise
Hi, I've been a python user for a long time - on Windows, but now I'm working on a Linux system. I'm having trouble getting python to include Tk in it's build. My Tcl/Tk is in a non-standard location (I don't want to interfere with the Python 2.6 installation - that does include Tk until I have

Re: a little help

2012-01-04 Thread Andres Soto
my mistake is because I have no problem to do that using Prolog which use an interpreter as Python. I thought that the variables in the main global memory space (associated with the command line environment) were kept, although the code that use it could change. As you explain me, Python behave

Re: a little help

2012-01-04 Thread Chris Angelico
On Thu, Jan 5, 2012 at 11:29 AM, Andres Soto wrote: > my mistake is because I have no problem to do that using Prolog which use an > interpreter as Python. I thought that the variables in the main global > memory space (associated with the command line environment) were kept, > although the code t

Re: .format vs. %

2012-01-04 Thread alex23
On Jan 4, 6:25 pm, 8 Dihedral wrote: > > And what are you contributing to the situation other than > > misinformation and markov-generated spam? > > Do you know what can attract newbies to support python? I'm sure other people doing all the work for them would be a great attractor. Are you vo

Re: a little help

2012-01-04 Thread Chris Angelico
I think you meant to send that to the list; hope you don't mind my replying on-list. On Thu, Jan 5, 2012 at 10:56 AM, Andres Soto wrote: > the problem is that if I re-run the program, every time I change some > instructions, I have to read (load) again the data and that is what I want > to avoid.

Re: help me get excited about python 3

2012-01-04 Thread Rick Johnson
On Jan 4, 9:56 am, Sean Wolfe wrote: > I am still living in the 2.x world because all the things I want to do > right now in python are in 2 (django, pygame). But I want to be > excited about the future of the language. Okay. So why not enjoy the best of both worlds (almost) and use version 2.7.2

Re: can a subclass method determine if called by superclass?

2012-01-04 Thread Peter
On Jan 5, 10:09 am, Ian Kelly wrote: > > Well, you could get the previous stack level using > traceback.extract_stack() and check the filename.  But it sounds like > what you actually have are two different methods -- one that is used > by the superclass, and one that only the subclass knows abou

Re: a little help

2012-01-04 Thread Chris Angelico
On Thu, Jan 5, 2012 at 10:25 AM, Andres Soto wrote: > My situation is the following: I am developing some code. I use the IDLE > Editor to write it down. Then, I save it and import it from the command line > interface, so it is already available from the prompt. > Then I load (read) some data from

a little help

2012-01-04 Thread Andres Soto
Hi, I am new using Python, although I have experience using other programming languages like Pascal, FORTRAN, C, Prolog, etc. I am using IDLE Editor for Python in coordination with the command line interface. My situation is the following: I am developing some code. I use the IDLE Editor to write

Re: Spamming PyPI with stupid packages

2012-01-04 Thread xDog Walker
On Tuesday 2012 January 03 17:28, Steven D'Aprano wrote: > Besides, I find it hard to believe that the search facilities on PyPI are > so bad that there would be any searches that come up with "girlfriend.py" > or "car.py" as false positives. Try an author search for D'Aprano. -- I have seen the

Re: can a subclass method determine if called by superclass?

2012-01-04 Thread Ian Kelly
On Wed, Jan 4, 2012 at 3:42 PM, Peter wrote: > Situation: I am subclassing a class which has methods that call other > class methods (and without reading the code of the superclass I am > discovering these by trial and error as I build the subclass - this is > probably why I may have approached th

can a subclass method determine if called by superclass?

2012-01-04 Thread Peter
Situation: I am subclassing a class which has methods that call other class methods (and without reading the code of the superclass I am discovering these by trial and error as I build the subclass - this is probably why I may have approached the problem from the wrong viewpoint :-)). Problem: whe

Expert Advice

2012-01-04 Thread Luis Perez
Hi Everyone, A number of friends in the community recommended i email this group regarding some obstacles im running into regarding a Python/Django dilemma :). Im currently representing a e-Plushing firm who has built an amazing custom ebook publishing platform in Django and Python. We are

Re: help me get excited about python 3

2012-01-04 Thread Andrew Berg
On 1/4/2012 9:56 AM, Sean Wolfe wrote: > I am still living in the 2.x world because all the things I want to do > right now in python are in 2 (django, pygame). But I want to be > excited about the future of the language. I understand the concept of > needing to break backwards compatibility. But i

Re: Spamming PyPI with stupid packages

2012-01-04 Thread HoneyMonster
On Wed, 04 Jan 2012 20:48:36 +, PiLS wrote: > If I nuke a Karmic Koala, will they rat me out to the WWF, to the > UNODA, or to both? Personally I'd be cheering for you, provided you also took out all the warthogs, hedgehogs, badgers, drakes, efts, fawns, gibbons, herons, ibexes, jackalopes,

Re: UnicodeEncodeError when piping stdout, but not when printing directly to the console

2012-01-04 Thread Peter Otten
Adam Funk wrote: > (I'm using Python 2.7.2+ on Ubuntu.) > > When I'm running my program in an xterm, the print command with an > argument containing unicode works fine (it correctly detects my UTF-8 > environment). But when I run it with a pipe or redirect to a file (| > or >), unicode strings f

UnicodeEncodeError when piping stdout, but not when printing directly to the console

2012-01-04 Thread Adam Funk
(I'm using Python 2.7.2+ on Ubuntu.) When I'm running my program in an xterm, the print command with an argument containing unicode works fine (it correctly detects my UTF-8 environment). But when I run it with a pipe or redirect to a file (| or >), unicode strings fail with the following (for ex

Re: Spamming PyPI with stupid packages

2012-01-04 Thread Chris Angelico
On Thu, Jan 5, 2012 at 7:48 AM, PiLS wrote: > If I nuke a Karmic Koala, will they rat me out to the WWF, to > the UNODA, or to both? Neither, actually. We'll be so glad you didn't call it a Karmic Koala Bear that we'll send you three American tourists for free. (They're actually quite delicious w

Re: Spamming PyPI with stupid packages

2012-01-04 Thread Arnaud Delobelle
On 4 January 2012 20:08, Ian Kelly wrote: > On Wed, Jan 4, 2012 at 12:36 PM, Tony Pelletier > wrote: >> I have zero desire to follow the rules of a Python(here's the ironic part. >> Get it now clever boy?) list when it'd riddled with childish banter that has >> nothing to do with wait for

Re: Spamming PyPI with stupid packages

2012-01-04 Thread PiLS
Le mar, 03 jan 2012 20:28:59, Steven D'Aprano a ploppé: > On Tue, 03 Jan 2012 05:08:47 -0800, Ethan Furman wrote: > > [...] >>> "maybe policing uploads is worse than cluttering PyPI's disk space and >>> RSS feed with dumb 1 KB packages." (Matt Chaput) >>> >>> I'd drop the "maybe". >> >> It's har

Re: Typed python comparison / code analysis questions

2012-01-04 Thread Lucas Vickers
Thank you! At the moment python3 isn't an option. There's a variety of dependencies I'm working around. Is there any type of 2.x add-on? either way thanks for the info L On Wed, Jan 4, 2012 at 3:34 PM, Ian Kelly wrote: > On Wed, Jan 4, 2012 at 1:09 PM, Lucas Vickers > wrote: > > Hello, > >

Re: Typed python comparison / code analysis questions

2012-01-04 Thread Chris Angelico
On Thu, Jan 5, 2012 at 7:09 AM, Lucas Vickers wrote: > 2) Is there a way to error when comparing variables of different types? Yep. Use Python version 3. >>> 1<"1" Traceback (most recent call last): File "", line 1, in 1<"1" TypeError: unorderable types: int() < str() Chris Angelico --

Re: Typed python comparison / code analysis questions

2012-01-04 Thread Ian Kelly
On Wed, Jan 4, 2012 at 1:09 PM, Lucas Vickers wrote: > Hello, > > I'm relatively new to Python.  I come from C/C++ so I love the flexibility > but I am slightly irked by the lack of compilation time checking. > > I've got two questions > 1) Are there any tools that do an analysis of code and attem

Re: Newbie Help

2012-01-04 Thread Ben Finney
Ben Finney writes: > * Cross-platform, so that you're not denied the use of any popular > workstation OS. > > For my purposes, either { GNU Screen + Bash + Emacs } or { GNU Screen + > Bash + Vim } are good choices satisfying all the above criteria. There > may be other good combinations. I sli

Re: python philosophical question - strong vs duck typing

2012-01-04 Thread Terry Reedy
On 1/4/2012 1:37 AM, Terry Reedy wrote: On 1/3/2012 8:04 PM, Devin Jeanpierre wrote: [ An example of a simple dependently typed program: http://codepad.org/eLr7lLJd ] Just got it after a minute delay. A followup now that I have read it. Removing the 40 line comment, the function itself is

Typed python comparison / code analysis questions

2012-01-04 Thread Lucas Vickers
Hello, I'm relatively new to Python. I come from C/C++ so I love the flexibility but I am slightly irked by the lack of compilation time checking. I've got two questions 1) Are there any tools that do an analysis of code and attempt to catch potential issues such as undefined variables, etc? I

Re: Spamming PyPI with stupid packages

2012-01-04 Thread Ian Kelly
On Wed, Jan 4, 2012 at 12:36 PM, Tony Pelletier wrote: > I have zero desire to follow the rules of a Python(here's the ironic part. > Get it now clever boy?) list when it'd riddled with childish banter that has > nothing to do with wait for it. Python? Fair enough.

Re: Spamming PyPI with stupid packages

2012-01-04 Thread Tony Pelletier
I have zero desire to follow the rules of a Python(here's the ironic part. Get it now clever boy?) list when it'd riddled with childish banter that has nothing to do with wait for it. Python? Do I need to explain it any further? I'm done with you and this list tha

Re: Spamming PyPI with stupid packages

2012-01-04 Thread Ian Kelly
On Wed, Jan 4, 2012 at 11:45 AM, Tony Pelletier wrote: > That's a rather ironic comment.  Idiot. Really? Which part was ironic? >> Sorry, this list does not exist for your personal entertainment. Not this one, that's just a statement of fact. >> Maybe you should try YouTube. Kinda. What I r

Re: Spamming PyPI with stupid packages

2012-01-04 Thread Ian Kelly
On Tue, Jan 3, 2012 at 7:50 PM, Tony Pelletier wrote: > Honestly, is this list really what this is all about?  I'm bored already... Sorry, this list does not exist for your personal entertainment. Maybe you should try YouTube. And no, it's not really about sexism either, but there is no harm in

Re: help me get excited about python 3

2012-01-04 Thread Ian Kelly
On Wed, Jan 4, 2012 at 8:56 AM, Sean Wolfe wrote: > I am still living in the 2.x world because all the things I want to do > right now in python are in 2 (django, pygame). But I want to be > excited about the future of the language. I understand the concept of > needing to break backwards compatib

Re: python philosophical question - strong vs duck typing

2012-01-04 Thread Tim Wintle
On Wed, 2012-01-04 at 11:30 -0300, Sean Wolfe wrote: > On Tue, Jan 3, 2012 at 7:28 PM, Ben Finney wrote: > > Sean Wolfe writes: > > > >> Hello everybody, I'm a happy pythonista newly subscribed to the group. > > > > Welcome! > > Thanks! and thanks to all, hjaha. > > > > >> I have a theoretical

Re: Newbie Help

2012-01-04 Thread HoneyMonster
On Tue, 03 Jan 2012 17:13:17 -0600, mixolydian wrote: > I want to get into Python progamming for both local database > applications and dynamic web pages. Maybe some Q&D scripts. I am new to Python too, and recently completed my first "real" cross- platform GUI application with local/remote datab

Re: python philosophical question - strong vs duck typing

2012-01-04 Thread Evan Driscoll
On 1/4/2012 12:37 AM, Terry Reedy wrote: > > Using induction, I can prove, for instance, that these two functions > [snip] > are equivalent, assuming enough stack and normal procedural Python > semantics. (And assuming no typos ;-). YOU proved that; your type system didn't. With a powerful enough

help me get excited about python 3

2012-01-04 Thread Sean Wolfe
I am still living in the 2.x world because all the things I want to do right now in python are in 2 (django, pygame). But I want to be excited about the future of the language. I understand the concept of needing to break backwards compatibility. But it's not particularly exciting to think about. W

Program blocked in Queue.Queue.get and Queue.Queue.put

2012-01-04 Thread Kris
I have a program that is blocked and all threads are blocked on a Queue.Queue.get or Queue.Queue.put method (on the same Queue.Queue object). 1 thread shows the below as its last entry in the stack: File: "c:\python27\lib\Queue.py", line 161, in get self.not_empty.acquire() 2 threads show the b

Re: Spamming PyPI with stupid packages

2012-01-04 Thread Rami Chowdhury
On Wed, Jan 4, 2012 at 02:42, Ben Finney wrote: > I'm sure you have a hundred ready rationalisations for why a joke that > has “girlfriend” as a fungible object, together with “car” and “house” > as things to mechanically import into one's life, is somehow not > objectifying women. > > But, while

Re: Large list in memory slows Python

2012-01-04 Thread Benoit Thiell
On Tue, Jan 3, 2012 at 5:59 PM, Peter Otten <__pete...@web.de> wrote: > Benoit Thiell wrote: > >> I am experiencing a puzzling problem with both Python 2.4 and Python >> 2.6 on CentOS 5. I'm looking for an explanation of the problem and >> possible solutions. Here is what I did: >> >> Python 2.4.3

pipe into preallocated buffer?

2012-01-04 Thread Mihai Badoiu
is there a way to pipe directly into a preallocated buffer? (subprocessing.pipe.stdout) thanks, --mihai -- http://mail.python.org/mailman/listinfo/python-list

Re: python philosophical question - strong vs duck typing

2012-01-04 Thread Sean Wolfe
On Tue, Jan 3, 2012 at 7:28 PM, Ben Finney wrote: > Sean Wolfe writes: > >> Hello everybody, I'm a happy pythonista newly subscribed to the group. > > Welcome! Thanks! and thanks to all, hjaha. > >> I have a theoretical / philosophical question regarding strong vs duck >> typing in Python. Let'

Re: Locale bug?

2012-01-04 Thread Marko Rauhamaa
Marko Rauhamaa : > "=?ISO-8859-1?Q?Trond_Endrest=F8l?=" : > >> Marko Rauhamaa writes: >>> $ python3 >>> >>> locale.setlocale(locale.LC_TIME, ('fi_FI', 'UTF-8')) >>> >>> time.strftime("%a, %d %b %Y %H:%M:%S %z (%Z)") >>> 'ti, 03 tammi\xa0 2012 14:51:57 +0200 (EET)' >> >> It may be

Re: Locale bug?

2012-01-04 Thread Marko Rauhamaa
"=?ISO-8859-1?Q?Trond_Endrest=F8l?=" : > Marko Rauhamaa writes: >> $ python3 >> >>> locale.setlocale(locale.LC_TIME, ('fi_FI', 'UTF-8')) >> >>> time.strftime("%a, %d %b %Y %H:%M:%S %z (%Z)") >> 'ti, 03 tammi\xa0 2012 14:51:57 +0200 (EET)' > > It may be OS-specific. You're right.

Re: python philosophical question - strong vs duck typing

2012-01-04 Thread Devin Jeanpierre
> Since Python does not 'silently convert types' as I understand those 3 > words, you lose me here. Can you give a code example of what you mean? I mean the reasoning behind the arguments like 'X isn't strongly typed because 2 + "3" = 5 but "3" + 2 = "32"'. OCaml considers this a problem and bans

Re: Spamming PyPI with stupid packages

2012-01-04 Thread Tony Pelletier
Honestly, is this list really what this is all about? I'm bored already... Enough? On Tue, Jan 3, 2012 at 9:42 PM, Ben Finney wrote: > Steven D'Aprano writes: > > > On Wed, 04 Jan 2012 12:54:09 +1100, Ben Finney wrote: > > > It objectifies women. > > > > So you claim. > > I'm sure you have a h

Re: .format vs. %

2012-01-04 Thread 88888 Dihedral
alex23於 2012年1月4日星期三UTC+8上午10時26分35秒寫道: > 8 Dihedral wrote: > > This is a good evolution in Python. It is 2012 now and the text I/O part > > is not as important as 10 years ago. The next move of Python could > > be easy integration of C++ libraries. > > You mean like with Py++? http://pypi.py