[issue23197] asyncio: check if a future is cancelled before calling set_result/set_exception

2015-01-08 Thread STINNER Victor
New submission from STINNER Victor: set_result/set_exception methods of an asyncio.Future raise an exception if the future is cancelled. Attached patch adds the check in 3 remaining places. -- components: asyncio files: asyncio.patch keywords: patch messages: 233699 nosy: gvanrossum,

Re: Can numpy do better than this?

2015-01-08 Thread Rustom Mody
On Friday, January 9, 2015 at 6:43:45 AM UTC+5:30, Rustom Mody wrote: On Friday, January 9, 2015 at 12:58:52 AM UTC+5:30, Ian wrote: On Thu, Jan 8, 2015 at 10:56 AM, Rustom Mody wrote: Given a matrix I want to shift the 1st column 0 (ie leave as is) 2nd by one place, 3rd by 2 places etc.

[issue23200] Clarify max_length and flush() for zlib decompression

2015-01-08 Thread Martin Panter
New submission from Martin Panter: This simple patch documents that max_length has to be non-zero. The implementation actually uses zero as a special value to indicate max_length was not specified. Also, I wonder what the point of the Decompressor.flush() method is. Reading the module code

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-08 Thread Denis McMahon
On Thu, 08 Jan 2015 22:07:03 +, Denis McMahon wrote: On Thu, 08 Jan 2015 09:09:18 -0800, semeon.risom wrote: Simple question. I hope. . To follow up, below is a solution to the problem you stated. #!/usr/bin/python import Image, ImageDraw, math def makeimg(length, orientation):

Re: Decimals and other numbers

2015-01-08 Thread Chris Rebert
On Thu, Jan 8, 2015 at 6:33 PM, Devin Jeanpierre jeanpierr...@gmail.com wrote: I noticed some very PHP-ish behavior today: import decimal x = 0 y = float(x) z = decimal.Decimal(x) x == y == z == x True x ** x 1 y**y 1.0 z**z Traceback (most recent call last): File stdin, line 1,

[issue16192] ctypes - documentation example

2015-01-08 Thread Brian Thorne
Changes by Brian Thorne hardb...@gmail.com: -- nosy: -Thorney, chris.jerdonek, eric.araujo, ezio.melotti, georg.brandl status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16192

Re: exporting c_variable to embedded python module

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 8:03 AM, kenak...@gmail.com wrote: I'm running a python script loaded via PyImport_Import in my C++ program on Linux. Is there any way I can pass a value from the c-code to the loaded python module? To answer this question, first think about how you would like to see

Re: where in Nan defined

2015-01-08 Thread Ian Kelly
On Thu, Jan 8, 2015 at 7:07 PM, Chris Angelico ros...@gmail.com wrote: On Fri, Jan 9, 2015 at 12:46 PM, Steven D'Aprano The fallback rule I use when float('nan') fails is INF = 1e3000 # Hopefully, this should overflow to INF. NAN = INF-INF # And this hopefully will give a NaN. The

Re: Decimals and other numbers

2015-01-08 Thread Devin Jeanpierre
On Thu, Jan 8, 2015 at 6:43 PM, Dave Angel da...@davea.name wrote: What you don't say is which behavior you actually expected. Since 0**0 is undefined mathematically, I'd expect either an exception or a NAN result. It can be undefined, if you choose for it to be. You can also choose to not

Re: Decimals and other numbers

2015-01-08 Thread Devin Jeanpierre
Thanks Ben, with your encouragement I have filed http://bugs.python.org/issue23201 -- Devin On Thu, Jan 8, 2015 at 7:03 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Dave Angel da...@davea.name writes: What you don't say is which behavior you actually expected. Since 0**0 is undefined

[issue7676] IDLE shell shouldn't use TABs

2015-01-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: I believe I explained above the logical and technical factors that make the Idle shell inherently different from the console shell in this regard. As the title says, this issue is about not using tabs and not about mixing tabs and spaces. As I already said,

[issue22038] Implement atomic operations on non-x86 platforms

2015-01-08 Thread STINNER Victor
STINNER Victor added the comment: atomicv3.patch is wrong for GCC builtin atomic operations: the parenthesis is not closed. I fixed this typo in the commit. Vitor Gustavo: Thanks for the patch, it's now applied to Python 3.5. I tested it on Fedora 21 (x86_64). I disabled manually

Decimals and other numbers

2015-01-08 Thread Devin Jeanpierre
I noticed some very PHP-ish behavior today: import decimal x = 0 y = float(x) z = decimal.Decimal(x) x == y == z == x True x ** x 1 y**y 1.0 z**z Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.7/decimal.py, line 2216, in __pow__ return

[issue23201] Decimal(0)**0 is an error, 0**0 is 1, but Decimal(0) == 0

2015-01-08 Thread Devin Jeanpierre
Devin Jeanpierre added the comment: Yes, also, it is documented: https://docs.python.org/3/library/decimal.html#decimal.InvalidOperation Still, the status quo is bad. At the very least there should be clear documentation on how Decimal differs in behavior from floats and ints. (Other than

[issue22560] Add loop-agnostic SSL implementation to asyncio

2015-01-08 Thread STINNER Victor
STINNER Victor added the comment: For STARTTLS, see also this issue: https://code.google.com/p/tulip/issues/detail?id=79 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22560 ___

Using a ChangeLog as a canonical source of package metadata (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: Ben Finney wrote: The source has a ‘CHANGES.txt’ file which has no entry later than version 0.2a. Why was the later version made, and when will the change log be updated for that? Ah, I knew I forgot something! The perils of

Re: Announce: PyPrimes 0.2.1a

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 11:41 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: oh, pip did the wrong thing again? you can fix that by standing on one leg, sacrificing a goat to the Great Old Dark Ones, deleting these files, or possibly some other ones, and if the phase of the moon

[issue23197] asyncio: check if a future is cancelled before calling set_result/set_exception

2015-01-08 Thread STINNER Victor
STINNER Victor added the comment: Oh, I forgot that the change in subprocess.py (check if waiter is cancelled before setting its result) is already part of the issue #23197 which comes with an unit test. The changes on the SSL handshake are still needed. --

Re: Decimals and other numbers

2015-01-08 Thread Ben Finney
Dave Angel da...@davea.name writes: What you don't say is which behavior you actually expected. Since 0**0 is undefined mathematically, I'd expect either an exception or a NAN result. Do you think that the ‘int’ and ‘float’ types, which do produce a number result for ‘0 ** 0’, are buggy and

[issue23025] ssl.RAND_bytes docs should mention os.urandom

2015-01-08 Thread STINNER Victor
STINNER Victor added the comment: To be clear: rand.diff looks good to me, go ahead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23025 ___

Re: Where to learn current best Python packaging practices (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Rustom Mody
On Friday, January 9, 2015 at 6:42:18 AM UTC+5:30, Ben Finney wrote: Steven D'Aprano writes: Is there a good tutorial to learn about pip? I'll answer what I think is the correct question: where to learn about the current best Python packaging practices. In order to attain to full ISO

[issue23086] Add start and stop parameters to the Sequence.index() ABC mixin method

2015-01-08 Thread Devin Jeanpierre
Devin Jeanpierre added the comment: I'm going to add a test case that changes the sequence length during .index(), and just do whatever list does in that case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23086

Re: Using a ChangeLog as a canonical source of package metadata (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 11:06 AM, Ben Finney ben+pyt...@benfinney.id.au wrote: I've now produced a small Python library which knows how to transform a reST Changelog to package metadata; and how to get that package metadata into and out of a Python distribution with Distutils. The result is

[issue23199] libpython27.a in amd64 release is 32-bit

2015-01-08 Thread Zach Welch
New submission from Zach Welch: I tried to link a program against the libpython27.a provided by the latest 2.7.9 amd64 installer, only to discover that the provided library is a 32-bit version. I had to go through the gendef/dlltool dance in order to produce a useable 64-bit library from the

[issue22986] Improved handling of __class__ assignment

2015-01-08 Thread Nathaniel Smith
Nathaniel Smith added the comment: I hereby invoke the one month ping rule! Patch, be pinged! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22986 ___

Re: Can numpy do better than this?

2015-01-08 Thread Rustom Mody
On Friday, January 9, 2015 at 12:58:52 AM UTC+5:30, Ian wrote: On Thu, Jan 8, 2015 at 10:56 AM, Rustom Mody wrote: Given a matrix I want to shift the 1st column 0 (ie leave as is) 2nd by one place, 3rd by 2 places etc. This code works. But I wonder if numpy can do it shorter and

Re: application console with window

2015-01-08 Thread Rick Johnson
On Thursday, January 8, 2015 at 10:54:22 AM UTC-6, Chris Warrick wrote: On Thu, Jan 8, 2015 at 5:18 PM, adam wrote: I just learn python. If you write in Polish it will be easier for me to explain any problem, because my English is very thin. You cannot really learn to program without

Re: where in Nan defined

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 1:12 PM, Ian Kelly ian.g.ke...@gmail.com wrote: Or to never have to worry about it: INF = 1e400 while not math.isinf(INF): INF *= INF With no imports whatsoever: inf = 1e400 nan = inf-inf while nan == nan: inf *= inf nan = inf-inf But now we're getting

Re: Where to learn current best Python packaging practices

2015-01-08 Thread Ben Finney
Rick Johnson rantingrickjohn...@gmail.com writes: On Thursday, January 8, 2015 at 7:12:18 PM UTC-6, Ben Finney wrote: That does not contradict the position that [python packaging] is an ornery beast full of hidden traps and compromises though; it just means that everything that came

Re: Announce: PyPrimes 0.2.1a

2015-01-08 Thread Steven D'Aprano
Irmen de Jong wrote: On 8-1-2015 12:16, Steven D'Aprano wrote: I screwed up the upload to PyPI, and it won't allow you to upload the same version twice. (At least, I don't know of any way to do so.) So I had to bump the version number to re-upload. You can manually log into PyPI and fix

Re: Can numpy do better than this?

2015-01-08 Thread Ian Kelly
On Thu, Jan 8, 2015 at 6:13 PM, Rustom Mody rustompm...@gmail.com wrote: With that I came up with the expression transpose(array([list(roll(mat[:,i],i,0)) for i in range(mat.shape[1])])) Not exactly pretty. My hunch is it can be improved??... Hmm, you could use the column_stack constructor

Re: where in Nan defined

2015-01-08 Thread Steven D'Aprano
Chris Angelico wrote: On Fri, Jan 9, 2015 at 1:50 AM, Jussi Piitulainen jpiit...@ling.helsinki.fi wrote: 0*1e400 nan Nice, that's shorter than mine. o_O Is that really the sort of thing you should be revealing here? Oh wait, you're talking about code... I'm not entirely sure,

Re: Can numpy do better than this?

2015-01-08 Thread Rustom Mody
On Friday, January 9, 2015 at 7:07:26 AM UTC+5:30, Ian wrote: On Thu, Jan 8, 2015 at 6:13 PM, Rustom Mody wrote: With that I came up with the expression transpose(array([list(roll(mat[:,i],i,0)) for i in range(mat.shape[1])])) Not exactly pretty. My hunch is it can be improved??...

Re: Decimals and other numbers

2015-01-08 Thread Dave Angel
On 01/08/2015 09:33 PM, Devin Jeanpierre wrote: I noticed some very PHP-ish behavior today: import decimal x = 0 y = float(x) z = decimal.Decimal(x) x == y == z == x True x ** x 1 y**y 1.0 z**z Traceback (most recent call last): File stdin, line 1, in module File

[issue23201] Decimal(0)**0 is an error, 0**0 is 1, but Decimal(0) == 0

2015-01-08 Thread Devin Jeanpierre
New submission from Devin Jeanpierre: import decimal x = 0 y = float(x) z = decimal.Decimal(x) x == y == z == x True x ** x 1 y**y 1.0 z**z Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.7/decimal.py, line 2216, in __pow__ return

[issue23201] Decimal(0)**0 is an error, 0**0 is 1, but Decimal(0) == 0

2015-01-08 Thread Devin Jeanpierre
Changes by Devin Jeanpierre jeanpierr...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23201 ___ ___

[issue23201] Decimal(0)**0 is an error, 0**0 is 1, but Decimal(0) == 0

2015-01-08 Thread Ezio Melotti
Ezio Melotti added the comment: In the code there is this comment: # 0**0 = NaN (!), x**0 = 1 for nonzero x (including +/-Infinity) and raising the error for this specific case seems intentional. -- nosy: +ezio.melotti, facundobatista, mark.dickinson, rhettinger, skrah versions:

[issue23201] Decimal(0)**0 is an error, 0**0 is 1, but Decimal(0) == 0

2015-01-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: Intentional, but really hard to justify from a consistency perspective. There appear to be several reasonable arguments to treat it as 1 regardless of the mathematical impurity ( https://www.math.hmc.edu/funfacts/ffiles/10005.3-5.shtml ), and since we

[issue23201] Decimal(0)**0 is an error, 0**0 is 1, but Decimal(0) == 0

2015-01-08 Thread Chris Rebert
Chris Rebert added the comment: This behavior seems to be required by the General Decimal Arithmetic Specification (http://speleotrove.com/decimal/daexcep.html ): The following exceptional conditions can occur: [...] Invalid operation This occurs and signals

[issue23202] pyvenv does not fail like documented when a venv already exists

2015-01-08 Thread Florian Bruhin
New submission from Florian Bruhin: https://docs.python.org/3/library/venv.html says: If the target directory already exists an error will be raised, unless the --clear or --upgrade option was provided. However, that doesn't seem to be the case: [florian@ginny ~]$ python --version Python

Re: Decimals and other numbers

2015-01-08 Thread Marko Rauhamaa
Dave Angel da...@davea.name: What you don't say is which behavior you actually expected. Since 0**0 is undefined mathematically, I'd expect either an exception or a NAN result. IEEE 754 mandates that 0**0 should evaluate to 1: URL:

[issue23086] Add start and stop parameters to the Sequence.index() ABC mixin method

2015-01-08 Thread Devin Jeanpierre
Devin Jeanpierre added the comment: I take it back, I don't want to copy what the list type does, because it's wrong: http://bugs.python.org/issue23204 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23086

[issue23203] Aliasing import of sub-{module, package} from the package raises AttributeError on import.

2015-01-08 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +brett.cannon, eric.snow, ezio.melotti, ncoghlan type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23203 ___

Re: Decimals and other numbers

2015-01-08 Thread Dave Angel
On 01/09/2015 02:37 AM, Chris Angelico wrote: On Fri, Jan 9, 2015 at 6:28 PM, Marko Rauhamaa ma...@pacujo.net wrote: Devin Jeanpierre jeanpierr...@gmail.com: If 0**0 is defined, it must be 1. You can justify any value a within [0, 1]. For example, choose y(a, x) = log(a, x) Then,

Re: what is Jython?

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 3:10 PM, Brian bcl...@es.co.nz wrote: I tried to find out more on the internet but didn't have much success. All I know is that its a combination of Python and Java. Is it more Java than Python or the other way around? Is Jython free like Python? Is the programming

[issue23185] add inf and nan to math module

2015-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be make math.inf and math.nan special objects so that for all x (except inf and nan): x math.inf x -math.inf not (x math.nan) not (x math.nan) -- ___ Python tracker rep...@bugs.python.org

Re: Array of hash table

2015-01-08 Thread Dave Angel
On 01/09/2015 02:17 AM, jyoti690sa...@gmail.com wrote: Hello, Can any one tell me how to create graph={ nodes: [ { id: n0, label: A node, x: 0, y: 0, size: 3 }, { id: n1, label: Another node, x: 3, y: 1,

Re: Decimals and other numbers

2015-01-08 Thread Marko Rauhamaa
Devin Jeanpierre jeanpierr...@gmail.com: If 0**0 is defined, it must be 1. You can justify any value a within [0, 1]. For example, choose y(a, x) = log(a, x) Then, limy(a, x) = 0 x - 0+ and: lim[x - 0+] x**y(a, x) = a For example, a = 0.5 x = 1e-100 y =

what is Jython?

2015-01-08 Thread Brian
I tried to find out more on the internet but didn't have much success. All I know is that its a combination of Python and Java. Is it more Java than Python or the other way around? Is Jython free like Python? Is the programming language for Jython similar to Python or similar to Java? Are there

Re: how to create a soap enveloppe with python suds for consume a bssv web service

2015-01-08 Thread dieter
brice DORA roa...@yahoo.fr writes: ... suds should generate those required SOAP envelope. suds can be set up to log the precise messages sent and received (consult the suds documentation about logging and the Python documentation about its logging module). With these messages (and a

[issue23184] Unused imports, variables, file in IDLE

2015-01-08 Thread Al Sweigart
Al Sweigart added the comment: *more transparent, that is. Not opaque. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23184 ___ ___

[issue23184] Unused imports, variables, file in IDLE

2015-01-08 Thread Al Sweigart
Al Sweigart added the comment: I've updated the patch. I've removed the EditorWindow deletion. Importing that and using it as a class variable instead of using an assignment statement wasn't picked up. (Is there a more opaque way to do this import?) I've left the RemoteDebugger.py change in.

[issue23203] Aliasing import of sub-{module, package} from the package raises AttributeError on import.

2015-01-08 Thread Franck Michea
New submission from Franck Michea: Hi, for those of you that prefer to read an example, you can read that commented demonstration of the bug[1]. Today I discovered what I think is a bug in the import system. Here is the basic setup: We have three nested packages: foo - bar - baz. The bar

Array of hash table

2015-01-08 Thread jyoti690saini
Hello, Can any one tell me how to create graph={ nodes: [ { id: n0, label: A node, x: 0, y: 0, size: 3 }, { id: n1, label: Another node, x: 3, y: 1, size: 2 }, { id: n2, label: And a last one,

[issue23204] list.index and rest of list methods disagree if a value is in the list if it's mutated during the call

2015-01-08 Thread Devin Jeanpierre
New submission from Devin Jeanpierre: class AppendOnUnequal(object): ... def __init__(self, append_to): ... self.append_to = append_to ... def __eq__(self, other): ... if self is other: ... return True ... self.append_to.append(self) ...

Re: Decimals and other numbers

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 6:28 PM, Marko Rauhamaa ma...@pacujo.net wrote: Devin Jeanpierre jeanpierr...@gmail.com: If 0**0 is defined, it must be 1. You can justify any value a within [0, 1]. For example, choose y(a, x) = log(a, x) Then, limy(a, x) = 0 x - 0+ and:

PyPI files should not change their payload (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: I screwed up the upload to PyPI, and it won't allow you to upload the same version twice. (At least, I don't know of any way to do so.) So I had to bump the version number to re-upload. There is currently a hack that can be done (I

[issue23198] asyncio: refactor StreamReader

2015-01-08 Thread STINNER Victor
New submission from STINNER Victor: Attached patch refactors the asyncio.StreamReader class: - use the value None instead of True or False to wake up the waiter - add a new _wakeup_waiter() method - replace _create_waiter() method with a _wait_for_data() coroutine function The change adds a

Re: PyPI files should not change their payload (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Steven D'Aprano
Ben Finney wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: I screwed up the upload to PyPI, and it won't allow you to upload the same version twice. (At least, I don't know of any way to do so.) So I had to bump the version number to re-upload. There is currently a

[issue22038] Implement atomic operations on non-x86 platforms

2015-01-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset fbe87fb071a6 by Victor Stinner in branch 'default': Issue #22038: pyatomic.h now uses stdatomic.h or GCC built-in functions for https://hg.python.org/cpython/rev/fbe87fb071a6 -- nosy: +python-dev ___

Where to learn current best Python packaging practices (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: Is there a good tutorial to learn about pip? I'll answer what I think is the correct question: where to learn about the current best Python packaging practices. We have recently gained an official body whose explicit job is to

Re: Where to learn current best Python packaging practices (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Rick Johnson
On Thursday, January 8, 2015 at 7:12:18 PM UTC-6, Ben Finney wrote: That does not contradict the position that [python packaging] is an ornery beast full of hidden traps and compromises though; it just means that everything that came before it (in Python) is worse Ben, you've just proven the

Re: Decimals and other numbers

2015-01-08 Thread Ben Finney
Devin Jeanpierre jeanpierr...@gmail.com writes: decimal.InvalidOperation: 0 ** 0 I'd file a bug report but I'm anticipating some rational (heh) explanation. Any ideas? First note that it's explicitly documented as an invalid operation

[issue23196] Greek letters not sorted properly

2015-01-08 Thread R. David Murray
R. David Murray added the comment: This appears to be a duplicate of issue 23196 (the strxfrm issue). -- nosy: +r.david.murray resolution: - duplicate stage: - resolved status: open - closed superseder: - Greek letters not sorted properly ___

[issue23196] Greek letters not sorted properly

2015-01-08 Thread R. David Murray
R. David Murray added the comment: Oops, I meant issue 23195. -- superseder: Greek letters not sorted properly - Sorting with locale (strxfrm) does not work properly with Python3 on Macos ___ Python tracker rep...@bugs.python.org

[issue23195] Sorting with locale (strxfrm) does not work properly with Python3 on Macos

2015-01-08 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23195 ___ ___

[issue23195] Sorting with locale (strxfrm) does not work properly with Python3 on Macos

2015-01-08 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- title: Sorting with locale does not work properly with Python3 on Macos - Sorting with locale (strxfrm) does not work properly with Python3 on Macos ___ Python tracker rep...@bugs.python.org

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-08 Thread Denis McMahon
On Thu, 08 Jan 2015 09:09:18 -0800, semeon.risom wrote: Simple question. I hope. . We just covered this in the PHP newsgroup where you were trying to use a PHP library to generate these images. As your library code is written in PHP, I suggest you return to the discussion there unless

[issue7676] IDLE shell shouldn't use TABs

2015-01-08 Thread Al Sweigart
Al Sweigart added the comment: There are three pieces of user-specified configuration: (1) the number of spaces for a tab set in IDLE's config, (2) the sys.ps1 value, and (3) the sys.ps2 value. Currently IDLE's shell is ignoring (1) while the editor is not. IDLE's shell is ignoring (3) while

[issue23200] Clarify max_length and flush() for zlib decompression

2015-01-08 Thread Martin Panter
Martin Panter added the comment: The processing of unconsumed_tail in flush() was introduced via Issue 16411. Before that I suspect flush() was assumed to only be called when max_length was not used. The decompress() method changed from Z_NO_FLUSH to Z_SYNC_FLUSH in Feb 2001; see revision

Re: where in Nan defined

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 12:46 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Chris Angelico wrote: On Fri, Jan 9, 2015 at 1:50 AM, Jussi Piitulainen jpiit...@ling.helsinki.fi wrote: 0*1e400 nan Nice, that's shorter than mine. I'm not entirely sure, but I suspect

Re: exporting c_variable to embedded python module

2015-01-08 Thread kenakahn
I want to access c-side global variables from the python side. -- https://mail.python.org/mailman/listinfo/python-list

[issue23195] Sorting with locale (strxfrm) does not work properly with Python3 on Macos

2015-01-08 Thread Ned Deily
Ned Deily added the comment: The initial difference appears to be a long-standing BSD (including OS X) versus GNU/Linux platform difference. See, for example: http://www.postgresql.org/message-id/18c8a481-33a6-4483-8c24-b8ce70db7...@eggerapps.at Why there is no difference between en and fr

[issue23195] Sorting with locale (strxfrm) does not work properly with Python3 on BSD or OS X

2015-01-08 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- title: Sorting with locale (strxfrm) does not work properly with Python3 on Macos - Sorting with locale (strxfrm) does not work properly with Python3 on BSD or OS X ___ Python tracker rep...@bugs.python.org

Re: Announce: PyPrimes 0.2.1a

2015-01-08 Thread Irmen de Jong
On 8-1-2015 12:16, Steven D'Aprano wrote: I screwed up the upload to PyPI, and it won't allow you to upload the same version twice. (At least, I don't know of any way to do so.) So I had to bump the version number to re-upload. You can manually log into PyPI and fix the uploaded files using

[issue23195] Sorting with locale (strxfrm) does not work properly with Python3 on BSD or OS X

2015-01-08 Thread STINNER Victor
STINNER Victor added the comment: The postresq discussion and some earlier Python issues suggest using ICU to properly implement Unicode functions like collation across all platforms. In my experience, the locale module is error-prone and not reliable, especially if you want portability. It

Re: application console with window

2015-01-08 Thread jacek pozniak
adam wrote: Hej, no właśnie niechodzi o przeniesienie do okienek tylko jeśli znasz taki program jak np fk dla dos-a to chodzi mi o taki efekt. Czyli aplikacja konsolowa z pseudo okienkami. Napisz sobie w bashu z wykorzystaniem programu dialog (man dialog) i ewntualnym wołaniem skryptów

[issue23185] add inf and nan to math module

2015-01-08 Thread STINNER Victor
STINNER Victor added the comment: Except of my small suggestion on the doc (see the review), math_inf_nan4.patch looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23185 ___

[issue23086] Add start and stop parameters to the Sequence.index() ABC mixin method

2015-01-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: I think it avoids len because the length might change during iteration due to side-effects of other code. Since a shrinking sequence would raise an IndexError anyway when you overran the end, it may as well not assume the length is static and just keep

[issue22970] Cancelling wait() after notification leaves Condition in an inconsistent state

2015-01-08 Thread STINNER Victor
STINNER Victor added the comment: I don't like the idea of ignoring exceptions (CancelledError). An option may be to store the latest exception and reraise it when the condition is acquired. I'm not sure that it's safe or correct to retry to acquire the condition. I don't know what I should

[issue23086] Add start and stop parameters to the Sequence.index() ABC mixin method

2015-01-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: Note: index returns without the caller having a chance to execute code that would change the sequence length directly. But other threads could change it, as could a custom __eq__ on an object stored in the sequence (or a poorly implemented __getitem__ or

[issue22970] Cancelling wait() after notification leaves Condition in an inconsistent state

2015-01-08 Thread STINNER Victor
STINNER Victor added the comment: threading.Condition.wait() implementation is very similar to asyncio.Condition.wait(), and the threading code only call acquire() once, it doesn't loop or ignore exceptions. Does it mean that threading.Condition.wait() has the same issue? --

PyDev 3.9.1 Released

2015-01-08 Thread Fabio Zadrozny
What is PyDev? --- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details

[issue22919] Update PCBuild for VS 2015

2015-01-08 Thread STINNER Victor
STINNER Victor added the comment: Visual Studio 2013 Professional works fine under Windows 7 SP1 here. Ok, good to know. But is it correct that the free version of VS 2013 (community) requires Windows 8.1 or newer? It's not cool to require to upgrade Windows to being able to freely compile

Re: Announce: PyPrimes 0.2.1a

2015-01-08 Thread Steven D'Aprano
Ben Finney wrote: Steven D'Aprano st...@pearwood.info writes: (Note: pip may have problems downloading the right version if you don't specify a version number.) Or you can access the latest development version: hg clone https://code.google.com/p/pyprimes/ The source has a

[issue23190] OpenSSL fails building with build.bat

2015-01-08 Thread Antoine Pitrou
New submission from Antoine Pitrou: With PCbuild\build.bat -d -e, OpenSSL fails building: nasm: fatal: unable to open input file `Z:\cpython\default\externals\openssl- 1.0.1j\tmp32\aes-586.asm' Detailed build log is: Z:\cpython\default\PCbuild\libeay.vcxproj (default target) (32:3) -

[issue23190] OpenSSL fails building with build.bat

2015-01-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Z:\cpython\defaultdir Z:\cpython\default\externals\openssl-1.0.1j\ Volume in drive Z is antoine Volume Serial Number is 2FA8-F31C Directory of Z:\cpython\default\externals\openssl-1.0.1j 01/08/2015 11:59 AMDIR . 01/08/2015 12:10 PMDIR

[issue22919] Update PCBuild for VS 2015

2015-01-08 Thread Mark Lawrence
Mark Lawrence added the comment: @Victor I don't know what version you need for Windows 7 or earlier but I can tell you that VS 2013 Community edition is *NOT* free, I fell into that trap myself, you need the Express edition. -- ___ Python tracker

[issue7676] IDLE shell shouldn't use TABs

2015-01-08 Thread Al Sweigart
Changes by Al Sweigart asweig...@gmail.com: -- nosy: +Al.Sweigart ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7676 ___ ___ Python-bugs-list

[issue22919] Update PCBuild for VS 2015

2015-01-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Visual Studio 2013 Professional works fine under Windows 7 SP1 here. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22919 ___

[issue22906] PEP 479: Change StopIteration handling inside generators

2015-01-08 Thread Chris Angelico
Chris Angelico added the comment: Nick, any particular reason for pointing to https://hg.python.org/cpython/annotate/bbf16fd024df/Lib/__future__.py rather than https://hg.python.org/cpython/annotate/tip/Lib/__future__.py ? I'm looking at both, anyhow. --

Re: Announce: PyPrimes 0.2.1a

2015-01-08 Thread Steven D'Aprano
Christian Gollwitzer wrote: Hi Steve, Am 08.01.15 um 05:35 schrieb Steven D'Aprano: At long last, I am pleased to announce the latest version of PyPrimes, a pure Python package for working with prime numbers. Nice. PyPrimes is compatible with Python 2 and 3, and includes multiple

[issue23190] OpenSSL fails building with build.bat

2015-01-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23190 ___

[issue23190] OpenSSL fails building with build.bat

2015-01-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hmm, probably the svn export had failed for some reason. I deleted the OpenSSL directory, re-ran get_externals.bat and then everything went fine. -- ___ Python tracker rep...@bugs.python.org

Oddity with lambda and yield

2015-01-08 Thread Chris Angelico
As yield is an expression, it's legal in a lambda function, which then means you have a generator function. But it's not quite the same as the equivalent function made with def: $ python3 Python 3.5.0a0 (default:1c51f1650c42+, Dec 29 2014, 02:29:06) [GCC 4.7.2] on linux Type help, copyright,

Re: Hello World

2015-01-08 Thread Albert van der Horst
In article mailman.17077.1419144290.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Sun, Dec 21, 2014 at 5:31 PM, Terry Reedy tjre...@udel.edu wrote: Just to be clear, writing to sys.stdout works fine in Idle. import sys; sys.stdout.write('hello ') hello #2.7 In 3.4,

Re: Hello World

2015-01-08 Thread Chris Angelico
On Thu, Jan 8, 2015 at 11:43 PM, Albert van der Horst alb...@spenarnc.xs4all.nl wrote: I don't trust sudo because it is too complicated. (To the point that I removed it from my machine.) I do su .. # su nobody Who needs sudo? With sudo, you get MUCH finer control. I can grant some user

[issue23191] fnmatch regex cache use is not threadsafe

2015-01-08 Thread M. Schmitzer
New submission from M. Schmitzer: The way the fnmatch module uses its regex cache is not threadsafe. When multiple threads use the module in parallel, a race condition between retrieving a - presumed present - item from the cache and clearing the cache (because the maximum size has been

[issue23191] fnmatch regex cache use is not threadsafe

2015-01-08 Thread STINNER Victor
STINNER Victor added the comment: I guess that a lot of stdlib modules are not thread safe :-/ A workaround is to protect calls to fnmatch with your own lock. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org

Re: How do I remove/unlink wildcarded files

2015-01-08 Thread Albert van der Horst
In article f69874c8-48f6-4696-8678-c2a761f2f...@googlegroups.com, Rick Johnson rantingrickjohn...@gmail.com wrote: On Saturday, January 3, 2015 4:39:25 AM UTC-6, Mark Lawrence wrote: I used to get very confused watching the old westerns. The child when talking about more and paw wasn't

  1   2   3   >