ANN: gcc-python-plugin 0.13

2014-10-01 Thread David Malcolm
gcc-python-plugin is a plugin for GCC 4.6 onwards which embeds the CPython interpreter within GCC, allowing you to write new compiler warnings in Python, generate code visualizations, etc. It ships with gcc-with-cpychecker, which implements static analysis passes for GCC aimed at finding bugs in

Re: how to parse standard algebraic notation

2014-10-01 Thread math math
On Tuesday, 30 September 2014 23:15:24 UTC+2, Gary Herron wrote: On 09/30/2014 01:53 PM, math math wrote: Hi, I am trying to learn Python while solving exercises. I want to basically write a program that inputs a polynomial in standard algebraic notation and outputs its

Re: Python code in presentations

2014-10-01 Thread Glenn Hutchings
On Tuesday, 30 September 2014 12:51:00 UTC+1, Jean-Michel Pichavant wrote: I'm currently writing a presentation to help my co-workers ramp up on new features of our tool (written in python (2.7)). I have some difficulties presenting code in an efficient way (with some basic syntax

Re: how to parse standard algebraic notation

2014-10-01 Thread Mark Lawrence
On 01/10/2014 08:01, math math wrote: [mega-snip] You are far more likely to get answers if you access this list via https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing and

Thoughts on python classes to represent an ebook reader

2014-10-01 Thread math math
Hi, I hope there are people here with strong OOP experience. Which classes would an object-oriented python programmer create for the design of a e-book reader for example? I am not really interested in the code, just the OOP classes that would come to one's mind for a task like this. It

Re: Weird SSL problem

2014-10-01 Thread Roland Hedberg
30 sep 2014 kl. 00:55 skrev Ned Deily n...@acm.org: In article cd8f39d9-acd9-4d6e-9aac-dbcdf607f...@adm.umu.se, Roland Hedberg roland.hedb...@adm.umu.se wrote: Hi! I¹m trying to access https://stsadweb.one.microsoft.com/adfs/.well-known/openid-configuration Doing it the simplest way

Re: how to parse standard algebraic notation

2014-10-01 Thread Chris Angelico
On Wed, Oct 1, 2014 at 5:01 PM, math math mathemati...@gmail.com wrote: What would be a good starting strategy for writing a program to take the derivative of a polynomial expression, such as this below?: x**3 + x**2 + x + 1 I am a bit confused about my overall strategy. Should one be

Re: Thoughts on python classes to represent an ebook reader

2014-10-01 Thread Wolfgang Maier
On 01.10.2014 10:14, math math wrote: Hi, I hope there are people here with strong OOP experience. Which classes would an object-oriented python programmer create for the design of a e-book reader for example? I am not really interested in the code, just the OOP classes that would come to

Re: SNI support in python 2.7 for Locust load tests

2014-10-01 Thread Reddy
Hi, Reddy writes: ... I'm trying to use locust (http://locust.io/) to run load test of one site we're developing. Everything was running nice and smooth until we switch the servers to use SNI. SNI is not officially supported in python 2.7.5 you have two options: Python 2.7.9

Re: Python code in presentations

2014-10-01 Thread Wolfgang Keller
Right now the method I'm using is write the code in notepad++, use a plugin (NppExport) to copy paste code into powerpoint. After using it a little bit, I'm really not satisfied with this method, it's expensive and all this copy paste stuff is driving me crazy. Not to mention that the syntax

How to show a dictionary sorted on a value within its data?

2014-10-01 Thread cl
I have a dictionary as follows:- { u'StarterAmps1': Row(id=4, ain=u'AIN3', name=u'StarterAmps1', conv=6834.374834509803, Description=u'Starter Amps'), u'LeisureVolts': Row(id=1, ain=u'AIN0', name=u'LeisureVolts', conv=29.01374215995874, Description=u'Leisure Volts'), u'RudderPos': Row(id=6,

Re: JSON-encoding very long iterators

2014-10-01 Thread Alfred Morgan
On Monday, September 29, 2014 7:10:18 PM UTC-7, Ian wrote: This would cause things that aren't lists to be encoded as lists. Sometimes that may be desirable, but in general if e.g. a file object sneaks its way into your JSON encode call, it is more likely correct to raise an error than to

Re: How to show a dictionary sorted on a value within its data?

2014-10-01 Thread Peter Otten
c...@isbd.net wrote: I have a dictionary as follows:- { u'StarterAmps1': Row(id=4, ain=u'AIN3', name=u'StarterAmps1', conv=6834.374834509803, Description=u'Starter Amps'), u'LeisureVolts': Row(id=1, ain=u'AIN0', name=u'LeisureVolts', conv=29.01374215995874, Description=u'Leisure Volts'),

Re: How to show a dictionary sorted on a value within its data?

2014-10-01 Thread Mark Lawrence
On 01/10/2014 10:58, c...@isbd.net wrote: I have a dictionary as follows:- { u'StarterAmps1': Row(id=4, ain=u'AIN3', name=u'StarterAmps1', conv=6834.374834509803, Description=u'Starter Amps'), u'LeisureVolts': Row(id=1, ain=u'AIN0', name=u'LeisureVolts', conv=29.01374215995874,

Re: How to show a dictionary sorted on a value within its data?

2014-10-01 Thread Joel Goldstick
On Wed, Oct 1, 2014 at 5:58 AM, c...@isbd.net wrote: I have a dictionary as follows:- { u'StarterAmps1': Row(id=4, ain=u'AIN3', name=u'StarterAmps1', conv=6834.374834509803, Description=u'Starter Amps'), u'LeisureVolts': Row(id=1, ain=u'AIN0', name=u'LeisureVolts',

Re: How to show a dictionary sorted on a value within its data?

2014-10-01 Thread cl
Peter Otten __pete...@web.de wrote: c...@isbd.net wrote: I have a dictionary as follows:- { u'StarterAmps1': Row(id=4, ain=u'AIN3', name=u'StarterAmps1', conv=6834.374834509803, Description=u'Starter Amps'), u'LeisureVolts': Row(id=1, ain=u'AIN0', name=u'LeisureVolts',

Re: How to show a dictionary sorted on a value within its data?

2014-10-01 Thread Joel Goldstick
On Wed, Oct 1, 2014 at 6:45 AM, c...@isbd.net wrote: Peter Otten __pete...@web.de wrote: c...@isbd.net wrote: I have a dictionary as follows:- { u'StarterAmps1': Row(id=4, ain=u'AIN3', name=u'StarterAmps1', conv=6834.374834509803, Description=u'Starter Amps'), u'LeisureVolts':

Re: How to show a dictionary sorted on a value within its data?

2014-10-01 Thread Peter Otten
c...@isbd.net wrote: Peter Otten __pete...@web.de wrote: c...@isbd.net wrote: I have a dictionary as follows:- { u'StarterAmps1': Row(id=4, ain=u'AIN3', name=u'StarterAmps1', conv=6834.374834509803, Description=u'Starter Amps'), u'LeisureVolts': Row(id=1, ain=u'AIN0',

Re: SNI support in python 2.7 for Locust load tests

2014-10-01 Thread Reddy
Hi, Reddy writes: ... I'm trying to use locust (http://locust.io/) to run load test of one site we're developing. Everything was running nice and smooth until we switch the servers to use SNI. SNI is not officially supported in python 2.7.5 you have two options: Python

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-10-01 Thread Peter Tomcsanyi
Ned Deily n...@acm.org wrote in message news:nad-d2ddcb.14070824062...@news.gmane.org... The easiest option would be a downloadable package that would allow the default python.org 8.5-linked _tkinter to be overridden with an 8.6 version. There may be some news on that front in the near future.

Re: how to parse standard algebraic notation

2014-10-01 Thread math math
Thanks a lot, I will give this a shot. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to show a dictionary sorted on a value within its data?

2014-10-01 Thread cl
Joel Goldstick joel.goldst...@gmail.com wrote: On Wed, Oct 1, 2014 at 6:45 AM, c...@isbd.net wrote: Peter Otten __pete...@web.de wrote: c...@isbd.net wrote: I have a dictionary as follows:- { u'StarterAmps1': Row(id=4, ain=u'AIN3', name=u'StarterAmps1',

Re: how to parse standard algebraic notation

2014-10-01 Thread Marco Buttu
On 01/10/2014 09:01, math math wrote: What would be a good starting strategy for writing a program to take the derivative of a polynomial expression, such as this below?: x**3 + x**2 + x + 1 You can look at sympy: from sympy import * equation = simplify(x**3 + x**2 + x + 1) equation x**3

Re: how to parse standard algebraic notation

2014-10-01 Thread Marco Buttu
On 01/10/2014 09:01, math math wrote: What would be a good starting strategy for writing a program to take the derivative of a polynomial expression, such as this below?: x**3 + x**2 + x + 1 You can look at sympy: from sympy import * equation = simplify(x**3 + x**2 + x + 1) equation x**3

Re: How to show a dictionary sorted on a value within its data?

2014-10-01 Thread cl
Joel Goldstick joel.goldst...@gmail.com wrote: On Wed, Oct 1, 2014 at 5:58 AM, c...@isbd.net wrote: I have a dictionary as follows:- { u'StarterAmps1': Row(id=4, ain=u'AIN3', name=u'StarterAmps1', conv=6834.374834509803, Description=u'Starter Amps'), u'LeisureVolts': Row(id=1,

Re: JSON-encoding very long iterators

2014-10-01 Thread Chris Angelico
On Wed, Oct 1, 2014 at 8:13 PM, Alfred Morgan alf...@54.org wrote: I added a stream flag (off by default) and also added file streaming (thanks for the idea). https://github.com/Zectbumo/cpython/compare/2.7 What do you think now? I think that you're adding features to Python 2.7, which

Re: Restarting Python

2014-10-01 Thread Steven D'Aprano
Terry Reedy wrote: Python does not have 'commands'. Terry, even experienced Python developers sometimes describe functions and statements as commands, e.g. Use the print command to display results. I think we can cut a beginner like Seymore a bit of slack for misusing terminology. -- Steven

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-10-01 Thread Kevin Walzer
On 10/1/14, 7:51 AM, Peter Tomcsanyi wrote: Ned Deily n...@acm.org wrote in message news:nad-d2ddcb.14070824062...@news.gmane.org... The easiest option would be a downloadable package that would allow the default python.org 8.5-linked _tkinter to be overridden with an 8.6 version. There may be

Re: Restarting Python

2014-10-01 Thread Rustom Mody
On Wednesday, October 1, 2014 6:39:11 PM UTC+5:30, Steven D'Aprano wrote: Terry Reedy wrote: Python does not have 'commands'. Terry, even experienced Python developers sometimes describe functions and statements as commands, e.g. Use the print command to display results. I think we can cut

Re: Keepin constants, configuration values, etc. in Python - dedicated module or what?

2014-10-01 Thread Steven D'Aprano
Chris Angelico wrote: I'd agree, where trivial limits is defined by each individual item. Going with straight Python code is fine for huge projects with long config files, as long as each config entry is itself simple. You even get a form of #include: from otherfile import *. I would argue

Re: Restarting Python

2014-10-01 Thread Steven D'Aprano
Seymore4Head wrote: Since the developers of Python decided to make Python 3 non backward compatible, I can't help but wonder why they don't think a command to restart would be a useful addition? Possibly because it isn't a useful addition? Or maybe they just never thought of it. But more

Re: Keepin constants, configuration values, etc. in Python - dedicated module or what?

2014-10-01 Thread Chris Angelico
On Thu, Oct 2, 2014 at 12:49 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Chris Angelico wrote: I'd agree, where trivial limits is defined by each individual item. Going with straight Python code is fine for huge projects with long config files, as long as each config entry

Clearing globals in CPython

2014-10-01 Thread Steven D'Aprano
Out of curiosity, I ran: globals().clear() in the interactive interpreter. It broke much more than I expected! Built-ins were no longer available, and import stopped working. I expected that global variables would be all lost, but built-ins would remain, since they don't live in the global

Re: Clearing globals in CPython

2014-10-01 Thread Chris Angelico
On Thu, Oct 2, 2014 at 2:00 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Obviously the easiest way to recover is to exit the current session and restart it, but as a challenge, can we recover from this state? Oooh interesting. This is kinda like breaking out of a sandbox, and

Re: Python code in presentations

2014-10-01 Thread Jean-Michel Pichavant
- Original Message - From: Wolfgang Keller felip...@gmx.net To: python-list@python.org Sent: Wednesday, 1 October, 2014 11:42:34 AM Subject: Re: Python code in presentations Right now the method I'm using is write the code in notepad++, use a plugin (NppExport) to copy paste

Re: how to parse standard algebraic notation

2014-10-01 Thread Steven D'Aprano
math math wrote: Hi, I am trying to learn Python while solving exercises. I want to basically write a program that inputs a polynomial in standard algebraic notation and outputs its derivative. I know that I need to get the exponent somehow, but I am not sure how to accomplish this in

Re: how to parse standard algebraic notation

2014-10-01 Thread Chris Angelico
On Thu, Oct 2, 2014 at 2:45 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Code for evaluating mathematical expressions are very common, if you google for expression parser I am sure you will find many examples. Don't limit yourself to Python code, you can learn from code

Re: Clearing globals in CPython

2014-10-01 Thread Chris Kaynor
On Wed, Oct 1, 2014 at 9:14 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Oct 2, 2014 at 2:00 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Obviously the easiest way to recover is to exit the current session and restart it, but as a challenge, can we recover from this

Re: Clearing globals in CPython

2014-10-01 Thread Peter Otten
Steven D'Aprano wrote: Out of curiosity, I ran: globals().clear() in the interactive interpreter. It broke much more than I expected! Built-ins were no longer available, and import stopped working. I expected that global variables would be all lost, but built-ins would remain, since

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-10-01 Thread Ned Deily
In article m0gps5$4r5$1...@ger.gmane.org, Peter Tomcsanyi tomcsa...@slovanet.sk wrote: Ned Deily n...@acm.org wrote in message news:nad-d2ddcb.14070824062...@news.gmane.org... It's October... So I tried Python 3.4.2rc1 and it seems that it still links to Tk 8.5 on Mac. Does it mean that

Re: Restarting Python

2014-10-01 Thread Terry Reedy
On 10/1/2014 10:47 AM, Steven D'Aprano wrote: Inside the interactive interpreter, I can restart the interpreter with four keystrokes: - Ctrl-D - UP-ARROW - ENTER Ctrl-D exits Python and returns me to the shell, UP-ARROW fetches the previous command (python), and ENTER runs that command. On

Re: Clearing globals in CPython

2014-10-01 Thread Mark Lawrence
On 01/10/2014 17:00, Steven D'Aprano wrote: Out of curiosity, I ran: globals().clear() in the interactive interpreter. It broke much more than I expected! Built-ins were no longer available, and import stopped working. I expected that global variables would be all lost, but built-ins would

Re: Clearing globals in CPython

2014-10-01 Thread Terry Reedy
On 10/1/2014 12:00 PM, Steven D'Aprano wrote: Out of curiosity, I ran: globals().clear() in the interactive interpreter. It broke much more than I expected! Built-ins were no longer available, and import stopped working. As you discovered, this reduces the interpreter to a pure syntax

Re: JSON-encoding very long iterators

2014-10-01 Thread Alfred Morgan
On Wednesday, October 1, 2014 6:07:23 AM UTC-7, Chris Angelico wrote: On Wed, Oct 1, 2014 at 8:13 PM, Alfred Morgan wrote: What do you think now? I think that you're adding features to Python 2.7, which isn't getting new features. That won't be merged into trunk. Does your patch apply to

Re: Obscuring Python source from end users

2014-10-01 Thread Dan Stromberg
On Mon, Sep 29, 2014 at 4:47 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: norman.i...@gmail.com wrote: Hello list Python 3.4 applies. I have a project that involves distributing Python code to users in an organisation. Users do not interact directly with the Python code;

Function passed as an argument returns none

2014-10-01 Thread Shiva
Hi, I am learning Python (version 3.4) strings.I have a function that takes in a parameter and prints it out as given below. def donuts(count): if count = 5: print('Number of donuts: ',count) else: print('Number of donuts: many') return It works fine if I call donuts(5) It

Re: Function passed as an argument returns none

2014-10-01 Thread Andrew Berg
On 2014.10.01 17:37, Shiva wrote: Only 'None' gets passed on to parameter 'got' instead of the expected value of 4. Any idea why 'None' is getting passed even though calling the donuts(4) alone returns the expected value? donuts() prints what you tell it to (Number of donuts: 5), and then

Re: Function passed as an argument returns none

2014-10-01 Thread Chris Kaynor
Chris On Wed, Oct 1, 2014 at 3:37 PM, Shiva shivaji...@yahoo.com.dmarc.invalid wrote: Hi, I am learning Python (version 3.4) strings.I have a function that takes in a parameter and prints it out as given below. def donuts(count): if count = 5: print('Number of donuts: ',count)

Re: JSON-encoding very long iterators

2014-10-01 Thread Chris Angelico
On Thu, Oct 2, 2014 at 8:01 AM, Alfred Morgan alf...@54.org wrote: On Wednesday, October 1, 2014 6:07:23 AM UTC-7, Chris Angelico wrote: On Wed, Oct 1, 2014 at 8:13 PM, Alfred Morgan wrote: What do you think now? I think that you're adding features to Python 2.7, which isn't getting new

Re: Function passed as an argument returns none

2014-10-01 Thread Mark Lawrence
On 01/10/2014 23:37, Shiva wrote: Hi, I am learning Python (version 3.4) strings.I have a function that takes in a parameter and prints it out as given below. def donuts(count): if count = 5: print('Number of donuts: ',count) else: print('Number of donuts: many') return It

Re: Function passed as an argument returns none

2014-10-01 Thread Denis McMahon
On Wed, 01 Oct 2014 22:37:13 +, Shiva wrote: Hi, I am learning Python (version 3.4) strings.I have a function that takes in a parameter and prints it out as given below. def donuts(count): if count = 5: print('Number of donuts: ',count) else: print('Number of donuts:

Error from pandas.io.data import DataReader

2014-10-01 Thread ryanshuell
I am trying to run this snippet of code. from pandas.io.data import DataReader from pandas import Panel, DataFrame import datetime start = datetime.datetime(2010, 1, 1) end = datetime.datetime(2013, 1, 27) with open('dow.txt') as f: symbols = f.read().splitlines() # ['AAPL', 'GLD', 'SPX',

Re: Function passed as an argument returns none

2014-10-01 Thread Rustom Mody
On Thursday, October 2, 2014 4:07:44 AM UTC+5:30, Shiva wrote: Hi, I am learning Python (version 3.4) strings.I have a function that takes in a parameter and prints it out as given below. def donuts(count): if count = 5: print('Number of donuts: ',count) else: print('Number of

Re: Function passed as an argument returns none

2014-10-01 Thread Chris Angelico
On Thu, Oct 2, 2014 at 12:29 PM, Rustom Mody rustompm...@gmail.com wrote: So by now you know there are 2 kinds of return: So the morals in short: 1. Stick to the return that works -- python's return statement -- and avoid the return that seems to work -- the print statement Please. There

Re: How to show a dictionary sorted on a value within its data?

2014-10-01 Thread Travis Griggs
Sent from my iPhone On Oct 1, 2014, at 04:12, Peter Otten __pete...@web.de wrote: `lambda` is just a fancy way to define a function inline Not sure fancy is the correct adjective; more like syntactic tartness (a less sweet version of syntactic sugar). :) --

Re: Obscuring Python source from end users

2014-10-01 Thread Marko Rauhamaa
Dan Stromberg drsali...@gmail.com: On Mon, Sep 29, 2014 at 4:47 AM, Steven D'Aprano Yes. Distribute the pyc files only. Yes, this is the way it's usually done. Has the .pyc file format stabilized? A decade ago, my employer shipped an application as .pyc files but had to ship the matching

[issue22472] OSErrors should use str and not repr on paths

2014-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: вівторок, 30-вер-2014 19:26:52 ви написали: How do I reconstruct an arbitrary OSError error message using the filename parameter? if not e.args: msg = '' elif len(e.args) == 1: msg = str(e.args[0]) elif len(e.args) = 5: msg = '[Error %s] %s' %

[issue20079] Add support for glibc supported locales

2014-10-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Thanks, Serhiy. The patch looks good, except for one nit: the makelocalealias.py normaly also generates a list of changes and these are put at the top of the locale_alias dictionary. Could you add that as well ? --

[issue17873] _ctypes/libffi missing bits for aarch64 support

2014-10-01 Thread Andreas Schwab
Andreas Schwab added the comment: https://build.opensuse.org/package/show/openSUSE:Factory:ARM/python3-base -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17873 ___

[issue20079] Add support for glibc supported locales

2014-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The makelocalealias.py generates only a list of removes and updates, not additions. I recommend first apply issue20076, it will eliminate most additions. -- ___ Python tracker rep...@bugs.python.org

[issue19113] duplicate test names in Lib/ctypes/test/test_functions.py

2014-10-01 Thread Xavier de Gaye
Xavier de Gaye added the comment: This issue has been entered while checking for duplicate test names in issue 16079. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19113 ___

[issue21963] 2.7.8 backport of Issue1856 (avoid daemon thread problems at shutdown) breaks ceph

2014-10-01 Thread STINNER Victor
STINNER Victor added the comment: Oh by the way, I also prefer to revert the commit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21963 ___

[issue21574] Port image types detections from PIL to the imghdr module

2014-10-01 Thread Andriy Sokolovskiy
Andriy Sokolovskiy added the comment: I'll try to do this issue. https://mail.python.org/mailman/private/core-mentorship/2014-October/002766.html -- nosy: +coldmind ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21574

[issue22492] small addition to print() docs: no binary streams.

2014-10-01 Thread Georg Brandl
Georg Brandl added the comment: Looks good. sys.stdout, when rebound to a binary mode file Not sure that is supported in any way :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22492

[issue22531] Turn contextlib.{redirect_stdout, suppress} into ContextDecorators

2014-10-01 Thread Antony Lee
New submission from Antony Lee: A small lib improvement suggestion could be to make contextlib.redirect_stdout and contextlib.suppress inherit from ContextDecorator. As a side note, the source of contextlib has some classes inheriting explicitly from object while others don't, so perhaps this

[issue20076] Add UTF-8 locale aliases

2014-10-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Thanks, Serhiy The patch looks good. Please apply. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20076 ___

[issue20079] Add support for glibc supported locales

2014-10-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 01.10.2014 09:52, Serhiy Storchaka wrote: The makelocalealias.py generates only a list of removes and updates, not additions. Ah, ok. I recommend first apply issue20076, it will eliminate most additions. Agreed. Please apply both patches.

[issue22494] default logging time string is not localized

2014-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm a bit surprised here, since the comma is not the default (US) decimal point. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22494 ___

[issue21971] Index and update turtledemo doc.

2014-10-01 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21971 ___ ___ Python-bugs-list

[issue22001] containers same does not always mean __eq__.

2014-10-01 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22001 ___ ___

[issue21999] shlex: bug in posix mode handling of empty strings

2014-10-01 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21999 ___

[issue22494] default logging time string is not localized

2014-10-01 Thread Georg Brandl
Georg Brandl added the comment: It's not so surprising, since the string before the milliseconds part is a strftime() result, not a whole number. The decimal point need not necessarily be used for this. Just like the rest of the default time format, it is probably best for the millisecond

[issue22531] Turn contextlib.{redirect_stdout, suppress} into ContextDecorators

2014-10-01 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22531 ___ ___ Python-bugs-list

[issue22494] default logging time string is not localized

2014-10-01 Thread Vinay Sajip
Vinay Sajip added the comment: ISO 8601 governs the format used. From the Wikipedia article on the same: A decimal mark, either a comma or a dot (without any preference as stated in resolution 10 of the 22nd General Conference CGPM in 2003, but with a preference for a comma according to ISO

[issue22515] Implement partial order on Counter

2014-10-01 Thread Eric V. Smith
Eric V. Smith added the comment: Is there some particular problem you're trying to solve, which this would make easier? Without a use case, I'm -1. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22515

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ram Rachum
Ram Rachum added the comment: I needed it for an internal calculation in a combinatorics package I'm writing. Do you want me to take the time to explain the calculation? It's quite complex. -- ___ Python tracker rep...@bugs.python.org

[issue22532] A suggested change

2014-10-01 Thread Padmanabhan Tr
New submission from Padmanabhan Tr: Take a complex number n = 3+4j. n.real is taken as 3.0 n.imag as 4.0 in Python3. One has to use the int(0 function to get back the parts as integers. I guess this is a compiler error? -- messages: 228073 nosy: Padmanabhan.Tr priority: normal

[issue22472] OSErrors should use str and not repr on paths

2014-10-01 Thread R. David Murray
R. David Murray added the comment: Thank you, Serhiy. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22472 ___ ___ Python-bugs-list mailing list

[issue22531] Turn contextlib.{redirect_stdout, suppress} into ContextDecorators

2014-10-01 Thread R. David Murray
R. David Murray added the comment: -100 on doing this for suppress. That would be exactly the kind of wrong-headed code that I was worried that context manager would invite. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org

[issue22532] A suggested change

2014-10-01 Thread Geoffrey Spear
Geoffrey Spear added the comment: From the documentation: Complex numbers have a real and imaginary part, which are each a floating point number. Needing to use int() to convert these floats to integers is not a bug, it's the expected behavior. -- nosy: +geoffreyspear

[issue22532] A suggested change

2014-10-01 Thread Geoffrey Spear
Changes by Geoffrey Spear geoffsp...@gmail.com: -- components: +Interpreter Core type: compile error - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22532 ___

[issue22532] A suggested change

2014-10-01 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22532 ___

[issue22515] Implement partial order on Counter

2014-10-01 Thread Eric V. Smith
Eric V. Smith added the comment: No need to explain it. It sounds like it's not generally useful, so I'm still -1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22515 ___

[issue22531] Turn contextlib.{redirect_stdout, suppress} into ContextDecorators

2014-10-01 Thread Nick Coghlan
Nick Coghlan added the comment: Aye, suppress is only intended for use around a single line of code. Using it for an entire function would be OnError Resume Next levels of poor coding style. I'm also -1 on implicitly wrapping redirect_stdout around functions due to the immediate thread

[issue22528] Missing hint to source code

2014-10-01 Thread Friedrich Spee von Langenfeld
Friedrich Spee von Langenfeld added the comment: Excuse me, but it would be nice to fix the documentation of the modules symtable and compileall too. Thanks. -- resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org

[issue22532] A suggested change

2014-10-01 Thread Padmanabhan Tr
Padmanabhan Tr added the comment: Dear Mr SpearThanks for the prompt response clarification.(in Python) If the real imaginary parts of numbers you deal with are integers, results of operations (except division)  - like +, -, *, **, - appear with respective integers as real imginary parts. 

[issue22515] Implement partial order on Counter

2014-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Even if you don't find it useful, Eric, it doesn't take up the method space. You can very easily ignore it, there's no cognitive burden. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22515

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ethan Furman
Ethan Furman added the comment: Curiousity question: What happens if you try to sort a list of partially ordered Counters? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22515 ___

[issue22515] Implement partial order on Counter

2014-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: If it is so specialized as to only be needed in complex combinatorial calculations How do you know it is only needed in complex combinatorial calculations? What happens if you try to sort a list of partially ordered Counters? Try it with partially ordered

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ethan Furman
Ethan Furman added the comment: If it is so specialized as to only be needed in complex combinatorial calculations, does it belong in the general-purpose part of the language? After all, we have the math and cmath modules for more specialized arithmetic operations. --

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ram Rachum
Ram Rachum added the comment: I don't see why it's so hard to imagine how this will be used. Say I have a counter signifying how many of each product I have in my warehouse, and I have another counter saying how many of each product a client wants. I may use `counter2 = counter1` to check

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ethan Furman
Ethan Furman added the comment: -- s1 = set([1]) -- s2 = set([1, 2]) -- s3 = set([1, 2, 3]) -- s4 = set([2]) -- s5 = set([2, 3]) -- s6 = set([3]) -- l = [s1, s2, s3, s4, s5, s6] -- sorted(l) [{1}, {2}, {1, 2}, {3}, {2, 3}, {1, 2, 3}] -- s1 s4 False -- s4 s2 True -- s1 s2 True -- s4 s6

[issue22515] Implement partial order on Counter

2014-10-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Ethan said: If it is so specialized as to only be needed in complex combinatorial calculations, does it belong in the general-purpose part of the language? It's a multi-set, a general purpose and fairly fundamental data type.

[issue9949] os.path.realpath on Windows does not follow symbolic links

2014-10-01 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9949 ___ ___ Python-bugs-list

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ethan Furman
Ethan Furman added the comment: I'll go with +0.5. :) If this goes in, I think a missing key in either Counter should default to 0 for purposes of the ordering. -- stage: - test needed ___ Python tracker rep...@bugs.python.org

[issue22515] Implement partial order on Counter

2014-10-01 Thread Ram Rachum
Ram Rachum added the comment: If/when there's general agreement that this functionality should be merged in (assuming the implementation is acceptable), let me know and I'll be happy to write the code and tests. -- ___ Python tracker

[issue20218] Add methods to `pathlib.Path`: `write_text`, `read_text`, `write_bytes`, `read_bytes`

2014-10-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset a4da150fbfd4 by Georg Brandl in branch 'default': Closes #20218: Added convenience methods read_text/write_text and read_bytes/ https://hg.python.org/cpython/rev/a4da150fbfd4 -- nosy: +python-dev resolution: - fixed stage: - resolved

[issue20218] Add methods to `pathlib.Path`: `write_text`, `read_text`, `write_bytes`, `read_bytes`

2014-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks, Georg! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20218 ___ ___ Python-bugs-list mailing list

[issue22515] Implement partial order on Counter

2014-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'll go with +0.5. :) I was going to make a joke about Counters only accepting integral values, but the constructor is actually quite laxist: Counter({'a': 2.5}) Counter({'a': 2.5}) Counter({'a': 2.5 + 1j}) Counter({'a': (2.5+1j)}) Counter({'a': 'b'})

[issue19529] Fix unicode_aswidechar() with 4byte unicode and 2byte wchar_t, for AIX

2014-10-01 Thread Georg Brandl
Georg Brandl added the comment: Committed in 18983332626b. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19529 ___

  1   2   >