Re: Closures in leu of pointers?

2013-06-30 Thread rusi
On Sunday, June 30, 2013 10:38:01 AM UTC+5:30, Chris Angelico wrote: > On Sun, Jun 30, 2013 at 2:32 PM, Terry Reedy wrote: > > One of the reasons I switched to Python was to not have to do that, or > > hardly ever. For valid code, an new declaration is hardly needed. Parameters > > are locals. If

Re: Closures in leu of pointers?

2013-06-30 Thread rusi
On Sunday, June 30, 2013 2:23:35 AM UTC+5:30, Terry Reedy wrote: > > > > If, in the general case, the compiler requires two passes to understand > a function body, then *so do people*#. This requirement is what trips up > people who are either not used to the idea of two-pass compilation or do

Re: Stupid ways to spell simple code

2013-06-30 Thread Cameron Simpson
On 30Jun2013 16:06, Chris Angelico wrote: | So, here's a challenge: Come up with something really simple, and | write an insanely complicated - yet perfectly valid - way to achieve | the same thing. Bonus points for horribly abusing Python's clean | syntax in the process. _Must_ you turn this int

Re: Closures in leu of pointers?

2013-06-30 Thread Antoon Pardon
Op 29-06-13 21:23, Ian Kelly schreef: On Sat, Jun 29, 2013 at 11:02 AM, Antoon Pardon wrote: Op 29-06-13 16:02, Michael Torrie schreef: The real problem here is that you don't understand how python variables work. And in fact, python does not have variables. It has names that bind to obje

python3 import idlelib.PyShell fails

2013-06-30 Thread Helmut Jarausch
Hi, I have a strange error. When I try import idlelib.PyShell from Python3.3 it fails with Python 3.3.2+ (3.3:68ff68f9a0d5+, Jun 30 2013, 12:59:15) [GCC 4.7.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import idlelib.PyShell Traceback (most recent call

Re: python3 import idlelib.PyShell fails

2013-06-30 Thread Peter Otten
Helmut Jarausch wrote: > Hi, > > I have a strange error. When I try import idlelib.PyShell from Python3.3 > it fails with > > Python 3.3.2+ (3.3:68ff68f9a0d5+, Jun 30 2013, 12:59:15) > [GCC 4.7.3] on linux > Type "help", "copyright", "credits" or "license" for more information. import idlel

Re: Closures in leu of pointers?

2013-06-30 Thread Steven D'Aprano
On Sun, 30 Jun 2013 01:56:25 -0700, rusi wrote: [...] > All of which adds up to making scoping/variables an arcane craft. > > Now having such passes is one thing. Defining the language in terms of > them quite another... I don't believe that Python's behaviour is defined in terms of the number

Re: Closures in leu of pointers?

2013-06-30 Thread rusi
On Sunday, June 30, 2013 4:52:24 PM UTC+5:30, Steven D'Aprano wrote: > On Sun, 30 Jun 2013 01:56:25 -0700, rusi wrote: > > Now having such passes is one thing. Defining the language in terms of > > them quite another... > > > I don't believe that Python's behaviour is defined in terms of the numb

Re: python3 import idlelib.PyShell fails

2013-06-30 Thread Helmut Jarausch
On Sun, 30 Jun 2013 13:20:24 +0200, Peter Otten wrote: Thanks a lot! Helmut. -- http://mail.python.org/mailman/listinfo/python-list

Twisted 13.1.0 released

2013-06-30 Thread Ashwini Oruganti
On behalf of Twisted Matrix Laboratories, I am pleased to announce the release of Twisted 13.1. Highlights for this release include: * trial now has an --exitfirst flag which stops the test run after the first error or failure. * twisted.internet.ssl.CertificateOptions now supports chain ce

Re: Stupid ways to spell simple code

2013-06-30 Thread Rick Johnson
On Sunday, June 30, 2013 1:06:35 AM UTC-5, Chris Angelico wrote: > So, here's a challenge: Come up with something really simple, and > write an insanely complicated - yet perfectly valid - way to achieve > the same thing. Bonus points for horribly abusing Python's clean > syntax in the process. Ch

Re: Stupid ways to spell simple code

2013-06-30 Thread Joshua Landau
On 30 June 2013 15:58, Rick Johnson wrote: > Chris, i'm sorry, but your challenge is decades too late. If you seek > amusement you need look no further than the Python stdlib. If you REALLY want > to be amused, peruse the "idlelib" -- not only is the code obfuscated, it > also breaks PEP8 and t

Re: Stupid ways to spell simple code

2013-06-30 Thread Chris Angelico
On Mon, Jul 1, 2013 at 1:08 AM, Joshua Landau wrote: > On 30 June 2013 15:58, Rick Johnson wrote: >> Chris, i'm sorry, but your challenge is decades too late. If you seek >> amusement you need look no further than the Python stdlib. If you REALLY >> want to be amused, peruse the "idlelib" -- no

Issues compiling hunspell from source on windows

2013-06-30 Thread Akshay Kayastha
Hi I am trying to compile a python module called hunspell from the following [source](https://pypi.python.org/pypi/hunspell). But I get the following error message. C:\Users\KURO\Desktop\hunspell-0.1>setup.py install running install running build running build_ext

Re: Issues compiling hunspell from source on windows

2013-06-30 Thread rusi
On Sunday, June 30, 2013 9:24:46 PM UTC+5:30, Akshay Kayastha wrote: > Hi I am trying to compile a python module called hunspell from the following > [source](https://pypi.python.org/pypi/hunspell). > According to http://docs.python.org/2/extending/windows.html you need to use the same compiler

Re: Looking for a name for a deployment framework...

2013-06-30 Thread rusi
On Sunday, June 30, 2013 7:08:51 AM UTC+5:30, Chris Angelico wrote: > On Wed, Jun 26, 2013 at 9:40 PM, Roy Smith wrote: > > for host in hosts: > >deploy(the_code).remote() > > For further hack delight, require a patch > Submitted for this code restrict itself > To five feet, neither more nor

Re: Issues compiling hunspell from source on windows

2013-06-30 Thread Akshay Kayastha
Haha... nooo I already use Linux. But I am currently doing a project that required me to run my script on Windows as well as Linux. TO be precise I am supposed to create a stand alone executable for my script which runs great on Linux, but to create one for Windows I need to be able to run the s

Re: Closures in leu of pointers?

2013-06-30 Thread Ian Kelly
On Sun, Jun 30, 2013 at 4:07 AM, Antoon Pardon wrote: > I don't think this reference is as strong as you think it is. Here is > a paragraph somewhat lower: > > ] If a name is bound in a block, it is a local variable of that block, > ] unless declared as nonlocal. If a name is bound at the module l

Re: Closures in leu of pointers?

2013-06-30 Thread Ian Kelly
On Sun, Jun 30, 2013 at 11:13 AM, Ian Kelly wrote: > On Sun, Jun 30, 2013 at 4:07 AM, Antoon Pardon > wrote: >> I don't think this reference is as strong as you think it is. Here is >> a paragraph somewhat lower: >> >> ] If a name is bound in a block, it is a local variable of that block, >> ] un

Re: python adds an extra half space when reading from a string or list

2013-06-30 Thread Νίκος
Στις 29/6/2013 8:00 μμ, ο/η Mark Lawrence έγραψε: Why this when the approach to Nick the Incompetant Greek has been to roll out the red carpet? Your mother is incompetent who raised a brat like you. -- What is now proved was at first only imagined! -- http://mail.python.org/mailman/listinfo

Re: Stupid ways to spell simple code

2013-06-30 Thread Ian Kelly
On Sun, Jun 30, 2013 at 9:20 AM, Chris Angelico wrote: > Yeah, I cannot seriously imagine that the stdlib does anything like > the example I gave :) Pity nobody else is offering further examples, I > thought this might be a fun thread. Well, there is the "this" module. But its code is not *that*

Re: Don't feed the troll...

2013-06-30 Thread Antoon Pardon
Op 28-06-13 19:20, Ian Kelly schreef: On Thu, Jun 27, 2013 at 12:13 PM, Antoon Pardon wrote: So what do you think would be a good approach towards people who are behaving in conflict with this wish of yours? Just bluntly call them worse than the troll or try to approach them in a way that is l

Re: Stupid ways to spell simple code

2013-06-30 Thread Steven D'Aprano
On Sun, 30 Jun 2013 16:06:35 +1000, Chris Angelico wrote: > So, here's a challenge: Come up with something really simple, and write > an insanely complicated - yet perfectly valid - way to achieve the same > thing. Bonus points for horribly abusing Python's clean syntax in the > process. Here's a

Re: Stupid ways to spell simple code

2013-06-30 Thread Roy Smith
In article <51d06cb6$0$2$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Sun, 30 Jun 2013 16:06:35 +1000, Chris Angelico wrote: > > > So, here's a challenge: Come up with something really simple, and write > > an insanely complicated - yet perfectly valid - way to achieve t

Re: Don't feed the troll...

2013-06-30 Thread Ian Kelly
On Sun, Jun 30, 2013 at 11:25 AM, Antoon Pardon wrote: >>> So what do you think would be a good approach towards people >>> who are behaving in conflict with this wish of yours? Just >>> bluntly call them worse than the troll or try to approach them >>> in a way that is less likely to antangonize

Re: password protect file

2013-06-30 Thread Peter Pearson
On Sat, 29 Jun 2013 10:28:47 -0700 (PDT), gmsid...@gmail.com wrote: > I was wondering if there was a couple of words or things i > could add to the top of my python script to password > protect it so that it asks user for the password and then > after three tries it locks them out or says "access >

math functions with non numeric args

2013-06-30 Thread Andrew Z
Hello, print max(-10, 10) 10 print max('-10', 10) -10 My guess max converts string to number bye decoding each of the characters to it's ASCII equivalent? Where can i read more on exactly how the situations like these are dealt with? Thank you AZ -- http://mail.python.org/mailman/listinfo/pyth

Re: math functions with non numeric args

2013-06-30 Thread Andrew Berg
On 2013.06.30 13:46, Andrew Z wrote: > Hello, > > print max(-10, 10) > 10 > print max('-10', 10) > -10 > > My guess max converts string to number bye decoding each of the characters to > it's ASCII equivalent? > > Where can i read more on exactly how the situations like these are dealt with? Th

Re: math functions with non numeric args

2013-06-30 Thread Irmen de Jong
On 30-6-2013 20:46, Andrew Z wrote: > Hello, > > print max(-10, 10) > 10 > print max('-10', 10) > -10 > > My guess max converts string to number bye decoding each of the characters to > it's ASCII > equivalent? > > Where can i read more on exactly how the situations like these are dealt with? >

Re: math functions with non numeric args

2013-06-30 Thread Ian Kelly
On Sun, Jun 30, 2013 at 12:46 PM, Andrew Z wrote: > Hello, > > print max(-10, 10) > 10 > print max('-10', 10) > -10 > > My guess max converts string to number bye decoding each of the characters > to it's ASCII equivalent? No, it leaves the types as they are but simply considers strings to be "gr

Re: math functions with non numeric args

2013-06-30 Thread MRAB
On 30/06/2013 19:53, Andrew Berg wrote: On 2013.06.30 13:46, Andrew Z wrote: Hello, print max(-10, 10) 10 print max('-10', 10) -10 My guess max converts string to number bye decoding each of the characters to it's ASCII equivalent? Where can i read more on exactly how the situations like the

Re: password protect file

2013-06-30 Thread Modulok
On Sat, 29 Jun 2013 10:28:47 -0700 (PDT), gmsid...@gmail.com wrote: > I was wondering if there was a couple of words or things i > could add to the top of my python script to password > protect it so that it asks user for the password and then > after three tries it locks them out or says "access >

Re: Issues compiling hunspell from source on windows

2013-06-30 Thread David Robinow
It appears you are using a 32 bit compiler with a 64-bit python. Install a 32 bit python. On Sun, Jun 30, 2013 at 11:54 AM, Akshay Kayastha wrote: > Hi I am trying to compile a python module called hunspell from the following > [source](https://pypi.python.org/pypi/hunspell). > > But I get the f

Re: python adds an extra half space when reading from a string or list

2013-06-30 Thread Robert Kern
On 2013-06-30 18:24, Νίκος wrote: Στις 29/6/2013 8:00 μμ, ο/η Mark Lawrence έγραψε: Why this when the approach to Nick the Incompetant Greek has been to roll out the red carpet? Your mother is incompetent who raised a brat like you. That is not acceptable behavior on this list. Please keep

Re: python adds an extra half space when reading from a string or list

2013-06-30 Thread Νίκος
Στις 30/6/2013 10:58 μμ, ο/η Robert Kern έγραψε: On 2013-06-30 18:24, Νίκος wrote: Στις 29/6/2013 8:00 μμ, ο/η Mark Lawrence έγραψε: Why this when the approach to Nick the Incompetant Greek has been to roll out the red carpet? Your mother is incompetent who raised a brat like you. That is

Re: python adds an extra half space when reading from a string or list

2013-06-30 Thread Robert Kern
On 2013-06-30 21:14, Νίκος wrote: Στις 30/6/2013 10:58 μμ, ο/η Robert Kern έγραψε: On 2013-06-30 18:24, Νίκος wrote: Στις 29/6/2013 8:00 μμ, ο/η Mark Lawrence έγραψε: Why this when the approach to Nick the Incompetant Greek has been to roll out the red carpet? Your mother is incompetent who

Re: Stupid ways to spell simple code

2013-06-30 Thread Joshua Landau
On 30 June 2013 18:36, Steven D'Aprano wrote: > Pfft! Where's the challenge in that? Let's use an O(n!) algorithm for > sorting -- yes, n factorial -- AND abuse a generator expression for its > side effect. As a bonus, we use itertools, and just for the lulz, I > obfuscate as many of the names as

Re: python adds an extra half space when reading from a string or list

2013-06-30 Thread Joshua Landau
On 30 June 2013 20:58, Robert Kern wrote: > On 2013-06-30 18:24, Νίκος wrote: >> >> Στις 29/6/2013 8:00 μμ, ο/η Mark Lawrence έγραψε: >> >>> Why this when the approach to Nick the Incompetant Greek has been to >>> roll out the red carpet? >> >> >> Your mother is incompetent who raised a brat like

Re: python adds an extra half space when reading from a string or list

2013-06-30 Thread Robert Kern
On 2013-06-30 22:57, Joshua Landau wrote: On 30 June 2013 20:58, Robert Kern wrote: On 2013-06-30 18:24, Νίκος wrote: Στις 29/6/2013 8:00 μμ, ο/η Mark Lawrence έγραψε: Why this when the approach to Nick the Incompetant Greek has been to roll out the red carpet? Your mother is incompetent

Re: password protect file

2013-06-30 Thread gmsiders
On Sunday, June 30, 2013 2:25:51 PM UTC-5, Modulok wrote: > On Sat, 29 Jun 2013 10:28:47 -0700 (PDT), gmsi...@gmail.com wrote: > > > I was wondering if there was a couple of words or things i > > could add to the top of my python script to password > > > protect it so that it asks user for the pa

Re: password protect file

2013-06-30 Thread Chris Angelico
On Mon, Jul 1, 2013 at 8:17 AM, wrote: > > i just want something simple that basicly asks for a password and then > replies to u if you are wrong nothing hevay just for learning exsperience > -- Then your task is pretty easy. Look up these things in the Python docs: * input (or raw_input if yo

Python, meet Turtle

2013-06-30 Thread vasudevram
http://jugad2.blogspot.com/2013/07/python-meet-turtle.html -- http://mail.python.org/mailman/listinfo/python-list

settrace doesn't trace builtin functions

2013-06-30 Thread skunkwerk
Hi, I've been using the settrace function to write a tracer for my program, which is working great except that it doesn't seem to work for built-in functions, like open('filename.txt'). This doesn't seem to be documented, so I'm not sure if I'm doing something wrong or that's the expected beh

Re: Closures in leu of pointers?

2013-06-30 Thread alex23
On 30/06/2013 3:46 PM, Ian Kelly wrote: In general I agree, although when reading code I would definitely prefer if the locals were declared. If you import the code into the interpreter as an adjunct to reading it you can see the locals with: >>> somefunc.func_code.co_varnames # 2.x >>> somefu

Re: python adds an extra half space when reading from a string or list

2013-06-30 Thread Antoon Pardon
Op 30-06-13 22:14, Νίκος schreef: Στις 30/6/2013 10:58 μμ, ο/η Robert Kern έγραψε: On 2013-06-30 18:24, Νίκος wrote: Στις 29/6/2013 8:00 μμ, ο/η Mark Lawrence έγραψε: Why this when the approach to Nick the Incompetant Greek has been to roll out the red carpet? Your mother is incompetent who

Re: python adds an extra half space when reading from a string or list

2013-06-30 Thread Antoon Pardon
Op 30-06-13 23:57, Joshua Landau schreef: On 30 June 2013 20:58, Robert Kern wrote: On 2013-06-30 18:24, Νίκος wrote: Στις 29/6/2013 8:00 μμ, ο/η Mark Lawrence έγραψε: Why this when the approach to Nick the Incompetant Greek has been to roll out the red carpet? Your mother is incompetent