[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu
Raghu added the comment: Serhiy, root@host:~# python Python 2.7.3 (default, Apr 3 2016, 22:31:30) [GCC 4.8.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import struct >>> struct.pack('d', 2.0) '@\x00\x00\x00\x00\x00\x00\x00' >>> struct.pack('d',

Re: Convert input to upper case on screen as it is typed

2016-04-13 Thread Ben Finney
Dan Sommers writes: > On Thu, 14 Apr 2016 13:25:14 +1000, Ben Finney wrote: > > > How can my Python program convert the user's keyboard input to upper > > case, as though the user has CAPS LOCK enabled? > > I don't know which OS you're using, but if I run "stty olcuc" in

[ANN] MicroPython 1.7

2016-04-13 Thread Paul Sokolovsky
Hello, MicroPython is a lean and efficient Python implementation for microcontrollers, embedded, and mobile systems (which also runs just as fine on desktops, servers, and clouds). v1.7 adds the MicroPython cross-compiler that can generate .mpy files (pre-compiled bytecode) which can be

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is the output of `struct.pack('d', 2.0)` and `struct.pack('d', float(2))`? -- ___ Python tracker ___

Re: Convert input to upper case on screen as it is typed

2016-04-13 Thread Dan Sommers
On Thu, 14 Apr 2016 13:25:14 +1000, Ben Finney wrote: > How can my Python program convert the user's keyboard input to upper > case, as though the user has CAPS LOCK enabled? I don't know which OS you're using, but if I run "stty olcuc" in my Linux shell, then the input driver does that for me.

Convert input to upper case on screen as it is typed

2016-04-13 Thread Ben Finney
How can my Python program convert the user's keyboard input to upper case, as though the user has CAPS LOCK enabled? I want to emulate a program running on a computer which doesn't have any lower-case letters (i.e. a character set more limited than ASCII). The text input, typed interactively by

Looking for feedback on weighted voting algorithm

2016-04-13 Thread justin walters
Hi all, I'm looking for feedback on the below vote weighting algorithm which includes sample input. This is written in Python3. def weight(votes): """ Takes a list of tuples in the form of '(vote %, weight)' where vote % is the rating that a user gave and weight is the number of

Re: [OT] A doubt about a doubt, was Re: How to XOR a byte output?

2016-04-13 Thread Rustom Mody
On Wednesday, April 13, 2016 at 10:30:07 PM UTC+5:30, Peter Otten wrote: > alister wrote: > > > On Wed, 13 Apr 2016 06:18:22 -0700, durgadevi1 wrote: > > > >> I have a doubt regarding a problem. > >> > > No, you have a question doubt means you don't believe something > > (sorry I know this is

Re: Append/Replace a row in a pandas DataFrame [SOLVED]

2016-04-13 Thread Paulo da Silva
Às 21:10 de 13-04-2016, Paulo da Silva escreveu: > Hi all. ... > [6 rows x 4 columns] > >> dft=pd.DataFrame([[1,2,3,4]], > index=[datetime.date(2016,1,12)],columns=df.columns) > >> dft > A B C D > 2016-01-12 1 2 3 4 > > [1 rows x 4 columns] > >> pd.concat([df,dft]) >

[issue26751] Possible bug in sorting algorithm

2016-04-13 Thread Tim Peters
Tim Peters added the comment: If that's the actual code you're using, it has a bug: the "if k2[1] is None" test is useless, since regardless of whether it's true or false, the next `if` suite overwrites `retval`. You probably meant elif k1[1] ... ^^ instead of if k1[1] ...

[issue26751] Possible bug in sorting algorithm

2016-04-13 Thread David Manowitz
New submission from David Manowitz: I'm trying to sort a list of tuples. Most of the tuples are pairs of US state names. However, some of the tuples have None instead of the 2nd name. I want the items sorted first by the 1st element, and then by the 2nd element, BUT I want the None to

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu
Raghu added the comment: It's windriver linux. Processor is PPC64-E5500 -- ___ Python tracker ___ ___

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: What is your Linux distribution and what is your CPU? (try to read /proc/cpuinfo) You cannot install a C compiler? -- ___ Python tracker

[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()

2016-04-13 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu
Raghu added the comment: my host details: Linux fpc0 3.10.62-ltsi-WR6.0.0.18_standard #1 SMP PREEMPT Sun Apr 3 23:17:02 PDT 2016 ppc64 ppc64 ppc64 GNU/Linux -- ___ Python tracker

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu
Raghu added the comment: stinner victor, my host doesn't have a gcc compiler. is there a way you can give me the binary? -- ___ Python tracker ___

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: >>> print math.sqrt(2.0) Traceback (most recent call last): File "", line 1, in ValueError: math domain error I'm surprised that such basic math function fails. Can you please try to compile and run attached C program? $ gcc sqrt.c -o sqrt -lm && ./sqrt

Re: real time FM synthesizer

2016-04-13 Thread Irmen de Jong
On 13-4-2016 10:41, jkn wrote: > Hi Irmen > > On Wednesday, April 13, 2016 at 12:22:25 AM UTC+1, Irmen de Jong wrote: >> It seems that Python is fast enough [1] to create a real time FM music >> synthesizer >> (think Yamaha DX-7). I made one that you can see here: >>

[issue26750] Mock autospec does not work with subclasses of property()

2016-04-13 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: When patching a class, mock.create_autospec() correctly detects properties and __slot__ attributes, but not subclasses of property() or other kinds of data descriptors. The attached patch detects all data descriptors and patch them the way they

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu
Raghu added the comment: Hi, I apologize. I didn't expect a quick reply. Here are the outputs you requested. root@host:~# python Python 2.7.3 (default, Apr 3 2016, 22:31:30) [GCC 4.8.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import math >>> print

Re: Enum questions.

2016-04-13 Thread Ethan Furman
On 04/13/2016 07:21 AM, Ethan Furman wrote: On 04/13/2016 07:07 AM, Marko Rauhamaa wrote: class Color(enum.Enum): red blue green This last one is to the point but raises a NameError. Using the aenum library that last one is possible. It also has

Crochet 1.5.0: Use Twisted in Django, Flask, or anywhere else

2016-04-13 Thread Itamar Turner-Trauring
Do you wish you could: * Use the power of Twisted's asynchronous networking in Django, Flask, or other threaded applications? * Provide a blocking API powered by Twisted underneath, without exposing it to the caller? * Write a library that provides APIs both for Twisted and non-Twisted

Append/Replace a row in a pandas DataFrame

2016-04-13 Thread Paulo da Silva
Hi all. I am learning pandas DataFrame and I want to add (eventually replace by index) some rows. For adding here is what I tried: >df = pd.DataFrame(np.random.randn(6,4), index=dates, columns=list('ABCD')) >df A B C D 2013-01-01 -0.111621 1.126761

[issue26748] enum.Enum is False-y

2016-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue23008. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 13/04/2016 21:55, Marc-Andre Lemburg a écrit : >> >> LTO is not stable on all platforms (according to doko), and people don't >> want to wait for PGO to build when they just run ./configure && make. >> >> --with-pgo and --with-lto is fine. > > Agreed. Let's

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 13.04.2016 21:50, Stefan Krah wrote: > > LTO is not stable on all platforms (according to doko), and people don't > want to wait for PGO to build when they just run ./configure && make. > > --with-pgo and --with-lto is fine. Agreed. Let's not make

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: > LTO is not stable on all platforms (according to doko), and people don't want > to wait for PGO to build when they just run ./configure && make. Can we have a whitelist of arch known to support PGO and/or LTO? Or maybe a blacklist? Ubuntu already has this

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-13 Thread Stefan Krah
Stefan Krah added the comment: LTO is not stable on all platforms (according to doko), and people don't want to wait for PGO to build when they just run ./configure && make. --with-pgo and --with-lto is fine. -- ___ Python tracker

Re: hourly weather forecast data

2016-04-13 Thread Hasan Diwan
On 2016-04-13, Stephen Hansen wrote: > On Tue, Apr 12, 2016, at 08:36 PM, kamaraju kusumanchi wrote: >> Is there a way to get hourly weather forecast data (temperature, >> chance of precipitation) from the command line in Debian Linux? > > Personally, the last time I wanted to do

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: + --with-lto Enable Link Time Optimization in PGO builds. + Disabled by default. I don't understand why it's disabled by default. IMHO we must enable all the best optimizers options *by default*. But I expect all

[issue26359] CPython build options for out-of-the box performance

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: Sorry, I don't understand this issue. I don't think that we need 3 flavors: debug, devel and release. We already have debug (--with-pydebug) and release, and IMHO debug is what developers should use. I like the idea of using the best optimizers options *by

[issue16399] argparse: append action with default list adds to list instead of overriding

2016-04-13 Thread Gabriel Devenyi
Gabriel Devenyi added the comment: >From what I can tell a workaround for this still isn't documented. -- nosy: +Gabriel Devenyi ___ Python tracker ___

[issue26749] Update devguide to include Fedora's DNF

2016-04-13 Thread Luiz Poleto
Luiz Poleto added the comment: The attached patch contains the instructions on how to use DNF to install the system headers. -- keywords: +patch Added file: http://bugs.python.org/file42457/issue26749.patch ___ Python tracker

[issue26749] Update devguide to include Fedora's DNF

2016-04-13 Thread Luiz Poleto
New submission from Luiz Poleto: Starting with Fedora 22, yum is no longer the default packaging tool, being replaced by the new DNF (Dandified Yum). Section 1.1.3.1 of the devguide, Build dependencies, has instructions to install system headers using popular Linux distributions, including

[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()

2016-04-13 Thread skydoom
skydoom added the comment: seems we also need to check whether _main_thread is daemon thread or not, so the proposed patch would look like: def _shutdown(): # add these checking first if( _main_thread.isDaemon() is False or _main_thread.is_alive() is False ): return --

[issue26748] enum.Enum is False-y

2016-04-13 Thread Ethan Furman
Ethan Furman added the comment: EnumMeta /is/ a collection (at least in the same sense the dict class is a collection). ;) Fix is on it's way... -- ___ Python tracker

[issue26748] enum.Enum is False-y

2016-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Just reading the code now, the reason is that EnumMeta pretends to be a collection (it defines a __len__ and an __iter__). -- ___ Python tracker

[issue26748] enum.Enum is False-y

2016-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, I didn't find a separate bug tracker for the enum34 backport, which is why I included that version here. > for IntEnum the behavior is correct Do you remember the argument? I agree that IntEnum *instances* may be falsy, but IntEnum classes I don't see

[issue26748] enum.Enum is False-y

2016-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, we posted at the same time :-) Yes, the class is false-y. -- ___ Python tracker ___

[issue26748] enum.Enum is False-y

2016-04-13 Thread Guido van Rossum
Guido van Rossum added the comment: Oh wait. The *class* is False-y? That's definitely a bug, just fix it. -- ___ Python tracker ___

[issue26748] enum.Enum is False-y

2016-04-13 Thread Guido van Rossum
Guido van Rossum added the comment: I guess it's marked 2.7 because of the enum34 backport? There's no enum in the 2.7 stdlib. I believe this was brought up before on one of the lists but I don't recall the outcome of the discussion, except that for IntEnum the behavior is correct. I tend

[issue26748] enum.Enum is False-y

2016-04-13 Thread Antoine Pitrou
New submission from Antoine Pitrou: >>> import enum >>> bool(enum.Enum) False >>> bool(enum.IntEnum) False This behaviour is relatively unexpected for classes, and can lead to subtle bugs such as the following:

Re: sum accuracy

2016-04-13 Thread Peter Otten
Robin Becker wrote: > Does anyone know if sum does anything special to try and improve accuracy? > My simple tests seem to show it is exactly equivalent to a for loop > summation. If you are worried about accuracy and your values are floating point numbers use math.fsum(): """ fsum(...)

Re: sum accuracy

2016-04-13 Thread Jussi Piitulainen
Robin Becker writes: > Does anyone know if sum does anything special to try and improve > accuracy? My simple tests seem to show it is exactly equivalent to a > for loop summation. You want math.fsum. -- https://mail.python.org/mailman/listinfo/python-list

Re: sum accuracy

2016-04-13 Thread Random832
On Wed, Apr 13, 2016, at 12:51, Robin Becker wrote: > Does anyone know if sum does anything special to try and improve > accuracy? My > simple tests seem to show it is exactly equivalent to a for loop > summation. No, it doesn't. Sum works on any type that can be added (except strings), it can't

[OT] A doubt about a doubt, was Re: How to XOR a byte output?

2016-04-13 Thread Peter Otten
alister wrote: > On Wed, 13 Apr 2016 06:18:22 -0700, durgadevi1 wrote: > >> I have a doubt regarding a problem. >> > No, you have a question doubt means you don't believe something > (sorry I know this is not an English language lesson) "doubt" is commonly used that way in Indian English, see

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-13 Thread Josh Rosenberg
Josh Rosenberg added the comment: LGTM. Had to check the definition of PyDescr_IsData to determine that checking the value from tp_descr_set for NULL was exactly what that macro does, but yeah, it looks like the first test was redundant, and f is never assigned outside that block, so the

sum accuracy

2016-04-13 Thread Robin Becker
Does anyone know if sum does anything special to try and improve accuracy? My simple tests seem to show it is exactly equivalent to a for loop summation. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

English dialect (Was: How to XOR a byte output?)

2016-04-13 Thread Ian Kelly
On Wed, Apr 13, 2016 at 10:15 AM, alister wrote: > On Wed, 13 Apr 2016 06:18:22 -0700, durgadevi1 wrote: > >> Hi all, >> >> I have a doubt regarding a problem. >> > No, you have a question doubt means you don't believe something > (sorry I know this is not an English

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: I opened a thread on the python-dev mailing list to discuss wordcode: https://mail.python.org/pipermail/python-dev/2016-April/144044.html -- ___ Python tracker

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: I ran the Python benchmark suite on wpy6.patch. * My platform: Linux-4.4.4-301.fc23.x86_64-x86_64-with-fedora-23-Twenty_Three * My PC: CPU Intel i7-2600 (~2.9 GHz) with 12 GB of RAM * Benchmark ran on isolated CPU:

Re: How to XOR a byte output?

2016-04-13 Thread alister
On Wed, 13 Apr 2016 06:18:22 -0700, durgadevi1 wrote: > Hi all, > > I have a doubt regarding a problem. > No, you have a question doubt means you don't believe something (sorry I know this is not an English language lesson) > First, I am required to read a given file. > > > The output from

Re: IdentationError; unexpected indent

2016-04-13 Thread Rob Gaddi
salma ammar wrote: > Hi, > > I am about to run this code using python 2.7. But when executing this code, > an error appears (see attachement): IdentationError; unexpected indent > > What should I rectify to correct this error please? > > > *import sys* >

Re: IdentationError; unexpected indent

2016-04-13 Thread Ian Kelly
On Wed, Apr 13, 2016 at 9:53 AM, salma ammar wrote: > Hi, > > I am about to run this code using python 2.7. But when executing this code, > an error appears (see attachement): IdentationError; unexpected indent > > What should I rectify to correct this error please?

Re: IdentationError; unexpected indent

2016-04-13 Thread Igor Korot
Hi, Salma, On Wed, Apr 13, 2016 at 11:53 AM, salma ammar wrote: > Hi, > > I am about to run this code using python 2.7. But when executing this code, > an error appears (see attachement): IdentationError; unexpected indent > > What should I rectify to correct this error

[issue26747] types.InstanceType only for old style class only in 2.7

2016-04-13 Thread SilentGhost
Changes by SilentGhost : -- assignee: -> docs@python components: +Documentation nosy: +docs@python stage: -> patch review ___ Python tracker

Re: IdentationError; unexpected indent

2016-04-13 Thread alister
On Wed, 13 Apr 2016 16:53:09 +0100, salma ammar wrote: > Hi, > > I am about to run this code using python 2.7. But when executing this > code, > an error appears (see attachement): IdentationError; unexpected indent > > What should I rectify to correct this error please? > > > *import sys* >

IdentationError; unexpected indent

2016-04-13 Thread salma ammar
Hi, I am about to run this code using python 2.7. But when executing this code, an error appears (see attachement): IdentationError; unexpected indent What should I rectify to correct this error please? *import sys* *sys.path.append('C:/Users/user/src/sumo-0.22.0/tools')* *import sumolib* *net

Re: How to XOR a byte output?

2016-04-13 Thread Stephen Hansen
On Wed, Apr 13, 2016, at 06:51 AM, durgadevi1 wrote: > I would like to check with you whether using binascii.hexlify() to > convert the series of bytes into alphabets and integers is correct. To be clear, they already are integers.The \x notation is how you naively represent a byte out of the

Re: How to XOR a byte output?

2016-04-13 Thread Ian Kelly
On Wed, Apr 13, 2016 at 8:27 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> Let's just guess that you want to xor with the byte value 0xAA. We can >> do that fairly simply, using integer operations. >> > data = b'$//W?\xc0\x829\xa2\xb9\x13\x8c\xd5{\\'

[issue26747] types.InstanceType only for old style class only in 2.7

2016-04-13 Thread Nan Wu
New submission from Nan Wu: >>> import types >>> a = 1 >>> isinstance(a, types.InstanceType) False >>> class A: ... pass ... >>> a = A() >>> isinstance(a, types.InstanceType) True >>> class A(object): ... pass ... >>> a = A() >>> isinstance(a, types.InstanceType) False Looks like

Re: Advice on Python build tools

2016-04-13 Thread Chris Warrick
On 12 April 2016 at 11:48, Sayth Renshaw wrote: > Hi > > Looking at the wiki list of build tools > https://wiki.python.org/moin/ConfigurationAndBuildTools > > Has anyone much experience in build tools as i have no preference or > experience to lean on. > > Off

Re: How to XOR a byte output?

2016-04-13 Thread Chris Angelico
On Wed, Apr 13, 2016 at 11:51 PM, durgadevi1 wrote: > Ok thank you ChrisA. :) > > I would like to check with you whether using binascii.hexlify() to convert > the series of bytes into alphabets and integers is correct. It converts the bytes (which are small

Re: How to XOR a byte output?

2016-04-13 Thread Marko Rauhamaa
Chris Angelico : > Let's just guess that you want to xor with the byte value 0xAA. We can > do that fairly simply, using integer operations. > data = b'$//W?\xc0\x829\xa2\xb9\x13\x8c\xd5{\\' bytes(b ^ 0xAA for b in data) >

Re: Enum questions.

2016-04-13 Thread Ethan Furman
On 04/13/2016 07:07 AM, Marko Rauhamaa wrote: class Color(enum.Enum): red blue green This last one is to the point but raises a NameError. Using the aenum library that last one is possible. It also has NamedConstant and a metaclass-derived NamedTuple! --

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: > Updated wpy5.patch to use a more standard diff format (patch generated with > Mercurial, hg diff > patch). Crap, I forgot Python/wordcode_helpers.h. I updated a fixed wpy6.patch. -- Added file: http://bugs.python.org/file42455/wpy6.patch

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file42454/wpy5.patch ___ Python tracker ___

Re: Enum questions.

2016-04-13 Thread Ian Kelly
On Wed, Apr 13, 2016 at 7:50 AM, Grant Edwards wrote: > FWIW, as an old Pascal programmer, I too would have been surprised > that an "enum" is not ordinal and doesn't support a next/prev and > iteration. They do support iteration, but it's by order of declaration, not

Re: Enum questions.

2016-04-13 Thread Marko Rauhamaa
Grant Edwards : > On 2016-04-13, Michael Selik wrote: >> An Enum corresponds to "nominal" data that is coded as a number >> simply for storage rather than meaning. > > FWIW, as an old Pascal programmer, I too would have been surprised > that an

Re: How to XOR a byte output?

2016-04-13 Thread durgadevi1
On Wednesday, April 13, 2016 at 9:29:45 PM UTC+8, Chris Angelico wrote: > On Wed, Apr 13, 2016 at 11:18 PM, durgadevi1 > wrote: > > > > The output from the file is given below: > > > > b'$//W?\xc0\x829\xa2\xb9\x13\x8c\xd5{\' > > > > > > I used the type() to

Re: Enum questions.

2016-04-13 Thread Grant Edwards
On 2016-04-13, Michael Selik wrote: > On Wed, Apr 13, 2016, 12:14 PM Antoon Pardon > wrote: > >> I have been looking at the enum documentation and it seems enums >> are missing two features I rather find important. >> >> 1) Given an Enum

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: Updated wpy5.patch to use a more standard diff format (patch generated with Mercurial, hg diff > patch). -- Added file: http://bugs.python.org/file42454/wpy5.patch ___ Python tracker

Re: How to XOR a byte output?

2016-04-13 Thread Chris Angelico
On Wed, Apr 13, 2016 at 11:18 PM, durgadevi1 wrote: > > The output from the file is given below: > > b'$//W?\xc0\x829\xa2\xb9\x13\x8c\xd5{\' > > > I used the type() to identify the class and its a byte class. > > I saw many \x and thought it might be hex. > >

How to XOR a byte output?

2016-04-13 Thread durgadevi1
Hi all, I have a doubt regarding a problem. First, I am required to read a given file. The output from the file is given below: b'$//W?\xc0\x829\xa2\xb9\x13\x8c\xd5{\' I used the type() to identify the class and its a byte class. I saw many \x and thought it might be hex. So, I used

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread Demur Rumed
Demur Rumed added the comment: Made changes from code review, did a little extra on fixing up type consistency, not sure if this is exactly the patch format you wanted; I tried `git difftool --extcmd='diff -u' python/master` but it's listing the original files as being from /tmp I've updated

[issue26057] Avoid nonneeded use of PyUnicode_FromObject()

2016-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your review Martin. -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue26057] Avoid nonneeded use of PyUnicode_FromObject()

2016-04-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3f3b3d4881f6 by Serhiy Storchaka in branch 'default': Issue #26057: Got rid of nonneeded use of PyUnicode_FromObject(). https://hg.python.org/cpython/rev/3f3b3d4881f6 -- nosy: +python-dev ___ Python

[issue26718] super.__init__ leaks memory if called multiple times

2016-04-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

Re: Enum questions.

2016-04-13 Thread Rustom Mody
On Wednesday, April 13, 2016 at 5:39:13 PM UTC+5:30, Michael Selik wrote: > On Wed, Apr 13, 2016, 12:14 PM Antoon Pardon > wrote: > > > I have been looking at the enum documentation and it > > seems enums are missing two features I rather find > > important. > > > > 1) Given an Enum value,

[issue26718] super.__init__ leaks memory if called multiple times

2016-04-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 450f36750cb9 by Serhiy Storchaka in branch '3.5': Issue #26718: super.__init__ no longer leaks memory if called multiple times. https://hg.python.org/cpython/rev/450f36750cb9 New changeset 4680438f486f by Serhiy Storchaka in branch '2.7': Issue

[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-13 Thread Petr Viktorin
Petr Viktorin added the comment: Indeed, the size is 0 there: {'family': 'DejaVu Sans Mono', 'size': 0, 'slant': 'roman', 'weight': 'normal', 'overstrike': 0, 'underline': 0} -- ___ Python tracker

Re: Enum questions.

2016-04-13 Thread Michael Selik
On Wed, Apr 13, 2016, 12:14 PM Antoon Pardon wrote: > I have been looking at the enum documentation and it > seems enums are missing two features I rather find > important. > > 1) Given an Enum value, someway to get the next/previous >one > > 2) Given two Enum

Re: Enum questions.

2016-04-13 Thread jmp
On 04/13/2016 12:12 PM, Antoon Pardon wrote: I have been looking at the enum documentation and it seems enums are missing two features I rather find important. 1) Given an Enum value, someway to get the next/previous one 2) Given two Enum values, iterate over the values between them.

[issue15984] Wrong documentation for PyUnicode_FromObject() and PyUnicode_FromEncodedObject()

2016-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. Thank you Martin for this improvement. -- assignee: docs@python -> martin.panter stage: patch review -> commit review ___ Python tracker

Re: Serious error in int() function?

2016-04-13 Thread Gregory Ewing
martin.spic...@gmail.com wrote: print int(float(2.8/0.1)) yields 27 instead of 28!! This is a consequence of the fact that the machine does floating point arithmetic in binary, not decimal. 0.1 is not exactly representable as a binary floating point number, and the result of the division

[issue26746] struct.pack(): trailing padding bytes on x64

2016-04-13 Thread Stefan Krah
Stefan Krah added the comment: Thank you. So technically, in the above NumPy example the format string generated by NumPy would be considered incomplete if we assume struct syntax: >>> m = memoryview(x) >>> m.format 'T{B:x:xxxL:y:B:z:}' I find this "0L" thing a very odd notation. Taking

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Mark Dickinson
Mark Dickinson added the comment: The output of `struct.pack('

[issue26057] Avoid nonneeded use of PyUnicode_FromObject()

2016-04-13 Thread Martin Panter
Martin Panter added the comment: Apart from one redundancy (see review), this looks good to me. -- ___ Python tracker ___

[issue15984] Wrong documentation for PyUnicode_FromObject() and PyUnicode_FromEncodedObject()

2016-04-13 Thread Martin Panter
Martin Panter added the comment: Here is a new version where I use the phrase “true Unicode object”. -- Added file: http://bugs.python.org/file42452/from_object_v4.patch ___ Python tracker

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread Ma Lin
Ma Lin added the comment: I'm afraid not. If run it 1000 times, only about <5 times occurs, the others are quite fine. I have installed faulthandler, let's wait the hunting. -- ___ Python tracker

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: > In addition, the printed strings are Simplified Chinese, my system's language > is it as well. Maybe it's a factor? Ooh yes. The Windows Console sucks to display Unicode: see the very old issue #1602 which is not fixed yet and is 9 years old... Try to

Re: Enum questions.

2016-04-13 Thread Marko Rauhamaa
Rustom Mody : > Given the eg in the docs: > from enum import Enum > class Color(Enum): > red = 1 > blue = 2 > green = 3 > Color(Color.red.value+1) > But: >>> class Color(enum.Enum): ... red = 0xff ... green = 0x00ff00 ... blue =

Re: Enum questions.

2016-04-13 Thread Rustom Mody
On Wednesday, April 13, 2016 at 3:43:41 PM UTC+5:30, Antoon Pardon wrote: > I have been looking at the enum documentation and it > seems enums are missing two features I rather find > important. > > 1) Given an Enum value, someway to get the next/previous >one > > 2) Given two Enum values,

[issue26746] struct.pack(): trailing padding bytes on x64

2016-04-13 Thread Martin Panter
Martin Panter added the comment: This behaviour seems to be documented, although it is not very explicit, and a bit surprising to me. See the third note at the end of : “align the end . . . with a repeat count of

[issue3132] implement PEP 3118 struct changes

2016-04-13 Thread Stefan Krah
Changes by Stefan Krah : -- versions: +Python 3.6 -Python 3.3 ___ Python tracker ___ ___

[issue3132] implement PEP 3118 struct changes

2016-04-13 Thread Stefan Krah
Stefan Krah added the comment: Here's a grammar that roughly describes the subset that NumPy supports. As for implementing this in the struct module: There is a new data description language on the horizon: http://datashape.readthedocs.org/en/latest/ It does not have all the low-level

Enum questions.

2016-04-13 Thread Antoon Pardon
I have been looking at the enum documentation and it seems enums are missing two features I rather find important. 1) Given an Enum value, someway to get the next/previous one 2) Given two Enum values, iterate over the values between them. Did I miss those in the documentation or are they

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread Ma Lin
Ma Lin added the comment: >> It looks like a bug in your application. Can you provide a short script to >> reproduce the bug? It's hard to believe it, the code has no way to behavior like that. I think this is not reproducible, it's random hang. As my subjective feelings, I suspect it's a

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: > To be honest, I'm a bit suprise that almost no one complain it, maybe it's my > system's fault? I don't know. It looks like a bug in your application. Can you provide a short script to reproduce the bug? -- ___

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread Ma Lin
Ma Lin added the comment: ok, I will try faulthandler module. >> Are you running your program in the Windows console (cmd.exe)? In IDLE? In >> PowerShell? One runs in pure command line mode, cmd.exe. The other is a simple tkinter GUI with a console for output message. To be honest, I'm a bit

  1   2   >