[sphinx-dev] Sphinx 1.2 beta 1 released

2013-03-31 Thread Georg Brandl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I'm very happy to announce the release of Sphinx 1.2, beta 1, available on the Python package index at http://pypi.python.org/pypi/Sphinx. Please test and report bugs to http://dev.sphinx-doc.org/sphinx/issues. This is the first testing

Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread morphex
Hi. I was just doodling around with the python interpreter today, and here is the dump from the terminal: morphex@laptop:~$ python Python 2.7.3 (default, Sep 26 2012, 21:53:58) [GCC 4.7.2] on linux2 Type help, copyright, credits or license for more information. 1**2 1 1**2**3 1 1**2**3**4

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Dave Angel
On 03/31/2013 02:56 AM, morphex wrote: Hi. I was just doodling around with the python interpreter today, and here is the dump from the terminal: morphex@laptop:~$ python Python 2.7.3 (default, Sep 26 2012, 21:53:58) [GCC 4.7.2] on linux2 Type help, copyright, credits or license for more

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Steven D'Aprano
On Sat, 30 Mar 2013 23:56:46 -0700, morphex wrote: Hi. I was just doodling around with the python interpreter today, and here is the dump from the terminal: morphex@laptop:~$ python Python 2.7.3 (default, Sep 26 2012, 21:53:58) [GCC 4.7.2] on linux2 Type help, copyright, credits or

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-31 Thread jmfauth
-- Neil Hodgson: The counter-problem is that a French document that needs to include one mathematical symbol (or emoji) outside Latin-1 will double in size as a Python string. Serious developers/typographers/users know that you can not compose a text in French with latin-1. This is now also

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Dave Angel
On 03/31/2013 03:33 AM, Steven D'Aprano wrote: On Sat, 30 Mar 2013 23:56:46 -0700, morphex wrote: Hi. I was just doodling around with the python interpreter today, and here is the dump from the terminal: morphex@laptop:~$ python Python 2.7.3 (default, Sep 26 2012, 21:53:58) [GCC 4.7.2] on

ASCII versus non-ASCII [was Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]]

2013-03-31 Thread Steven D'Aprano
On Sun, 31 Mar 2013 00:35:23 -0700, jmfauth wrote: This is not really the problem. Serious users may notice sooner or later, Python and Unicode are walking in opposite directions (technically and in spirit). timeit.repeat('a' * 1000 + 'ẞ') [1.1088995672090292, 1.0842266613261913,

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread morphex
Aha, OK. Thought I found a bug but yeah that makes sense ;) While we're on the subject, wouldn't it be nice to have some cap there so that it isn't possible to more or less block the system with large exponentiation? On Sunday, March 31, 2013 9:33:32 AM UTC+2, Steven D'Aprano wrote: On Sat,

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Dave Angel
On 03/31/2013 08:07 AM, morphex wrote: Aha, OK. Thought I found a bug but yeah that makes sense ;) While we're on the subject, wouldn't it be nice to have some cap there so that it isn't possible to more or less block the system with large exponentiation? There's an assumption there. The

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Roy Smith
In article 5157e6cc$0$29974$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: For what it's worth, that last intermediate result (two to the power of the 489-digit number) has approximately a billion trillion trillion trillion trillion trillion

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Roy Smith
In article 8276eff6-9e5c-4060-b9e8-94fab6062...@googlegroups.com, morphex morp...@gmail.com wrote: Aha, OK. Thought I found a bug but yeah that makes sense ;) While we're on the subject, wouldn't it be nice to have some cap there so that it isn't possible to more or less block the system

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-31 Thread Mark Lawrence
On 31/03/2013 08:35, jmfauth wrote: -- Neil Hodgson: The counter-problem is that a French document that needs to include one mathematical symbol (or emoji) outside Latin-1 will double in size as a Python string. Serious developers/typographers/users know that you can not compose a text in

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Roy Smith
In article mailman.4012.1364733818.2939.python-l...@python.org, Dave Angel d...@davea.name wrote: I'm typing this while a terminal is open doing the particular operation, and the system doesn't seem in the least sluggish. Currently the memory used is at 10gig, and while there are some

Re: Python GUI questions

2013-03-31 Thread Jan Riechers
On 19.03.2013 21:01, maiden129 wrote: Hello, I'm using python 3.2.3 and I'm making a program that show the of occurrences of the character in the string in Tkinter. My questions are: How can I make an empty Entry object that will hold a word that a user will enter? How to make an empty

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Jason Swails
On Sun, Mar 31, 2013 at 9:15 AM, Roy Smith r...@panix.com wrote: $ prtstat 29937 Process: mongodState: S (sleeping) [...] Memory Vsize: 1998285 MB RSS: 5428 MB RSS Limit: 18446744073709 MB If I counted the digits right, that 1.9 TB. I love the RSS

Python 3.2.3 and my blank page

2013-03-31 Thread Νίκος Γκρ33κ
Hello all, i need some help i recently changes pythoon 2.6 code = python 3.2.3 but my script although not producing any errors now doesnt display anything else but a blank page at htp://superhost.gr can you help? I tried MySQLdb, pymysql, oursql, but nothing happens. i still get a blank page.

Convert Latitude, Longitude To TimeZone

2013-03-31 Thread Steve B
Hi All I'm new to python (4 days J) and was wondering if anyone out there can help me I am trying to get the time zones for latitude and longitude coordinates but am having a few problems The mistakes are probably very basic I have a table in a database with around 600 rows. Each row

Re: Convert Latitude, Longitude To TimeZone

2013-03-31 Thread Roy Smith
In article mailman.4017.1364741666.2939.python-l...@python.org, Steve B maccten2...@hotmail.com wrote: I found a piece of code [http://blog.pamelafox.org/2012/04/converting-addresses-to-timezones-in.html ] which uses the function [https://gist.github.com/pamelafox/2288222] When I try to

A Healthy Alternative to Takeaway Regret

2013-03-31 Thread saddd
A Healthy Alternative to Takeaway Regret http://natigtas7ab.blogspot.com/2013/03/a-healthy-alternative-to-takeaway-regret.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2.3 and my blank page

2013-03-31 Thread feedthetroll
I like to feed trolls :-) On 31 Mrz., 16:03, Νίκος Γκρ33κ nikos.gr...@gmail.com wrote: Hello all, Hello Ferrous Cranus [3]! ... I tried MySQLdb, pymysql, oursql, but nothing happens. i still get a blank page. I dont know what else to try since i see no error. Well, the output of your cgi is:

Creating a dictionary from a .txt file

2013-03-31 Thread C.T.
Hello, I'm currently working on a homework problem that requires me to create a dictionary from a .txt file that contains some of the worst cars ever made. The file looks something like this: 1958 MGA Twin Cam 1958 Zunndapp Janus 1961 Amphicar 1961 Corvair 1966 Peel Trident 1970 AMC Gremlin

Re: Creating a dictionary from a .txt file

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 2:52 AM, C.T. swilk...@gmail.com wrote: After playing around with the code, I came up with the following code to get everything into a list: d=[] car_file = open('worstcars.txt', 'r') for line in car_file: d.append(line.strip('\n')) print (d) car_file.close()

Re: Creating a dictionary from a .txt file

2013-03-31 Thread Mark Janssen
Every line is now an element in list d. The question I have now is how can I make a dictionary out of the list d with the car manufacturer as the key and a tuple containing the year and the model should be the key's value. Here is a sample of what list d looks like: ['1899 Horsey

Re: Creating a dictionary from a .txt file

2013-03-31 Thread Roy Smith
In article d15c39bc-5d2a-42c9-a76b-23768b61c...@googlegroups.com, C.T. swilk...@gmail.com wrote: Hello, I'm currently working on a homework problem that requires me to create a dictionary from a .txt file that contains some of the worst cars ever made. The file looks something like this:

Re: Creating a dictionary from a .txt file

2013-03-31 Thread C.T.
On Sunday, March 31, 2013 12:20:25 PM UTC-4, zipher wrote: Every line is now an element in list d. The question I have now is how can I make a dictionary out of the list d with the car manufacturer as the key and a tuple containing the year and the model should be the key's value. Here is a

Re: Creating a dictionary from a .txt file

2013-03-31 Thread C.T.
On Sunday, March 31, 2013 12:06:18 PM UTC-4, Chris Angelico wrote: On Mon, Apr 1, 2013 at 2:52 AM, C.T. After playing around with the code, I came up with the following code to get everything into a list: d=[] car_file = open('worstcars.txt', 'r') for line in car_file:

Re: Creating a dictionary from a .txt file

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 4:19 AM, C.T. swilk...@gmail.com wrote: Thank you, Chris! I could use slicing and indexing to build the dictionary but the problem is with the car manufacturer an the car model. Either or both could be multiple names. Then you're going to need some other form of magic

Re: Creating a dictionary from a .txt file

2013-03-31 Thread C.T.
On Sunday, March 31, 2013 12:38:56 PM UTC-4, Roy Smith wrote: In article d15c39bc-5d2a-42c9-a76b-23768b61c...@googlegroups.com, C.T. wrote: Hello, I'm currently working on a homework problem that requires me to create a dictionary from a .txt file that contains some of

Re: Creating a dictionary from a .txt file

2013-03-31 Thread Dave Angel
On 03/31/2013 12:52 PM, C.T. wrote: On Sunday, March 31, 2013 12:20:25 PM UTC-4, zipher wrote: SNIP Thank you, Mark! My problem is the data isn't consistently ordered. I can use slicing and indexing to put the year into a tuple, but because a car manufacturer could have two names (ie,

collections.Iterator __subclasshook__ does not check if next() is callable

2013-03-31 Thread Byron Ruth
I submitted this as bug last night: http://bugs.python.org/issue17584 and was *honored* to be rejected by Raymond Hettinger. However, I would like feedback on whether my concern (this bug) is justified and clarity if not. Consider: ```python class A(object): def __init__(self):

Re: Python 3.2.3 and my blank page

2013-03-31 Thread rurpy
On 03/31/2013 08:03 AM, Νίκος Γκρ33κ wrote: Hello all, i need some help i recently changes pythoon 2.6 code = python 3.2.3 but my script although not producing any errors now doesnt display anything else but a blank page at htp://superhost.gr can you help? I tried MySQLdb, pymysql,

Re: Creating a dictionary from a .txt file

2013-03-31 Thread Roy Smith
In article mailman.4023.1364751102.2939.python-l...@python.org, Dave Angel da...@davea.name wrote: On 03/31/2013 12:52 PM, C.T. wrote: On Sunday, March 31, 2013 12:20:25 PM UTC-4, zipher wrote: SNIP Thank you, Mark! My problem is the data isn't consistently ordered. I can use

Laws of Form are a notation for the SK calculus, demo in Python.

2013-03-31 Thread forman . simon
I was investigating G. Spencer-Brown's Laws of Form[1] by implementing it in Python. You can represent the marks of LoF as datastructures in Python composed entirely of tuples. For example: A mark: () A mark next to a mark: (), () A mark within a mark: ((),) and so on... It is known that the

Re: Creating a dictionary from a .txt file

2013-03-31 Thread Terry Jan Reedy
On 3/31/2013 11:52 AM, C.T. wrote: Hello, I'm currently working on a homework problem that requires me to create a dictionary from a .txt file that contains some of the worst cars ever made. The file looks something like this: 1958 MGA Twin Cam 1958 Zunndapp Janus 1961 Amphicar 1961 Corvair

Re: Python 3.2.3 and my blank page

2013-03-31 Thread Νίκος Γκρ33κ
Τη Κυριακή, 31 Μαρτίου 2013 9:14:43 μ.μ. UTC+3, ο χρήστης ru...@yahoo.com έγραψε: On 03/31/2013 08:03 AM, Νίκος Γκρ33κ wrote: Hello all, i need some help i recently changes pythoon 2.6 code = python 3.2.3 but my script although not producing any errors now doesnt display

Re: Python 3.2.3 and my blank page

2013-03-31 Thread Νίκος Γκρ33κ
I just tried the testmysql.py script: #!/usr/bin/python3 # coding=utf-8 import cgitb; cgitb.enable() import cgi, re, os, sys, socket, datetime, MySQLdb, locale, random, subprocess # connect to database con = MySQLdb.connect( db = 'nikos_metrites', host = 'localhost', user = 'nikos_nikos',

interacting with an opened libreoffice calc file

2013-03-31 Thread androidmaroso
Hi everyone, i'm new to the newsgroup and to python allthough (thanks to internet and the helpfull people i find) i've done a few scripts in python working like a charm. First of all i have to say i'm working on linux with python 2.3.7 (hope it's right) and libreoffice calc. My calc file

Re: collections.Iterator __subclasshook__ does not check if next() is callable

2013-03-31 Thread Byron Ruth
Raymond's replied to my follow-up and made me realize that the `next` property could return a callable and it would be transparent to the caller. On Sunday, March 31, 2013 1:57:08 PM UTC-4, Byron Ruth wrote: I submitted this as bug last night: http://bugs.python.org/issue17584 and was

Re: collections.Iterator __subclasshook__ does not check if next() is callable

2013-03-31 Thread Terry Jan Reedy
On 3/31/2013 1:57 PM, Byron Ruth wrote: I submitted this as bug last night: http://bugs.python.org/issue17584 and was *honored* to be rejected by Raymond Hettinger. However, I would like feedback on whether my concern (this bug) is justified and clarity if not. Consider: ```python class

Re: Python 3.2.3 and my blank page

2013-03-31 Thread rurpy
On 03/31/2013 01:12 PM, Νίκος Γκρ33κ wrote: Firsly, thank you for your willing to help me. i wrote, uploaded an chmoded test.py and you can see the cgi enviromental table here: http://superhost.gr/cgi-bin/test.py All values seem okey, so it really isnt somehting wrong with the cgi enviroment.

Re: collections.Iterator __subclasshook__ does not check if next() is callable

2013-03-31 Thread Byron Ruth
Thanks for responding Terry. I can assure you I did not initially realize both the `next` and the `__iter__` methods were implemented when I ran into my original problem. I saw a behavior and had to work backwards to realize why it was behaving the way it was (the comparison against Iterator).

Re: Python 3.2.3 and my blank page

2013-03-31 Thread Νίκος Γκρ33κ
Τη Κυριακή, 31 Μαρτίου 2013 10:46:57 μ.μ. UTC+3, ο χρήστης ru...@yahoo.com έγραψε: On 03/31/2013 01:12 PM, Νίκος Γκρ33κ wrote: Firsly, thank you for your willing to help me. i wrote, uploaded an chmoded test.py and you can see the cgi enviromental table here:

Help with python code!

2013-03-31 Thread jojo
Hi - I am a newbie to python and was wondering can someone tell me what the following code does. I need to figure out how to test it import time import glob import re import os current_time = time.time() + 60*60+24*30 dirList = glob.glob('\content\paytek\ejbProperties\cybersource\*.crt') q =

Re: Python 3.2.3 and my blank page

2013-03-31 Thread rurpy
On 03/31/2013 01:19 PM, Νίκος Γκρ33κ wrote: I just tried the testmysql.py script: [...snip code...] I hope no one who reads this list also has access to your database and that you don't use that username/password anyplace else. it works, as you can see at:

Re: Python 3.2.3 and my blank page

2013-03-31 Thread rurpy
On 03/31/2013 02:08 PM, Νίκος Γκρ33κ wrote: But i look the code and run python via interactive prompt and it says it has no error. Does it produce any output? Is that output the right html? That is, if you save the html to a file and open that file in a browser, does it look right? So i

Re: Python 3.2.3 and my blank page

2013-03-31 Thread Νίκος Γκρ33κ
Τη Κυριακή, 31 Μαρτίου 2013 11:21:21 μ.μ. UTC+3, ο χρήστης ru...@yahoo.com έγραψε: On 03/31/2013 02:08 PM, Νίκος Γκρ33κ wrote: But i look the code and run python via interactive prompt and it says it has no error. Does it produce any output? Is that output the right html?

Re: Help with python code!

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 7:10 AM, jojo gerrymcgov...@gmail.com wrote: Im used to C# so the syntax looks bizarre to me! Any help would be great. The first thing you'll need to understand about Python syntax is that indentation is important. By posting this code flush-left, you've actually destroyed

Re: Help with python code!

2013-03-31 Thread jojo
On Sunday, March 31, 2013 4:39:11 PM UTC-4, Chris Angelico wrote: On Mon, Apr 1, 2013 at 7:10 AM, jojo wrote: Im used to C# so the syntax looks bizarre to me! Any help would be great. The first thing you'll need to understand about Python syntax is that indentation is important. By

Re: Help with python code!

2013-03-31 Thread Roy Smith
In article 37f23623-8bf5-421a-ab6a-34ff622c6...@googlegroups.com, jojo gerrymcgov...@gmail.com wrote: Hi - I am a newbie to python and was wondering can someone tell me what the following code does. I need to figure out how to test it I know this is going to sound unhelpful, but if your task

Re: Help with python code!

2013-03-31 Thread Roy Smith
In article 2912c674-e30b-4339-9344-1f460cb96...@googlegroups.com, jojo gerrymcgov...@gmail.com wrote: for fname in dirList: cmd = keytool ­printcert ­file + fname for line in os.popen(cmd).readlines(): line = line.rstrip() m = p.search(line) if m: sue = time.mktime(

Re: Help with python code!

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 8:06 AM, jojo gerrymcgov...@gmail.com wrote: On Sunday, March 31, 2013 4:39:11 PM UTC-4, Chris Angelico wrote: On Mon, Apr 1, 2013 at 7:10 AM, jojo wrote: Im used to C# so the syntax looks bizarre to me! Any help would be great. The first thing you'll need to

Re: Help with python code!

2013-03-31 Thread gerrymcgovern
On Sunday, March 31, 2013 5:21:00 PM UTC-4, Chris Angelico wrote: On Mon, Apr 1, 2013 at 8:06 AM, jojo wrote: On Sunday, March 31, 2013 4:39:11 PM UTC-4, Chris Angelico wrote: On Mon, Apr 1, 2013 at 7:10 AM, jojo wrote: Im used to C# so the syntax looks bizarre to me! Any help

Re: Help with python code!

2013-03-31 Thread jojo
On Sunday, March 31, 2013 5:13:49 PM UTC-4, Roy Smith wrote: In article 2912c674-e30b-4339-9344-1f460cb96...@googlegroups.com, jojo wrote: for fname in dirList: cmd = keytool �printcert �file + fname for line in os.popen(cmd).readlines(): line = line.rstrip()

Re: Help with python code!

2013-03-31 Thread Roy Smith
In article 4455829d-5b4a-44ee-b65f-5f72d429b...@googlegroups.com, jojo gerrymcgov...@gmail.com wrote: Thanks for your replies. Just to be clear this is for a interview and they would like me to figure out what the code does and come back with some test cases. I don't need to code the tests,

Re: Help with python code!

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 8:21 AM, jojo gerrymcgov...@gmail.com wrote: Thanks for your replies. Just to be clear this is for a interview and they would like me to figure out what the code does and come back with some test cases That explains the utter lack of comments, then. In well-maintained

Re: Help with python code!

2013-03-31 Thread gerrymcgovern
On Sunday, March 31, 2013 5:27:06 PM UTC-4, Roy Smith wrote: In article 4455829d-5b4a-44ee-b65f-5f72d429b...@googlegroups.com, jojo wrote: Thanks for your replies. Just to be clear this is for a interview and they would like me to figure out what the code does and come back with

Re: Creating a dictionary from a .txt file

2013-03-31 Thread Dave Angel
On 03/31/2013 02:41 PM, Roy Smith wrote: In article mailman.4023.1364751102.2939.python-l...@python.org, Dave Angel da...@davea.name wrote: On 03/31/2013 12:52 PM, C.T. wrote: On Sunday, March 31, 2013 12:20:25 PM UTC-4, zipher wrote: SNIP Thank you, Mark! My problem is the data isn't

Re: Help with python code!

2013-03-31 Thread gerrymcgovern
On Sunday, March 31, 2013 5:35:38 PM UTC-4, Chris Angelico wrote: On Mon, Apr 1, 2013 at 8:21 AM, jojo wrote: Thanks for your replies. Just to be clear this is for a interview and they would like me to figure out what the code does and come back with some test cases That

Re: Help with python code!

2013-03-31 Thread rurpy
On Sunday, March 31, 2013 3:27:06 PM UTC-6, Roy Smith wrote: If this is for an interview, you really should be doing this on your own. I assume the point of the interview is to see how well you know Python. Please don't expect people here to take your interview for you. Maybe the

Re: Help with python code!

2013-03-31 Thread Mark Lawrence
On 31/03/2013 22:21, Chris Angelico wrote: sue = time.mktime( (int(m.group(7)), int(months[m.group(2)]), int(m.group(3)), int(m.group(4)), int(m.group(5)), int(m.group(6)), int(days[m.group(1)]), 0, 0) ) expire_time = (sue ­

Re: Sudoku

2013-03-31 Thread Eric Parry
On Sunday, March 31, 2013 9:45:36 AM UTC+10:30, Dave Angel wrote: On 03/30/2013 06:06 PM, Eric Parry wrote: On Saturday, March 30, 2013 8:41:08 AM UTC+10:30, Dave Angel wrote: On 03/29/2013 05:47 PM, Eric Parry wrote: SNIP Sometimes a bug in such a function will cause it

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Alex
Dave Angel wrote: On 03/31/2013 02:56 AM, morphex wrote: 1**2 1 1**2**3 1 1**2**3**4 1L 1**2**3**4**5 Traceback (most recent call last): File stdin, line 1, in module MemoryError Does anyone know why this raises a MemoryError? Doesn't make sense to

Re: Help with python code!

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 9:02 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 31/03/2013 22:21, Chris Angelico wrote: sue = time.mktime( (int(m.group(7)), int(months[m.group(2)]), int(m.group(3)), int(m.group(4)), int(m.group(5)), int(m.group(6)),

Re: Sudoku

2013-03-31 Thread Eric Parry
On Monday, April 1, 2013 8:33:47 AM UTC+10:30, Eric Parry wrote: On Sunday, March 31, 2013 9:45:36 AM UTC+10:30, Dave Angel wrote: On 03/30/2013 06:06 PM, Eric Parry wrote: On Saturday, March 30, 2013 8:41:08 AM UTC+10:30, Dave Angel wrote: On 03/29/2013 05:47 PM, Eric

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 9:06 AM, Alex foo@email.invalid wrote: Dave Angel wrote: On 03/31/2013 02:56 AM, morphex wrote: 1**2 1 1**2**3 1 1**2**3**4 1L 1**2**3**4**5 Traceback (most recent call last): File stdin, line 1, in module MemoryError Does anyone

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 9:28 AM, Chris Angelico ros...@gmail.com wrote: On Mon, Apr 1, 2013 at 9:06 AM, Alex foo@email.invalid wrote: Really? The Python 3 documentation (http://docs.python.org/3/reference/expressions.html) says in section 6.14 (Evaluation order) that Python evaluates

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Dave Angel
On 03/31/2013 06:06 PM, Alex wrote: Dave Angel wrote: On 03/31/2013 02:56 AM, morphex wrote: 1**2 1 1**2**3 1 1**2**3**4 1L 1**2**3**4**5 Traceback (most recent call last): File stdin, line 1, in module MemoryError Does anyone know why this raises a MemoryError? Doesn't make

Re: Sudoku

2013-03-31 Thread Dave Angel
On 03/31/2013 06:03 PM, Eric Parry wrote: SNIP I think in the original it was exit(a). That did not work either. There you go again. Did not work tells us very little. With my Python 2.7.2, exit(something) with something being a string prints the string and then exits. Nowhere have

Re: Sudoku

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 9:27 AM, Eric Parry joan4e...@gmail.com wrote: [ chomp 128 lines of quoted text ] I tried all those things. The program keeps running after the solution in every case. Never mind. It won't do that in VBA when I finish it. Eric. You have just spammed us with, and I

Re: Sudoku

2013-03-31 Thread Arnaud Delobelle
On 31 March 2013 23:34, Dave Angel da...@davea.name wrote: [...] With my Python 2.7.2, exit(something) with something being a string prints the string and then exits. Nowhere have I seen that documented, and I thought it either took an int or nothing. It is documented, just not exactly where

Re: collections.Iterator __subclasshook__ does not check if next() is callable

2013-03-31 Thread Ethan Furman
On 03/31/2013 10:57 AM, Byron Ruth wrote: I submitted this as bug last night: http://bugs.python.org/issue17584 and was *honored* to be rejected by Raymond Hettinger. However, I would like feedback on whether my concern (this bug) is justified and clarity if not. Consider: ```python class

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Alex
Chris Angelico wrote: Opening paragraph, ... exponentiation, which groups from right to left. It follows the obvious expectation from mathematics. (The OP is using Python 2, but the same applies.) Thanks. I did miss that parenthetical comment in para 6.15, and that would have been the

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 11:39 AM, Alex foo@email.invalid wrote: Given that 3 5 4 (i.e.: 4**5**3) is transitive, I would have expected Python to exhibit more consistency with the other operators. I guess that is one of the foolish consistencies that comprise the hobgoblins of my little

Re: Sudoku

2013-03-31 Thread Eric Parry
Sorry. Won't happen again. signing off this topic. Eric. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-03-31 Thread Steven D'Aprano
On Mon, 01 Apr 2013 00:39:56 +, Alex wrote: Chris Angelico wrote: Opening paragraph, ... exponentiation, which groups from right to left. It follows the obvious expectation from mathematics. (The OP is using Python 2, but the same applies.) Thanks. I did miss that parenthetical

executor.map() TypeError: zip argument #2 must support iteration

2013-03-31 Thread iMath
executor.map()TypeError: zip argument #2 must support iteration when I run it ,just generated TypeError: zip argument #2 must support iteration. can anyone help me fix this problem ? import time, concurrent.futures lst100=[i for i in range(100)] t1=time.clock() print(list(map(str,lst100)))

Help please

2013-03-31 Thread khaosyt
I want to add up the integers of this code in one line. For example, if I had the code integer = 0 denom = 10 again = y #sentinel: while again == y or again == Y: integer = input(Enter a positive integer: ) while denom = integer: denom = denom*10 while denom 1: denom

Re: Help please

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 4:15 PM, khao...@gmail.com wrote: integer = input(Enter a positive integer: ) again = raw_input(Again? (Y/N): ) Okay, the first thing I'm going to say is: Don't use input() in Python 2. It's dangerous in ways you won't realize. Use int(raw_input(...)) for

Re: Performance of int/long in Python 3

2013-03-31 Thread rusi
On Mar 31, 5:55 pm, Mark Lawrence breamore...@yahoo.co.uk wrote: snipped jmf's broken-record whine I'm feeling very sorry for this horse, it's been flogged so often it's down to bare bones. While I am now joining the camp of those fed up with jmf's whining, I do wonder if we are shooting the

Re: Help please

2013-03-31 Thread khaosyt
On Monday, April 1, 2013 1:24:52 AM UTC-4, Chris Angelico wrote: On Mon, Apr 1, 2013 at 4:15 PM, khao...@gmail.com wrote: integer = input(Enter a positive integer: ) again = raw_input(Again? (Y/N): ) Okay, the first thing I'm going to say is: Don't use input() in Python

Re: Performance of int/long in Python 3

2013-03-31 Thread Ian Kelly
On Sun, Mar 31, 2013 at 11:33 PM, rusi rustompm...@gmail.com wrote: So I really wonder: Is python losing more by supporting SMP with performance hit on BMP? I don't believe so. Although performance is undeniably worse for some benchmarks, it is also better for some others. Nobody has yet

[issue6649] idlelib/rpc.py missing exit status on exithook

2013-03-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset e044d22d2f61 by Roger Serwy in branch '2.7': #6649: Fixed missing exit status in IDLE. Patch by Guilherme Polo. http://hg.python.org/cpython/rev/e044d22d2f61 New changeset cd2c613527ed by Roger Serwy in branch '3.3': #6649: Fixed missing exit

[issue6649] idlelib/rpc.py missing exit status on exithook

2013-03-31 Thread Roger Serwy
Roger Serwy added the comment: Thanks for the patch, Guilherme! -- resolution: - fixed stage: - committed/rejected status: open - closed versions: +Python 3.3, Python 3.4 -Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org

[issue15494] Move test/support.py into a test.support subpackage

2013-03-31 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, it was only when we went to add test.pkg_helper (so that test_runpy and test_pkgutil could share it) that we put the brakes on and decided to stop making a bad situation worse and do something different. There are probably some other helpers we could spin

[issue17585] IDLE - regression with exit() and quit()

2013-03-31 Thread Roger Serwy
New submission from Roger Serwy: This issue is a split from #5492, where Terry noticed a serious regression that quit() and exit() no longer work in IDLE. Before #9290, the PyShell object itself was stdin and it didn't have a fileno method. The code in site.py would skip over the call to

[issue17585] IDLE - regression with exit() and quit()

2013-03-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: I thought of this exact patch, but then decided against it. 1. The bug is in site.py -- see thread [Python-Dev] Idle, site.py, and the release candidates for a better explanation and solution. 2. The Idle behavior, inherited from io.IOBase is correct. 3. The

[issue17585] IDLE - regression with exit() and quit()

2013-03-31 Thread Roger Serwy
Roger Serwy added the comment: I agree that site.py's Quitter exception logic has a flaw as described on the email from python-dev. But I disagree that the problem of IDLE not exiting is due to site.py. Even if you fix site.py (which I did), calling sys.stdin.close() won't close IDLE since

[issue15494] Move test/support.py into a test.support subpackage

2013-03-31 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15494 ___ ___ Python-bugs-list

[issue16887] IDLE - tabify/untabify applied when clicking Cancel

2013-03-31 Thread Roger Serwy
Roger Serwy added the comment: If there are no objections, I will apply this patch after 2013-04-05. -- assignee: - roger.serwy versions: -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16887

[issue17546] Document the circumstances where the locals() dict get updated

2013-03-31 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17546 ___ ___ Python-bugs-list

[issue17586] fix typo in contextlib.rst

2013-03-31 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- assignee: docs@python components: Documentation files: typo.diff keywords: patch nosy: docs@python, tshepang priority: normal severity: normal status: open title: fix typo in contextlib.rst versions: Python 3.4 Added file:

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-31 Thread Mark Dickinson
Mark Dickinson added the comment: Amaury, why do you mention -R flag He's talking about the -R argument to regrtest: -R runs each test several times and examines sys.gettotalrefcount() to see if the test appears to be leaking references. The argument should be of the form stab:run:fname

[issue17583] IDLE HOWTO

2013-03-31 Thread Amit Saha
Amit Saha added the comment: Hi Todd, I just signed the Python contributor agreement electronically. You probably missed the link to the rSt source in my original report. Here it is [1]. I would want this HOWTO to cover all aspects of IDLE from an user's perspective. I have some ideas

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-31 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the updated patch. Some comments: - In the tests, your functions should have return type PyObject* rather than void; you can use Py_RETURN_NONE as a convenient way to return something of the correct type. E.g.: static PyObject *

[issue10044] small int optimization

2013-03-31 Thread Mark Dickinson
Mark Dickinson added the comment: Do we need to keep this issue open while this research is being carried out? I'd say not. -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-31 Thread Mark Shannon
Mark Shannon added the comment: Mark, it was written 20 years ago. Who knows (or cares) why it was written that way? Let's just write it correctly this time. Py_INCREF, Py_DECREF, Py_XDECREF and Py_XINCREF should all expand their argument exactly once. Py_CLEAR should expand its argument

[issue17585] IDLE - regression with exit() and quit()

2013-03-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: I see that now. Then both files should be fixed. I still object to introducing a buggy .fileno ;-). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17585

[issue17583] IDLE HOWTO

2013-03-31 Thread Todd Rovito
Todd Rovito added the comment: Yes I missed the link sorry. Can you add the rst file to Doc/faq in the tip of the repository then do a hg diff and post the patch as an attachment to this issue? At that point I will review and send any changes or edits with the review system. Others can

[issue17587] Have all core library modules imported by default

2013-03-31 Thread Daniel Ellis
New submission from Daniel Ellis: The other day I was trying to make a script to import a CSV file but for the life of me couldn't remember what the name of the csv library was (turns out it was csv). So I started thinking hey, what if all the standard library were just *there* by default?

[issue17587] Have all core library modules imported by default

2013-03-31 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17587 ___

  1   2   >