Re: mutable ints: I think I have painted myself into a corner

2013-05-20 Thread Cameron Simpson
On 19May2013 09:01, Peter Otten __pete...@web.de wrote: | Cameron Simpson wrote: | | TL;DR: I think I want to modify an int value in place. | | Yesterday I was thinking about various flag set objects I have | floating around which are essentially bare objects whose attributes | I access,

Re: mutable ints: I think I have painted myself into a corner

2013-05-20 Thread Cameron Simpson
On 20May2013 13:23, Greg Ewing greg.ew...@canterbury.ac.nz wrote: | Cameron Simpson wrote: | It's an int _subclass_ so that it is no bigger than an int. | | If you use __slots__ to eliminate the overhead of an | instance dict, you'll get an object consisting of a | header plus one reference,

Re: Please help with Threading

2013-05-20 Thread Fábio Santos
On 18 May 2013 20:33, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: Python threads work fine if the threads either rely on intelligent DLLs for number crunching (instead of doing nested Python loops to process a numeric array you pass it to something like NumPy which releases the GIL

Re: Future standard GUI library

2013-05-20 Thread Terry Jan Reedy
On 5/20/2013 1:04 AM, Vito De Tullio wrote: Terry Jan Reedy wrote: Do you think tkinter is going to be the standard python built-in gui solution as long as python exists? AT the moment, there is nothing really comparable that is a realistic candidate to replace tkinter. FLTK?

Question about ast.literal_eval

2013-05-20 Thread Frank Millman
Hi all I am trying to emulate a SQL check constraint in Python. Quoting from the PostgreSQL docs, A check constraint is the most generic constraint type. It allows you to specify that the value in a certain column must satisfy a Boolean (truth-value) expression. The problem is that I want

CFP: MuCoCoS Workshop at PACT-2013 (Edinburgh, Scotland, UK)

2013-05-20 Thread SP
CALL FOR PAPERS: 6th International Workshop on Multi/many-Core Computing Systems (MuCoCoS-2013) September 7, 2013, Edinburgh, Scotland, UK in conjunction with the 22nd Int. Conference on Parallel Architectures and Compilation

RE: Question about ast.literal_eval

2013-05-20 Thread Carlos Nepomuceno
It seems to me you can't use ast.literal_eval()[1] to evaluate that kind of expression because it's just for literals[2]. Why don't you use eval()? [1] http://docs.python.org/2/library/ast.html#ast-helpers [2] http://docs.python.org/2/reference/lexical_analysis.html#literals

Re: Question about ast.literal_eval

2013-05-20 Thread Chris Angelico
On Mon, May 20, 2013 at 5:05 PM, Frank Millman fr...@chagford.com wrote: Hi all I am trying to emulate a SQL check constraint in Python. Quoting from the PostgreSQL docs, A check constraint is the most generic constraint type. It allows you to specify that the value in a certain column must

Re: How to run a python script twice randomly in a day?

2013-05-20 Thread Cameron Simpson
On 20May2013 09:47, Avnesh Shakya avnesh.n...@gmail.com wrote: | On Mon, May 20, 2013 at 9:42 AM, Cameron Simpson c...@zip.com.au wrote: | On 19May2013 20:54, Avnesh Shakya avnesh.n...@gmail.com wrote: | |How to run a python script twice randomly in a day? Actually | | I want to run my

Re: Please help with Threading

2013-05-20 Thread Cameron Simpson
On 20May2013 07:25, Fábio Santos fabiosantos...@gmail.com wrote: | On 18 May 2013 20:33, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: | Python threads work fine if the threads either rely on intelligent | DLLs for number crunching (instead of doing nested Python loops to | process a

RE: Please help with Threading

2013-05-20 Thread Carlos Nepomuceno
Date: Sun, 19 May 2013 13:10:36 +1000 From: c...@zip.com.au To: carlosnepomuc...@outlook.com CC: python-list@python.org Subject: Re: Please help with Threading On 19May2013 03:02, Carlos Nepomuceno carlosnepomuc...@outlook.com wrote: | Just been

Re: Question about ast.literal_eval

2013-05-20 Thread Frank Millman
[Corrected top-posting] To: python-list@python.org From: fr...@chagford.com Subject: Question about ast.literal_eval Date: Mon, 20 May 2013 09:05:48 +0200 Hi all I am trying to emulate a SQL check constraint in Python. Quoting from the PostgreSQL docs, A check constraint is the most generic

RE: Please help with Threading

2013-05-20 Thread Carlos Nepomuceno
Date: Mon, 20 May 2013 17:45:14 +1000 From: c...@zip.com.au To: fabiosantos...@gmail.com Subject: Re: Please help with Threading CC: python-list@python.org; wlfr...@ix.netcom.com On 20May2013 07:25, Fábio Santos fabiosantos...@gmail.com wrote: | On

Re: Question about ast.literal_eval

2013-05-20 Thread Chris Angelico
On Mon, May 20, 2013 at 5:50 PM, Frank Millman fr...@chagford.com wrote: On 20/05/2013 09:34, Carlos Nepomuceno wrote: Why don't you use eval()? Because users can create their own columns, with their own constraints. Therefore the string is user-modifiable, so it cannot be trusted. Plenty

Re: Please help with Threading

2013-05-20 Thread Fábio Santos
My use case was a tight loop processing an image pixel by pixel, or crunching a CSV file. If it only uses local variables (and probably hold a lock before releasing the GIL) it should be safe, no? My idea is that it's a little bad to have to write C or use multiprocessing just to do simultaneous

RE: Question about ast.literal_eval

2013-05-20 Thread Carlos Nepomuceno
To: python-list@python.org From: fr...@chagford.com Subject: Re: Question about ast.literal_eval Date: Mon, 20 May 2013 09:50:02 +0200 [Corrected top-posting] To: python-list@python.org From: fr...@chagford.com Subject: Question about

Re: Question about ast.literal_eval

2013-05-20 Thread Frank Millman
On 20/05/2013 09:55, Chris Angelico wrote: On Mon, May 20, 2013 at 5:50 PM, Frank Millman fr...@chagford.com wrote: On 20/05/2013 09:34, Carlos Nepomuceno wrote: Why don't you use eval()? Because users can create their own columns, with their own constraints. Therefore the string is

Re: Question about ast.literal_eval

2013-05-20 Thread Chris Angelico
On Mon, May 20, 2013 at 5:55 PM, Carlos Nepomuceno carlosnepomuc...@outlook.com wrote: I understand your motivation but I don't know what protection ast.literal_eval() is offering that eval() doesn't. eval will *execute code*, while literal_eval will not. That's the protection. With

Re: Question about ast.literal_eval

2013-05-20 Thread Frank Millman
On 20/05/2013 09:55, Carlos Nepomuceno wrote: Why don't you use eval()? Because users can create their own columns, with their own constraints. Therefore the string is user-modifiable, so it cannot be trusted. I understand your motivation but I

Re: Question about ast.literal_eval

2013-05-20 Thread Steven D'Aprano
On Mon, 20 May 2013 10:55:35 +0300, Carlos Nepomuceno wrote: I understand your motivation but I don't know what protection ast.literal_eval() is offering that eval() doesn't. eval will evaluate any legal Python expression: py eval(__import__('os').system('echo Mwahaha! Now you are pwned!')

Re: Please help with Threading

2013-05-20 Thread Cameron Simpson
On 20May2013 10:53, Carlos Nepomuceno carlosnepomuc...@outlook.com wrote: | I just got my hands dirty trying to synchronize Python prints from many threads. | Sometimes they mess up when printing the newlines. | I tried several approaches using threading.Lock and Condition. | None of them worked

Re: Question about ast.literal_eval

2013-05-20 Thread Fábio Santos
On 20 May 2013 09:19, Frank Millman fr...@chagford.com wrote: Quoting from the manual - Safely evaluate an expression node or a string containing a Python expression. The string or node provided may only consist of the following Python literal structures: strings, bytes, numbers, tuples, lists,

Re: Please help with Threading

2013-05-20 Thread Chris Angelico
On Mon, May 20, 2013 at 6:35 PM, Cameron Simpson c...@zip.com.au wrote: _lock = Lock() def lprint(*a, **kw): global _lock with _lock: print(*a, **kw) and use lprint() everywhere? Fun little hack: def print(*args,print=print,lock=Lock(),**kwargs): with lock:

Re: Diacretical incensitive search

2013-05-20 Thread Jorgen Grahn
On Fri, 2013-05-17, Olive wrote: One feature that seems to be missing in the re module (or any tools that I know for searching text) is diacretical incensitive search. I would like to have a match for something like this: re.match(franc, français) ... The algorithm to write such a function

Re: Future standard GUI library

2013-05-20 Thread Robert Kern
On 2013-05-20 08:00, Terry Jan Reedy wrote: On 5/20/2013 1:04 AM, Vito De Tullio wrote: Terry Jan Reedy wrote: Do you think tkinter is going to be the standard python built-in gui solution as long as python exists? AT the moment, there is nothing really comparable that is a realistic

Re: Please help with Threading

2013-05-20 Thread Fábio Santos
It is pretty cool although it looks like a recursive function at first ;) On 20 May 2013 10:13, Chris Angelico ros...@gmail.com wrote: On Mon, May 20, 2013 at 6:35 PM, Cameron Simpson c...@zip.com.au wrote: _lock = Lock() def lprint(*a, **kw): global _lock with _lock:

Re: Please help with Threading

2013-05-20 Thread Cameron Simpson
On 20May2013 19:09, Chris Angelico ros...@gmail.com wrote: | On Mon, May 20, 2013 at 6:35 PM, Cameron Simpson c...@zip.com.au wrote: |_lock = Lock() | |def lprint(*a, **kw): | global _lock | with _lock: |print(*a, **kw) | | and use lprint() everywhere? | | Fun little

RE: Please help with Threading

2013-05-20 Thread Carlos Nepomuceno
Date: Mon, 20 May 2013 18:35:20 +1000 From: c...@zip.com.au To: carlosnepomuc...@outlook.com CC: python-list@python.org Subject: Re: Please help with Threading On 20May2013 10:53, Carlos Nepomuceno carlosnepomuc...@outlook.com wrote: | I just got my

Re: Please help with Threading

2013-05-20 Thread Chris Angelico
On Mon, May 20, 2013 at 7:54 PM, Cameron Simpson c...@zip.com.au wrote: On 20May2013 19:09, Chris Angelico ros...@gmail.com wrote: | On Mon, May 20, 2013 at 6:35 PM, Cameron Simpson c...@zip.com.au wrote: |_lock = Lock() | |def lprint(*a, **kw): | global _lock | with

Re: Future standard GUI library

2013-05-20 Thread Kevin Walzer
On 5/20/13 1:04 AM, Vito De Tullio wrote: FLTK? (http://www.fltk.org/index.php) FLTK is even uglier than non-themed Tkinter: non-native on every platform. Tkinter wraps native widgets on MacOS and WIndows, but FLTK draws its own widgets everywhere. -- Kevin Walzer Code by Kevin/Mobile Code

RE: How to write fast into a file in python?

2013-05-20 Thread Carlos Nepomuceno
Oh well! Just got a flashback from the old times at the 8-bit assembly line. Dirty deeds done dirt cheap! lol Date: Sun, 19 May 2013 16:44:55 +0100 From: pyt...@mrabarnett.plus.com To: python-list@python.org Subject: Re: How to write fast into a file

Re: Please help with Threading

2013-05-20 Thread Ned Batchelder
On 5/20/2013 6:09 AM, Chris Angelico wrote: Referencing a function's own name in a default has to have one of these interpretations: 1) It's a self-reference, which can be used to guarantee recursion even if the name is rebound 2) It references whatever previously held that name before this def

Re: Please help with Threading

2013-05-20 Thread Dave Angel
On 05/20/2013 03:55 AM, Fábio Santos wrote: My use case was a tight loop processing an image pixel by pixel, or crunching a CSV file. If it only uses local variables (and probably hold a lock before releasing the GIL) it should be safe, no? Are you making function calls, using system

Re: Question about ast.literal_eval

2013-05-20 Thread Frank Millman
On 20/05/2013 10:07, Frank Millman wrote: On 20/05/2013 09:55, Chris Angelico wrote: Is it a requirement that they be able to key in a constraint as a single string? We have a similar situation in one of the systems at work, so we divided the input into three(ish) parts: pick a field, pick an

Re: Please help with Threading

2013-05-20 Thread Chris Angelico
=On Mon, May 20, 2013 at 8:46 PM, Ned Batchelder n...@nedbatchelder.com wrote: On 5/20/2013 6:09 AM, Chris Angelico wrote: Referencing a function's own name in a default has to have one of these interpretations: 1) It's a self-reference, which can be used to guarantee recursion even if the

Re: Question about ast.literal_eval

2013-05-20 Thread Steven D'Aprano
On Mon, 20 May 2013 15:26:02 +0200, Frank Millman wrote: Can anyone see anything wrong with the following approach. I have not definitely decided to do it this way, but I have been experimenting and it seems to work. I store the boolean test as a json'd list of 6-part tuples. Each element

Re: Question about ast.literal_eval

2013-05-20 Thread Chris Angelico
On Mon, May 20, 2013 at 11:26 PM, Frank Millman fr...@chagford.com wrote: 0 - for the first entry in the list, the word 'check' (a placeholder - it is discarded at evaluation time), for any subsequent entries the word 'and' or 'or'. 1 - left bracket - either '(' or ''. 5 - right bracket -

Re: Question about ast.literal_eval

2013-05-20 Thread Chris Angelico
On Tue, May 21, 2013 at 2:12 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Personally, I would strongly suggest writing your own mini- evaluator that walks the list and evaluates it by hand. It isn't as convenient as just calling eval, but *definitely* safer. Probably faster,

Re: Harmonic distortion of a input signal

2013-05-20 Thread jmfauth
Non sense. The discrete fft algorithm is valid only if the number of data points you transform does correspond to a power of 2 (2**n). Keywords to the problem: apodization, zero filling, convolution product, ... eg. http://en.wikipedia.org/wiki/Convolution jmf --

Re: Harmonic distortion of a input signal

2013-05-20 Thread Christian Gollwitzer
Am 20.05.13 19:23, schrieb jmfauth: Non sense. Dito. The discrete fft algorithm is valid only if the number of data points you transform does correspond to a power of 2 (2**n). Where did you get this? The DFT is defined for any integer point number the same way. Just if you want to get

Re: Harmonic distortion of a input signal

2013-05-20 Thread Christian Gollwitzer
Oops, I thought we were posting to comp.dsp. Nevertheless, I think numpy.fft does mixed-radix (can't check it now) Am 20.05.13 19:50, schrieb Christian Gollwitzer: Am 20.05.13 19:23, schrieb jmfauth: Non sense. Dito. The discrete fft algorithm is valid only if the number of data points

pip and different branches?

2013-05-20 Thread andrea crotti
We use github and we work on many different branches at the same time. The problem is that we have 5 repos now, and for each repo we might have the same branches on all of them. Now we use pip and install requirements such as: git+ssh://g...@github.com/repo.git@dev Now the problem is that the

Re: Please help with Threading

2013-05-20 Thread Fábio Santos
I didn't know that. On 20 May 2013 12:10, Dave Angel da...@davea.name wrote: Are you making function calls, using system libraries, or creating or deleting any objects? All of these use the GIL because they use common data structures shared among all threads. At the lowest level, creating an

Re: What was the project that made you feel skilled in Python?

2013-05-20 Thread Demian Brecht
TBH, I think that the first thing that I did that made me feel that I could hold my own was when I had my first (and only thus far) patch accepted into the stdlib. To me, there's a /big/ difference between throwing together a package that a few people may find useful and putting a patch together

Re: What was the project that made you feel skilled in Python?

2013-05-20 Thread Thomas Murphy
Hi Demian, Can I ask what you mean by working through the stdlib? As in writing code pieces utilizing each module from the stdlib? Also, you're talking about patches in the stdlib? Is there a separate library of patches? Forgive me if I'm google-failing hard over here. --

Re: What was the project that made you feel skilled in Python?

2013-05-20 Thread Terry Jan Reedy
On 5/20/2013 3:36 PM, Thomas Murphy wrote: talking about patches in the stdlib? Is there a separate library of patches? http://bugs.python.org http://docs.python.org/devguide/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Future standard GUI library

2013-05-20 Thread Grant Edwards
On 2013-05-20, Terry Jan Reedy tjre...@udel.edu wrote: On 5/20/2013 1:04 AM, Vito De Tullio wrote: Terry Jan Reedy wrote: Do you think tkinter is going to be the standard python built-in gui solution as long as python exists? AT the moment, there is nothing really comparable that is a

Re: Please help with Threading

2013-05-20 Thread 88888 Dihedral
Chris Angelico於 2013年5月20日星期一UTC+8下午5時09分13秒寫道: On Mon, May 20, 2013 at 6:35 PM, Cameron Simpson c...@zip.com.au wrote: _lock = Lock() def lprint(*a, **kw): global _lock with _lock: print(*a, **kw) and use lprint() everywhere? Fun little

Re: Please help with Threading

2013-05-20 Thread Chris Angelico
On Tue, May 21, 2013 at 11:44 AM, 8 Dihedral dihedral88...@googlemail.com wrote: OK, if the python interpreter has a global hiden print out buffer of ,say, 2to 16 K bytes, and all string print functions just construct the output string from the format to this string in an efficient low

Re: Question about ast.literal_eval

2013-05-20 Thread matt . newville
On Monday, May 20, 2013 2:05:48 AM UTC-5, Frank Millman wrote: Hi all I am trying to emulate a SQL check constraint in Python. Quoting from the PostgreSQL docs, A check constraint is the most generic constraint type. It allows you to specify that the value in a certain column must

RE: Please help with Threading

2013-05-20 Thread Carlos Nepomuceno
sys.stdout.write() does not suffer from the newlines mess up when printing from many threads, like print statement does. The only usage difference, AFAIK, is to add '\n' at the end of the string. It's faster and thread safe (really?) by default. BTW, why I didn't find the source code to the

Re: How to run a python script twice randomly in a day?

2013-05-20 Thread Cameron Simpson
On 20May2013 15:05, Avnesh Shakya avnesh.n...@gmail.com wrote: | Thanks a lot. No worries, but ... AGAIN: - please DO NOT top post. Post below, trimming the quoted material. - please POST TO THE LIST, not just to me. This is a public discussion. Now... | I did something. | I have created

RE: Please help with Threading

2013-05-20 Thread Carlos Nepomuceno
On Tue, May 21, 2013 at 11:44 AM, 8 Dihedral dihedral88...@googlemail.com wrote: OK, if the python interpreter has a global hiden print out buffer of ,say, 2to 16 K bytes, and all string print functions just construct the output string from the format to this string in an efficient low

Re: How to run a python script twice randomly in a day?

2013-05-20 Thread Avnesh Shakya
Thanks a lot. I got it. On Tue, May 21, 2013 at 6:42 AM, Cameron Simpson c...@zip.com.au wrote: On 20May2013 15:05, Avnesh Shakya avnesh.n...@gmail.com wrote: | Thanks a lot. No worries, but ... AGAIN: - please DO NOT top post. Post below, trimming the quoted material. - please POST

Re: Please help with Threading

2013-05-20 Thread Steven D'Aprano
On Tue, 21 May 2013 05:53:46 +0300, Carlos Nepomuceno wrote: BTW, why I didn't find the source code to the sys module in the 'Lib' directory? Because sys is a built-in module. It is embedded in the Python interpreter. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

PEP 378: Format Specifier for Thousands Separator

2013-05-20 Thread Carlos Nepomuceno
Is there a way to format integers with thousands separator (digit grouping) like the format specifier of str.format()? I'm currently using the following: sys.stdout.write('Number = %s\n' % '{:,.0f}'.format(x)) Number = 12,345 'x' is unsigned integer so it's like using a sledgehammer to crack

Re: PEP 378: Format Specifier for Thousands Separator

2013-05-20 Thread Ned Deily
In article blu176-w10190cb892a0414c988a05d7...@phx.gbl, Carlos Nepomuceno carlosnepomuc...@outlook.com wrote: Is there a way to format integers with thousands separator (digit grouping) like the format specifier of str.format()? I'm currently using the following: sys.stdout.write('Number

Re: Question about ast.literal_eval

2013-05-20 Thread Frank Millman
On 21/05/2013 04:39, matt.newvi...@gmail.com wrote: You might find the asteval module (https://pypi.python.org/pypi/asteval) useful. It provides a relatively safe eval, for example: import asteval a = asteval.Interpreter() a.eval('x = abc') a.eval('x in (abc, xyz)')

[issue16024] Doc cleanup regarding path=fd, dir_fd, follow_symlinks, etc

2013-05-20 Thread Larry Hastings
Larry Hastings added the comment: I would, but I can't get it to apply cleanly, either to tip or to historical revisions back in Sepember. Kaleb, what revision is the branch that you generated the diff from? -- ___ Python tracker

[issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception

2013-05-20 Thread Mark Dickinson
Mark Dickinson added the comment: David: not sure. I don't think I'd go for it---I think the cure is worse than the disease. I think the FAQ is why it fails when the extend succeeds Agreed. -- ___ Python tracker rep...@bugs.python.org

[issue18020] html.escape 10x slower than cgi.escape

2013-05-20 Thread Florent Xicluna
New submission from Florent Xicluna: I noticed the convenient ``html.escape`` in Python 3.2 and ``cgi.escape`` is marked as deprecated. However, the former is an order of magnitude slower than the latter. $ python3 --version Python 3.3.2 With html.escape: $ python3 -m timeit -s from html

[issue16611] multiple problems with Cookie.py

2013-05-20 Thread Florent Xicluna
Florent Xicluna added the comment: Eric, this last one is not a bug in Cookie. This is a limitation with Python 2. See #18012. -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16611

[issue18020] html.escape 10x slower than cgi.escape

2013-05-20 Thread Graham Dumpleton
Graham Dumpleton added the comment: Importing the cgi module the first time even in Python 2.X was always very expensive. I would suggest you redo the test using timing done inside of the script after modules have been imported so as to properly separate module import time in both cases from

[issue18020] html.escape 10x slower than cgi.escape

2013-05-20 Thread Florent Xicluna
Florent Xicluna added the comment: I would suggest you redo the test using timing done inside of the script after modules have been imported. The -s switch takes care of this. -- ___ Python tracker rep...@bugs.python.org

[issue17976] file.write doesn't raise IOError when it should

2013-05-20 Thread Jaakko Moisio
Jaakko Moisio added the comment: The test pass with Python 3 which does not use the FILE* API anymore. So you should maybe migrate to Python 3 :-) Yes. I will eventually. But not all the libraries I'm using are migrated yet. -- Added file:

[issue16024] Doc cleanup regarding path=fd, dir_fd, follow_symlinks, etc

2013-05-20 Thread Larry Hastings
Larry Hastings added the comment: p.s. Thanks for reviving the patch. I forgot about this one! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16024 ___

[issue18020] html.escape 10x slower than cgi.escape

2013-05-20 Thread Graham Dumpleton
Graham Dumpleton added the comment: Whoops. Missed the quoting. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18020 ___ ___ Python-bugs-list

[issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception

2013-05-20 Thread Ronald Oussoren
Ronald Oussoren added the comment: David: your update to the FAQ looks ok to me. I don't like updating the __setitem__ of tuple to allow setting an identical value (that is 'a[0] = a[0]'), it is a bit too magic to my taste and hides the real problem. I'd slightly prefer my idea: update the

[issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception

2013-05-20 Thread Mark Dickinson
Mark Dickinson added the comment: it is a bit too magic to my taste and hides the real problem. Agreed. I do wonder whether there's a solution that allows the operation to succeed, though. -- ___ Python tracker rep...@bugs.python.org

[issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception

2013-05-20 Thread Ronald Oussoren
Ronald Oussoren added the comment: issue-17973-experimental.txt is a very crude first attempt at catching augment assignment to an immutable LHS. On first glance the code works, but it causes problems in the test suite and hence isn't correct yet. The generated code also isn't optimal, the

[issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception

2013-05-20 Thread Ronald Oussoren
Ronald Oussoren added the comment: Allowing the operation to succeed wouldn't be right, you are assigning to an immutable location after all. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17973

[issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception

2013-05-20 Thread Mark Dickinson
Mark Dickinson added the comment: Unfortunately, I don't think the checking first approach can work either: in the case where the object *does* accept assignments, it will now be assigned to twice. If there are side-effects from those assignments, then that will change behaviour. An

[issue18011] Inconsistency between b32decode() documentation, docstring and code

2013-05-20 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18011 ___ ___ Python-bugs-list

[issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception

2013-05-20 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17973 ___ ___

[issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception

2013-05-20 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: what if we try the assignment, and catch TypeError only if __iadd__ returned self? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17973

[issue17914] add os.cpu_count()

2013-05-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5e0c56557390 by Charles-Francois Natali in branch 'default': Issue #17914: Add os.cpu_count(). Patch by Yogesh Chaudhari, based on an http://hg.python.org/cpython/rev/5e0c56557390 -- nosy: +python-dev

[issue17024] cElementTree calls end() on parser taget even if start() fails

2013-05-20 Thread Eli Bendersky
Eli Bendersky added the comment: Yes, it doesn't seem that expat cares too much about propagating errors from every single handler. Digging in its code comments, it says that even when XML_StopParser is called, some event handlers (like the one for end element) may still be called since

[issue17914] add os.cpu_count()

2013-05-20 Thread Charles-François Natali
Charles-François Natali added the comment: Alright, committed. Yogesh, thanks for the patch! I'm attaching a patch to replace several occurrences of multiprocessing.cpu_count() by os.cpu_count() in the stdlib/test suite. -- Added file:

[issue7214] TreeBuilder.end(tag) differs between cElementTree and ElementTree

2013-05-20 Thread Eli Bendersky
Eli Bendersky added the comment: TreeBuilder is an interface users can implement. As such, 'tag' is a convenience the user-defined tree builder can use, as in: class Target(object): def start(self, tag, attrib): print('i see start', tag) def end(self, tag): print('i

[issue17914] add os.cpu_count()

2013-05-20 Thread STINNER Victor
STINNER Victor added the comment: In my patch cpu_count.patch, I changed posix_cpu_count(): * rewrite Mac OS X implementation: code in 5e0c56557390 looks wrong. It gets a MIB but then don't use it when calling _bsd_cpu_count(). But I didn't check my patch nor the commit version on Mac OS X.

[issue18021] Update broken link to Apple Publication Style Guide

2013-05-20 Thread Madison May
New submission from Madison May: The links at http://docs.python.org/devguide/documenting.html#building-doc and http://docs.python.org/devguide/docquality.html to http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2009.pdf lead to a Page Not Found

[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2013-05-20 Thread Eli Bendersky
Eli Bendersky added the comment: In 3.3+ there's no distinction between wide and narrow builds. Does anyone know how this should be affected? [I don't know much about unicode and encodings, unfortunately] -- ___ Python tracker

[issue14009] Clearer documentation for cElementTree

2013-05-20 Thread Eli Bendersky
Eli Bendersky added the comment: The ET docs have been significantly revamped in 3.3 I don't think cET needs to be documented. It's just confusing. -- resolution: - wont fix stage: commit review - committed/rejected status: open - closed ___ Python

[issue18021] Update broken link to Apple Publication Style Guide

2013-05-20 Thread Madison May
Changes by Madison May madison@students.olin.edu: -- type: enhancement - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18021 ___ ___

[issue17900] Recursive OrderedDict pickling

2013-05-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17900 ___ ___ Python-bugs-list mailing list

[issue18022] Inconsistency between quopri.decodestring() and email.quoprimime.decode()

2013-05-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: import quopri, email.quoprimime quopri.decodestring(b'==41') b'=41' email.quoprimime.decode('==41') '=A' I don't see a rule about double '=' in RFC 1521-1522 or RFCs 2045-2047 and I think quopri is wrong. Other half of this bug (encoding '=' as '==')

[issue17955] Minor updates to Functional HOWTO

2013-05-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 20409786cf8e by Andrew Kuchling in branch 'default': #17955: minor updates to Functional howto http://hg.python.org/cpython/rev/20409786cf8e -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org

[issue17955] Minor updates to Functional HOWTO

2013-05-20 Thread A.M. Kuchling
Changes by A.M. Kuchling li...@amk.ca: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17955 ___ ___

[issue17955] Minor updates to Functional HOWTO

2013-05-20 Thread A.M. Kuchling
Changes by A.M. Kuchling li...@amk.ca: -- stage: commit review - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17955 ___ ___

[issue18003] New lzma crazy slow with line-oriented reading.

2013-05-20 Thread Michael Fox
Michael Fox added the comment: I was thinking about this line: end = self._buffer.find(b\n, self._buffer_offset) + 1 Might be a bug? For example, is there a unicode where one of several bytes is '\n'? In this case it splits the line in the middle of a character, right? On Sun, May 19, 2013 at

[issue8743] set() operators don't work with collections.Set instances

2013-05-20 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8743 ___ ___ Python-bugs-list mailing

[issue2226] Small _abcoll Bugs / Oddities

2013-05-20 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2226 ___ ___ Python-bugs-list mailing

[issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception

2013-05-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset b363473cfe9c by R David Murray in branch '3.3': #17973: Add FAQ entry for ([],)[0] += [1] both extending and raising. http://hg.python.org/cpython/rev/b363473cfe9c New changeset 6d2f0edb0758 by R David Murray in branch 'default': Merge #17973: Add

[issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception

2013-05-20 Thread R. David Murray
R. David Murray added the comment: You still have the side effect problem, as far as I can see. I'm going to close this doc issue, if you guys do come up with some clever fix, you can reopen it again :) -- resolution: - fixed stage: patch review - committed/rejected status: open -

[issue18003] New lzma crazy slow with line-oriented reading.

2013-05-20 Thread Nadeem Vawda
Nadeem Vawda added the comment: No, that is the intended behavior for binary streams - they operate at the level of individual byes. If you want to treat your input file as Unicode-encoded text, you should open it in text mode. This will return a TextIOWrapper which handles the decoding and line

[issue9189] Improve CFLAGS handling

2013-05-20 Thread Jed Brown
Jed Brown added the comment: Undefined variables are still a problem: $ echo 'FROTZ = ${CFLAGS}' make.py3 $ python3 Python 3.3.1 (default, Apr 6 2013, 19:03:55) [GCC 4.8.0] on linux Type help, copyright, credits or license for more information. import distutils.sysconfig

[issue2226] Small _abcoll Bugs / Oddities

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

[issue17914] add os.cpu_count()

2013-05-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset a85ac58e9eaf by Charles-Francois Natali in branch 'default': Issue #17914: Remove OS-X special-case, and use the correct int type. http://hg.python.org/cpython/rev/a85ac58e9eaf -- ___ Python tracker

[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2013-05-20 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: encoding=GBK causes a buffer overflow in PyUnknownEncodingHandler, because the result of PyUnicode_Decode() is only 192 characters long. Exact behavior is not defined... -- ___ Python tracker

[issue17914] add os.cpu_count()

2013-05-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset f9d815522cdb by Charles-Francois Natali in branch 'default': Issue #17914: We can now inline _bsd_cpu_count(). http://hg.python.org/cpython/rev/f9d815522cdb -- ___ Python tracker rep...@bugs.python.org

  1   2   >