ANN: pandas v0.15.1

2014-11-09 Thread Jeff Reback
Hello, We are proud to announce v0.15.1 of pandas, a minor release from 0.15.0. This release includes a small number of API changes, several new features, enhancements, and performance improvements along with a large number of bug fixes. This was a short release of 3 weeks with 59 commits by 20

ANN: pandas v0.15.1

2014-11-09 Thread Jeff Reback
Hello, We are proud to announce v0.15.1 of pandas, a minor release from 0.15.0. This release includes a small number of API changes, several new features, enhancements, and performance improvements along with a large number of bug fixes. This was a short release of 3 weeks with 59 commits by 20

Re: How do i reduce this to a single function - the code is largely similar, just a direction of search toggle.

2014-11-09 Thread Veek M
Ned Batchelder wrote: On 11/7/14 9:52 AM, Veek M wrote: and you want to end up on the def token, not the def in yep, bumped into this :) thanks! -- https://mail.python.org/mailman/listinfo/python-list

functools documentation - help with funny words

2014-11-09 Thread Veek M
https://docs.python.org/3.4/library/functools.html 1. A key function is a callable that accepts one argument and returns another value indicating the position in the desired collation sequence. x = ['x','z','q']; sort(key=str.upper) My understanding is that, x, y, .. are passed to the key

dictionary issue for formatted print

2014-11-09 Thread Yusuf Can Bayrak
when dictionary has one value for each key it's okey. I'm just type '% greek_letters' and it's working. But how can i assign dict's values to formatted print, if it has more values than one. 1. # -*- coding: utf-8 -*- 2. greek_letters = { 3. 'omega': ['ω','Ω'],

What is description attribute in python?

2014-11-09 Thread satishmlmlml
What does description attribute in the following code mean? curs.execute('select * from people') colnames = [desc[0] for desc in curs.description] -- https://mail.python.org/mailman/listinfo/python-list

What does zip mean?

2014-11-09 Thread satishmlmlml
What does zip return in the following piece of code? curs.execute('select * from people') colnames = [desc[0] for desc in curs.description] rowdicts = [] for row in curs.fetchall(): rowdicts.append(dict(zip(colnames, row))) -- https://mail.python.org/mailman/listinfo/python-list

Re: What is description attribute in python?

2014-11-09 Thread Steven D'Aprano
satishmlm...@gmail.com wrote: What does description attribute in the following code mean? curs.execute('select * from people') colnames = [desc[0] for desc in curs.description] It's an attribute called description. You would need to read the documentation for curs to know what it does.

Re: What does zip mean?

2014-11-09 Thread Steven D'Aprano
satishmlm...@gmail.com wrote: What does zip return in the following piece of code? Have you read the Fine Manual? In Python 2, zip returns a list: zip(['a', 'b', 'c'], [1, 2, 3]) = [('a', 1), ('b', 2), ('c', 3)] https://docs.python.org/2/library/functions.html#zip In Python 3, zip does

Re: What does zip mean?

2014-11-09 Thread milos zorica
sorry my bad On Sun, Nov 9, 2014 at 7:58 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: satishmlm...@gmail.com wrote: What does zip return in the following piece of code? Have you read the Fine Manual? In Python 2, zip returns a list: zip(['a', 'b', 'c'], [1, 2, 3])

Re: What is description attribute in python?

2014-11-09 Thread satishmlmlml
curs is coming from the following piece of code import sqlite3 conn = sqlite3.connect('dbase1') curs = conn.cursor() -- https://mail.python.org/mailman/listinfo/python-list

Re: What is description attribute in python?

2014-11-09 Thread Deepfriedice
On 09/11/14 20:59, Steven D'Aprano wrote: It's an attribute called description. You would need to read the documentation for curs to know what it does. What is curs? Where does it come from? It looks like a cursor from an SQL DB library. For example, sqlite3 in the standard library provides a

What is rstrip() in python?

2014-11-09 Thread satishmlmlml
What is rstrip() in python? What does it do in the following piece of code? import sqlite3 conn = sqlite3.connect('dbase1') curs = conn.cursor() file = open('data.txt') rows = [line.rstrip().split(',') for line in file] -- https://mail.python.org/mailman/listinfo/python-list

Re: What is rstrip() in python?

2014-11-09 Thread Chris Angelico
On Sun, Nov 9, 2014 at 10:11 PM, satishmlm...@gmail.com wrote: What is rstrip() in python? What does it do in the following piece of code? import sqlite3 conn = sqlite3.connect('dbase1') curs = conn.cursor() file = open('data.txt') rows = [line.rstrip().split(',') for line in file] Do

Re: [Python-Dev] Dinamically set __call__ method

2014-11-09 Thread Gregory Ewing
Ethan Furman wrote: And the thing going on is the normal python behavior (in __getattribute__, I believe) of examining the returned attribute to see if it is a descriptor, and if so invoking it. Only if you look it up through the instance, though. Normally, if you look up an attribute on a

Engaging, powerful - video inspriration/learning - Your best selections

2014-11-09 Thread flebber
Not fans of videos hey(well python videos anyway) bugger. Sayth. -- https://mail.python.org/mailman/listinfo/python-list

Re: What is description attribute in python?

2014-11-09 Thread Tim Chase
On 2014-11-09 02:42, satishmlm...@gmail.com wrote: What does description attribute in the following code mean? curs.execute('select * from people') colnames = [desc[0] for desc in curs.description] http://legacy.python.org/dev/peps/pep-0249/#cursor-attributes -tkc --

Re: Syncing audio and video for casual recording

2014-11-09 Thread Steven D'Aprano
posted mailed Tobiah wrote: I decided I'd like to publish some youtube videos of me playing an instrument. The audio being the important bit, I'd like to use my existing mics, which I've been sending through a USB audio interface to my computer. I don't have any camera yet, other than a

Re: What is rstrip() in python?

2014-11-09 Thread Steven D'Aprano
satishmlm...@gmail.com wrote: What is rstrip() in python? Have you read the Fine Manual? Did you try googling first? https://duckduckgo.com/html/?q=python+rstrip What does it do in the following piece of code? It removes trailing whitespace. import sqlite3 conn =

Re: [Python-Dev] Dinamically set __call__ method

2014-11-09 Thread Steven D'Aprano
Gregory Ewing wrote: Ethan Furman wrote: And the thing going on is the normal python behavior (in __getattribute__, I believe) of examining the returned attribute to see if it is a descriptor, and if so invoking it. Only if you look it up through the instance, though. Normally, if you

Re:dictionary issue for formatted print

2014-11-09 Thread Dave Angel
Yusuf Can Bayrak yusufcanbay...@gmail.com Wrote in message: when dictionary has one value for each key it's okey. I'm just type '% greek_letters' and it's working. But how can i assign dict's values to formatted print, if it has more values than one. # -*- coding: utf-8 -*-greek_letters =

Re: What is description attribute in python?

2014-11-09 Thread Mark Lawrence
On 09/11/2014 11:05, satishmlm...@gmail.com wrote: curs is coming from the following piece of code import sqlite3 conn = sqlite3.connect('dbase1') curs = conn.cursor() Today's exercise is to find the documentation and read it before posting another question. Better still is to use the

Re: What is rstrip() in python?

2014-11-09 Thread Mark Lawrence
On 09/11/2014 11:11, satishmlm...@gmail.com wrote: What is rstrip() in python? It's a function or method call. What does it do in the following piece of code? I'm not actually sure. Would you be kind enough to look it up in the documentation for me and let me know, thanks? import

Re: dictionary issue for formatted print

2014-11-09 Thread Peter Otten
Yusuf Can Bayrak wrote: when dictionary has one value for each key it's okey. I'm just type '% greek_letters' and it's working. But how can i assign dict's values to formatted print, if it has more values than one. 1. # -*- coding: utf-8 -*- 2. greek_letters = { 3.

Re: functools documentation - help with funny words

2014-11-09 Thread Ian Kelly
On Sun, Nov 9, 2014 at 2:06 AM, Veek M vek.m1...@gmail.com wrote: https://docs.python.org/3.4/library/functools.html 1. A key function is a callable that accepts one argument and returns another value indicating the position in the desired collation sequence. x = ['x','z','q'];

Re: What is rstrip() in python?

2014-11-09 Thread Terry Reedy
On 11/9/2014 6:11 AM, satishmlm...@gmail.com wrote: What is rstrip() in python? The manuals have a rather complete index. If 'rstrip' is missing from the index, let us know so we can fix it. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: What is rstrip() in python?

2014-11-09 Thread Joel Goldstick
On Sun, Nov 9, 2014 at 12:46 PM, Terry Reedy tjre...@udel.edu wrote: On 11/9/2014 6:11 AM, satishmlm...@gmail.com wrote: What is rstrip() in python? google on 'rstrip python' gets this at first link: https://docs.python.org/2/library/stdtypes.html#str.rstrip google is your friend. The

Python script that does batch find and replace in txt files

2014-11-09 Thread Syed Khalid
Python script that does batch find and replace in txt files Need a python script that opens all .txt files in a folder find replace/delete text and save files. I have text files and I need to perform below steps for each file. Step 1: Put cursor at start of file and Search for Contact's

Re: [Python-Dev] Dinamically set __call__ method

2014-11-09 Thread Ethan Furman
On 11/09/2014 03:38 AM, Gregory Ewing wrote: Ethan Furman wrote: And the thing going on is the normal python behavior (in __getattribute__, I believe) of examining the returned attribute to see if it is a descriptor, and if so invoking it. Only if you look it up through the instance,

Re: Python script that does batch find and replace in txt files

2014-11-09 Thread Mark Lawrence
On 09/11/2014 19:58, Syed Khalid wrote: Python script that does batch find and replace in txt files Need a python script that opens all .txt files in a folder find replace/delete text and save files. I have text files and I need to perform below steps for each file. Step 1: Put cursor at

Re: Python script that does batch find and replace in txt files

2014-11-09 Thread Albert-Jan Roskam
- Original Message - From: Syed Khalid khalidn...@gmail.com To: python-list@python.org Cc: Sent: Sunday, November 9, 2014 8:58 PM Subject: Python script that does batch find and replace in txt files Python script that does batch find and replace in txt files Need a python

Re: Python script that does batch find and replace in txt files

2014-11-09 Thread Syed Khalid
Hi Albert, Thank you for script. I am getting the below error : File EamClean.log, line 12 with codecs.open(txt + _out.txt, wb, encoding=utf-8) as w: ^ SyntaxError: invalid syntax Kindly do the needful. On Mon, Nov 10, 2014 at 1:53 AM, Albert-Jan Roskam fo...@yahoo.com wrote:

Re: Python script that does batch find and replace in txt files

2014-11-09 Thread Syed Khalid
My Script, I have added import glob, codecs, re, os regex = re.compile(rAge: |Sex: |House No: ) # etc etc Script I executed in EditRocket : for txt in glob.glob(/D:/Python/source/*.txt): with codecs.open(txt, encoding=utf-8) as f: oldlines = f.readlines() for i, line in

Re: Python script that does batch find and replace in txt files

2014-11-09 Thread Syed Khalid
Code after adding path of .txt files : import glob, codecs, re, os regex = re.compile(rAge: |Sex: |House No: ) # etc etc for txt in glob.glob(D:/Python/source/*.txt): with codecs.open(txt, encoding=utf-8) as f: oldlines = f.readlines() for i, line in enumerate(oldlines):

Re: Python script that does batch find and replace in txt files

2014-11-09 Thread MRAB
On 2014-11-09 21:20, Syed Khalid wrote: Code after adding path of .txt files : import glob, codecs, re, os regex = re.compile(rAge: |Sex: |House No: ) # etc etc for txt in glob.glob(D:/Python/source/*.txt): with codecs.open(txt, encoding=utf-8) as f: oldlines = f.readlines()

Re: Python script that does batch find and replace in txt files

2014-11-09 Thread Syed Khalid
Albert, Thanks a million for script, It worked fine after I closed the bracket. import glob, codecs, re, os regex = re.compile(rAge: |Sex: |House No: ) # etc etc for txt in glob.glob(D:/Python/source/*.txt): with codecs.open(txt, encoding=utf-8) as f: oldlines = f.readlines()

Re: Python script that does batch find and replace in txt files

2014-11-09 Thread Albert-Jan Roskam
On Sun, Nov 9, 2014 10:51 PM CET Syed Khalid wrote: Albert, Thanks a million for script, It worked fine after I closed the bracket. import glob, codecs, re, os regex = re.compile(rAge: |Sex: |House No: ) # etc etc for txt in glob.glob(D:/Python/source/*.txt):

__missing__ for the top-level Python script

2014-11-09 Thread Chris Angelico
Let's have some fun nutting out possible implementations for a bad idea :) If you want a dictionary that prepopulates itself on demand, you implement __missing__. Is there a way to implement the same thing for the __main__ module? Since it isn't imported (as such), I don't think switch out what's

Re: Python script that does batch find and replace in txt files

2014-11-09 Thread Syed Khalid
Albert, Code is not removing empty lines containing blank characters and not removing leading and trailing spaces present in each line. import glob, codecs, re, os regex = re.compile(rAge: |Sex: |House No: ) # etc etc for txt in glob.glob(D:/Python/source/*.txt): with

Python modules

2014-11-09 Thread Steve Hayes
I have a book on Python that advocates dividing programs into modules, and importing them when needed. I have a question about this. I can understand doing that in a compiled language, where different modules can be imported from all sorts of places when the program is compiled. But I

Re: Python modules

2014-11-09 Thread Deepfriedice
On 10/11/14 14:55, Steve Hayes wrote: I have a book on Python that advocates dividing programs into modules, and importing them when needed. I have a question about this. I can understand doing that in a compiled language, where different modules can be imported from all sorts of places when

Re: Python modules

2014-11-09 Thread Ben Finney
Steve Hayes hayes...@telkomsa.net writes: I have a book on Python that advocates dividing programs into modules, and importing them when needed. Which book is this? (This is not essential to your question, but it might help to gauge your broader learning environment.) I can understand doing

Re: Python modules

2014-11-09 Thread Steve Hayes
On Mon, 10 Nov 2014 16:12:07 +1100, Ben Finney ben+pyt...@benfinney.id.au wrote: Steve Hayes hayes...@telkomsa.net writes: I have a book on Python that advocates dividing programs into modules, and importing them when needed. Which book is this? (This is not essential to your question, but it

Re: Python modules

2014-11-09 Thread Ben Finney
Steve Hayes hayes...@telkomsa.net writes: So if I want to run it on another computer, where do I look for the compiled executable program to copy? You generally don't do that (the compiled files tend to be specific to various aspects of the target platform). This is a way that i's important to

[issue2636] Adding a new regex module (compatible with re)

2014-11-09 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for pushing this one forward Serhiy! Your approach sounds like a fine plan to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2636 ___

[issue22825] Modernize TextFile

2014-11-09 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch makes distutils.text_file.TextFile support context management and iterator protocols. It makes the use of TextFile simpler. The patch also includes other minor modernizations. -- components: Distutils files: text_file.diff keywords:

[issue2636] Adding a new regex module (compatible with re)

2014-11-09 Thread Jeffrey C. Jacobs
Jeffrey C. Jacobs added the comment: If I recall, I started this thread with a plan to update re itself with implementations of various features listed in the top post. If you look at the list of files uploaded by me there are seme complete patches for Re to add various features like Atomic

[issue22826] Support context management protocol in bkfile

2014-11-09 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch makes bkfile (file-like class used in freeze) support the context management protocol. This makes bkfile more file-like and makes the use of it simpler and more robust. -- components: Demos and Tools files: bkfile.diff keywords:

[issue22827] Backport ensurepip to 2.7 (PEP 477)

2014-11-09 Thread Donald Stufft
New submission from Donald Stufft: As specified in PEP 477, this backports PEP 453 (ensurepip) to the Python 2.7 branch. Key differences from PEP 453 are: * It is not run by default in the Makefile * There is no venv modules, so downstream can remove it (though are asked to patch it to

[issue22828] Backport ensurepip to 2.7 (PEP 477)

2014-11-09 Thread Donald Stufft
New submission from Donald Stufft: As specified in PEP 477, this backports PEP 453 (ensurepip) to the Python 2.7 branch. Key differences from PEP 453 are: * It is not run by default in the Makefile * There is no venv modules, so downstream can remove it (though are asked to patch it to

[issue22828] Backport ensurepip to 2.7 (PEP 477)

2014-11-09 Thread Donald Stufft
Donald Stufft added the comment: Closing this in favor of http://bugs.python.org/issue22827 -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22828

[issue22827] Backport ensurepip to 2.7 (PEP 477)

2014-11-09 Thread Donald Stufft
Changes by Donald Stufft don...@stufft.io: -- nosy: +steve.dower ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22827 ___ ___ Python-bugs-list

[issue22827] Backport ensurepip to 2.7 (PEP 477)

2014-11-09 Thread Donald Stufft
Donald Stufft added the comment: Second patch just fixes the docs to specify the correct behavior for 2.7 and it fixes ensurepip.bootstrap() to match the default 2.7 behavior when executing python -m ensurepip. -- Added file: http://bugs.python.org/file37155/pep-477-2.patch

[issue22826] Support context management protocol in bkfile

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: This looks correct and it improves readability. One nit, please put the doubled with on a single line instead of using the awkward line break (which looks weird with respect to the indentation of the with-block): +with open(config_c_in) as infp,

[issue22829] Add --prompt option to venv

2014-11-09 Thread Łukasz Balcerzak
New submission from Łukasz Balcerzak: virtualenv tool allows to set alternative prompt prefix, Python's venv module should allow this too. Basically, this allows one to run: python -mvenv --prompt Quux myenv And see (Quux) as a prefix after environment activation (instead of the myenv in

[issue21288] hashlib.pbkdf2_hmac Hash Constructor

2014-11-09 Thread Eric Beurre
Changes by Eric Beurre h...@ericbeurre.com: -- nosy: +egbutter ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21288 ___ ___ Python-bugs-list

[issue22830] functools.cmp_to_key: misleading key function description

2014-11-09 Thread Terry J. Reedy
New submission from Terry J. Reedy: https://docs.python.org/3.4/library/functools.html#functools.cmp_to_key says A key function is a callable that accepts one argument and returns another value indicating the position in the desired collation sequence. A python list poster (Veek M) 'value

[issue22434] Use named constants internally in the re module

2014-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Raymond for the review. I especially like the removal of superfluous OPCODES dictionary lookups The disadvantage is that now backporting patches to old branches is harder. Since the op codes are singletons, you can use identity tests instead of

[issue22830] functools.cmp_to_key: misleading key function description

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll add a link to the glossary entry for key function and to the sorting howto. Also, I'll change value indicating the position to value to be used as the sort key. The form sentence being discussed should probably remain close to how it is currently

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: I will prepare a 3.5 patch for this. There are not many instances other than those you found (but several times as many in tests). I presume that most non-test instances were converted by the 2to3 fixer. How about frozenset([...]) to frozenset({...})?

[issue22826] Support context management protocol in bkfile

2014-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Raymond. I found my old patch written 5 months ago. It drastically simplifies bkfile by using monkey-patching. What approach looks better to you? -- Added file: http://bugs.python.org/file37157/bkfile2.patch

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: I did not look at Docs yet. I could not repeat the timing results on my machine running from the command line, as I got '0.015 usec per loop' for both, and same for both frozenset variations. Running timeit.repeat interactively and selecting the best

[issue22831] Use with to avoid possible fd leaks

2014-11-09 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Here is large patch which convert a code which potentially can leak file descriptor to use the with statement so files are always closed. This can make effect mainly on alternative Python implementation without reference counting. But even on CPython this

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-11-09 Thread Vinay Sajip
Vinay Sajip added the comment: I don't quite understand why you use __PYVENV_LAUNCHER__ When I first developed the venv functionality it was definitely needed, but it looks as if it is not needed now. Perhaps to fix this completely, the following needs to be done, on the assumption that

[issue22434] Use named constants internally in the re module

2014-11-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22434 ___

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Isn't such changes considered code churn? If it is not, I have a huge patch which makes Python sources to use more modern idioms, including replacing set constructors with set literals (I have counted three occurrences not in tests). Are you interesting to

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: [I will prepare a 3.5 patch for this.] Thanks, I will review when you're done. [How about frozenset([...]) to frozenset({...})? ] Yes, the frozenset() examples should change to match the actual repr: frozenset([10, 20, 30]) frozenset({10, 20, 30})

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Isn't such changes considered code churn?] This sort of thing is always a judgment call. The patch will affect very few lines of code, give a little speed-up, and make the code easier to read. In the case of the docs, it is almost always worthwhile to

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: My timing for set((1,2,3)) is .29, faster than for set([1,2,3]) (.42) but still slower than for {1,2,3} (.16). So I will change such instances also. The same timing for frozenset((1,2,3)) (.29) is faster than the best timing for frozenset({1,2,3}), (.36), so

[issue22827] Backport ensurepip to 2.7 (PEP 477)

2014-11-09 Thread Matthias Klose
Matthias Klose added the comment: The mock backport doesn't come with a license. Please either include it in the file, or make it clear that the backport has the same license as python (?). -- nosy: +michael.foord ___ Python tracker

[issue22827] Backport ensurepip to 2.7 (PEP 477)

2014-11-09 Thread Donald Stufft
Donald Stufft added the comment: The backport is taken from Python 3.4 so it's the same license as everything else. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22827 ___

[issue22827] Backport ensurepip to 2.7 (PEP 477)

2014-11-09 Thread Donald Stufft
Donald Stufft added the comment: IOW it's literally Lib/unittest/mock.py from the 3.x series. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22827 ___

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: The same timing for frozenset((1,2,3)) (.29) is faster than the best timing for frozenset({1,2,3}), (.36), I don't see the tuple form used anywhere in the code. The timing is a bit quicker for the tuple form because the peephole optimizer constant folds

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Serhiy, about your 'huge patch' to modernize code: I am more positive than some because: 1) To me, a one-time gentile change is not 'churning'. 2) As we link to many, most, or even all python-coded stdlib modules (I think there is a proposal for 'all'),

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Attaching a patch. Doesn't change tests for the reasons mentioned above. Leaves idle, 2-to-3, and mocking for their respective module maintainers to deal with holistically (as part of their routine maintenance). -- keywords: +patch Added file:

[issue22830] functools.cmp_to_key: misleading key function description

2014-11-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree with your comments and proposed changes and will leave this to you. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22830 ___

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Okay, I missed the frozenset(( examples in my search. There are all in one-time set-up code. Attaching a patch for them as well. -- Added file: http://bugs.python.org/file37160/more_set_literals.patch ___

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You have missed Parser/asdl.py and Tools/clinic/clinic.py. -- Added file: http://bugs.python.org/file37161/set_literal_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22823

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Serhiy, as I said before, please omit idlelib/CodeContext. You both skipped reprlib.py. Should it be changed to produce the standard repr() result? The existing lines: F:\Python\dev\35\lib\reprlib.py: 91: return self._repr_iterable(x, level,

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Hmm, didn't look at those parts of the tree. I'll change the one-line in Parser and leave the little atrocities in clinic.py for Larry to fix :-) Reprlib was skipped intentionally. There is a separate tracker item for it.

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: If there are no objections, I would like to apply my two patches (plus the one-line asdl.py change) and leave the rest to the discretion the module maintainers (mock, code context, clinic, and 2-to-3). -- ___

[issue22791] datetime.utcfromtimestamp() shoud have option for create tz aware datetime

2014-11-09 Thread Akira Li
Akira Li added the comment: I agree the documentation should nudge towards aware datetime objects. I've attached a documentation patch as an example. -- keywords: +patch Added file: http://bugs.python.org/file37162/issue22791-utcfromtimestamp-aware.diff

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4480506137ed by Raymond Hettinger in branch 'default': Issue #22823: Use set literals instead of creating a set from a list https://hg.python.org/cpython/rev/4480506137ed -- nosy: +python-dev ___ Python

[issue22823] Use set literals instead of creating a set from a list

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Larry, would you care to apply or approve Serhiy's updates to clinic.py? -- assignee: rhettinger - larry nosy: +larry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22823

[issue22824] Update reprlib to use set literals

2014-11-09 Thread Berker Peksag
Berker Peksag added the comment: Here's a patch to use set literals and frozenset({'a'}) in reprlib. -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file37163/issue22824.diff ___ Python tracker

[issue22824] Update reprlib to use set literals

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: That looks great. Go ahead an apply (with a MISC/NEWS entry and an update to the example on line 22 of Docs/tutorial/stdlib2.rst). -- assignee: - berker.peksag ___ Python tracker rep...@bugs.python.org

[issue22824] Update reprlib to use set literals

2014-11-09 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the review, Raymond. Patch updated: - Updated the documentation - Added two test cases for set literals - Replaced old run_unittest calls with ``unittest.main()`` -- Added file: http://bugs.python.org/file37164/issue22824_v2.diff

[issue22830] functools.cmp_to_key: misleading key function description

2014-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset dbe1744ec62e by Raymond Hettinger in branch '2.7': Issue 22830: Clarify docs for functools.cmp_to_key(). https://hg.python.org/cpython/rev/dbe1744ec62e -- nosy: +python-dev ___ Python tracker

[issue22830] functools.cmp_to_key: misleading key function description

2014-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 63274cf1b40d by Raymond Hettinger in branch '3.4': Issue 22830: Clarify docs for functools.cmp_to_key(). https://hg.python.org/cpython/rev/63274cf1b40d -- ___ Python tracker rep...@bugs.python.org

[issue20152] Derby #15: Convert 50 sites to Argument Clinic across 9 files

2014-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6e6532d313a1 by Brett Cannon in branch 'default': Issue 20152, 22821: Port the fcntl module to Argument Clinic. https://hg.python.org/cpython/rev/6e6532d313a1 -- ___ Python tracker rep...@bugs.python.org

[issue22821] Argument of wrong type is passed to fcntl()

2014-11-09 Thread Brett Cannon
Brett Cannon added the comment: Fixed in 3.5 as part of 6e6532d313a1 as it was easier to integrate it as part of the Clinic patch. -- stage: patch review - commit review versions: -Python 3.5 ___ Python tracker rep...@bugs.python.org

[issue20152] Derby #15: Convert 50 sites to Argument Clinic across 9 files

2014-11-09 Thread Brett Cannon
Brett Cannon added the comment: Finally finished! I am never trusting Larry to count anything ever again. ;) -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org

[issue22830] functools.cmp_to_key: misleading key function description

2014-11-09 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22830 ___

[issue22832] Tweak parameter names for fcntl module

2014-11-09 Thread Brett Cannon
New submission from Brett Cannon: http://bugs.python.org/review/20152/ is filled with various suggestions from Serhiy on how to update the function parameters in the fcntl module to more closely match what is in the man pages. This should be fully backwards-compatible as the parameters are

[issue22833] The decode_header() function decodes raw part to bytes or str, depending on encoded part

2014-11-09 Thread py.user
New submission from py.user: It depends on encoded part in the header, what email.header.decode_header() returns. If the header has both raw part and encoded part, the function returns (bytes, None) for the raw part. But if the header has only raw part, the function returns (str, None) for

[issue22833] The decode_header() function decodes raw part to bytes or str, depending on encoded part

2014-11-09 Thread py.user
Changes by py.user bugzilla-mail-...@yandex.ru: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22833 ___ ___ Python-bugs-list

[issue22834] Unexpected FileNotFoundError when current directory is removed

2014-11-09 Thread Martin Panter
New submission from Martin Panter: I encountered this when I added a unit test case that invoked os.chdir() with a temporary directory on Linux. After the directory was removed, some of the subsequent test cases failed, although I don’t think they should depend on a particular CWD. I suspect

[issue22835] urllib2/httplib is rendering 400s for every authenticated-SSL request, suddenly

2014-11-09 Thread Dustin Oprea
New submission from Dustin Oprea: I am trying to do an authenticated-SSL request to an Nginx server using *requests*, which wraps urllib2/httplib. It's worked perfectly for months until Friday on my local system (Mac 10.9.5), and there have been no upgrades/patches. My Python 2.7.6 client

[issue22824] Update reprlib to use set literals

2014-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 147fda13bec8 by Raymond Hettinger in branch 'default': Issue #22824: Updated reprlib output format for sets to use set literals. https://hg.python.org/cpython/rev/147fda13bec8 -- nosy: +python-dev ___

[issue22824] Update reprlib to use set literals

2014-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the patch. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22824 ___

  1   2   >