Re: 'Straße' ('Strasse') and Python 2

2014-01-12 Thread Peter Otten
wxjmfa...@gmail.com wrote: sys.version 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] s = 'Straße' assert len(s) == 6 assert s[5] == 'e' jmf Signifying nothing. (Macbeth) Python 2.7.2+ (default, Jul 20 2012, 22:15:08) [GCC 4.6.1] on linux2 Type help, copyright,

Re: 'Straße' ('Strasse') and Python 2

2014-01-12 Thread Stefan Behnel
Peter Otten, 12.01.2014 09:31: wxjmfa...@gmail.com wrote: sys.version 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] s = 'Straße' assert len(s) == 6 assert s[5] == 'e' jmf Signifying nothing. (Macbeth) Python 2.7.2+ (default, Jul 20 2012, 22:15:08) [GCC

The war on Leakey is over.

2014-01-12 Thread Thrinassodon
=== BREAKING NEWS! === IT WAS A DARK AND STORMY NIGHT, RICHARD LEAKEY and Peter Nyikos, Paul Gans, and Desertphile were scoping Thrinaxodon's house for signs of the Devonian human fossils to burn them and save the from being broke by burning the fossils and keeping the

[newbie] starting geany from within idle does not work

2014-01-12 Thread Jean Dupont
I'm using the latest Raspbian on a Raspberry Pi and I'd like to start IDLE so that it uses Geany instead of Leafpad. This seems at first sight a trivial task: Perform a rightmouse click on the IDLE-icon--Open with: Geany (in stead of the default Leafpad)--OK LXTerminal--lxpanelctl restart

Re: 'Straße' ('Strasse') and Python 2

2014-01-12 Thread Ned Batchelder
On 1/12/14 2:50 AM, wxjmfa...@gmail.com wrote: sys.version 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] s = 'Straße' assert len(s) == 6 assert s[5] == 'e' jmf Dumping random snippets of Python sessions here is useless. If you are trying to make a point, you have

Python: 404 Error when trying to login a webpage by using 'urllib' and 'HTTPCookieProcessor'

2014-01-12 Thread KMeans Algorithm
I'm trying to log in a webpage by using 'urllib' and this piece of code - import urllib2,urllib,os opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) login = urllib.urlencode({'username':'john', 'password':'foo'}) url = https://www.mysite.com/loginpage; req =

Re: 'Straße' ('Strasse') and Python 2

2014-01-12 Thread Mark Lawrence
On 12/01/2014 09:00, Stefan Behnel wrote: Peter Otten, 12.01.2014 09:31: wxjmfa...@gmail.com wrote: sys.version 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] s = 'Straße' assert len(s) == 6 assert s[5] == 'e' jmf Signifying nothing. (Macbeth) Python 2.7.2+

[ANN] Oktest.py 0.12.0 released - a new-style testing library

2014-01-12 Thread Makoto Kuwata
Hi, I released Oktest 0.12.0. https://pypi.python.org/pypi/Oktest/ Oktest is a new-style testing library for Python. ## unittest self.assertEqual(x, y) self.assertNotEqual(x, y) self.assertGreaterEqual(x, y) self.assertIsInstance(obj, cls) self.assertRegexpMatches(text,

Re: Python: 404 Error when trying to login a webpage by using 'urllib' and 'HTTPCookieProcessor'

2014-01-12 Thread Chris Angelico
On Sun, Jan 12, 2014 at 11:17 PM, KMeans Algorithm bilb...@gmail.com wrote: What am I doing wrong? Thank you very much. I can't say what's actually wrong, but I have a few ideas for getting more information out of the system... opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) You

Re: Python: 404 Error when trying to login a webpage by using 'urllib' and 'HTTPCookieProcessor'

2014-01-12 Thread Chris Angelico
On Sun, Jan 12, 2014 at 11:17 PM, KMeans Algorithm bilb...@gmail.com wrote: The page https://www.mysite.com/loginpage; does exist PS. If it's not an intranet site and the URL isn't secret, it'd help if we could actually try things out. One of the tricks I like to use is to access the same page

Re: [ANN] Oktest.py 0.12.0 released - a new-style testing library

2014-01-12 Thread Roy Smith
In article mailman.5364.1389530289.18130.python-l...@python.org, Makoto Kuwata k...@kuwata-lab.com wrote: Hi, I released Oktest 0.12.0. https://pypi.python.org/pypi/Oktest/ Wow, this looks neat. We use nose, but I'm thinking your ok() style exceptions should work just fine with nose.

Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined?

2014-01-12 Thread Rotwang
On 12/01/2014 05:58, Chris Angelico wrote: [...] (BTW, is there no better notation than six nested for/range for doing 6d6? I couldn't think of one off-hand, but it didn't really much matter anyway.) If you're willing to do an import, then how about this: from itertools import product

Python example source code

2014-01-12 Thread ngangsia akumbo
where can i find example source code by topic? Any help please -- https://mail.python.org/mailman/listinfo/python-list

Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined?

2014-01-12 Thread Chris Angelico
On Mon, Jan 13, 2014 at 1:36 AM, Rotwang sg...@hotmail.co.uk wrote: On 12/01/2014 05:58, Chris Angelico wrote: (BTW, is there no better notation than six nested for/range for doing 6d6? I couldn't think of one off-hand, but it didn't really much matter anyway.) If you're willing to do an

Re: Python example source code

2014-01-12 Thread bob gailer
On 1/12/2014 9:37 AM, ngangsia akumbo wrote: where can i find example source code by topic? There are several Python tutorials on the internet. They have good code examples. Most modules also have module-specific examples. There are also some web sites that may address your needs. I will

Re:Python example source code

2014-01-12 Thread Dave Angel
ngangsia akumbo ngang...@gmail.com Wrote in message: where can i find example source code by topic? Any help please http://code.activestate.com/recipes/langs/python/ http://code.activestate.com/recipes/sets/2-python-cookbook-edition-2/

Dawkins arrested

2014-01-12 Thread Thrinassodon
BREAKING NEWS! THRINAXODON SPEARHEADED THE ASSAULT ON RICHARD DAWKINS, KNOWN FOR SUPPRESSION OF VALID RESEARCH OF HUMAN ORIGINS FOR YEARS, JUST TO GET A BUCK OUT OF BRAINWASHING CHILDREN'S LIVES INTO THE SCAM OF EVOLUTION. Dawkins was charged with OVER 9000!

extracting string.Template substitution placeholders

2014-01-12 Thread Eric S. Johansson
As part of speech recognition accessibility tools that I'm building, I'm using string.Template. In order to construct on-the-fly grammar, I need to know all of the identifiers before the template is filled in. what is the best way to do this? can string.Template handle recursive expansion

Re: Python example source code

2014-01-12 Thread ngangsia akumbo
On Sunday, January 12, 2014 4:06:13 PM UTC+1, Dave Angel wrote: ngangsia akumbo ngang...@gmail.com Wrote in message: Thanks bro -- https://mail.python.org/mailman/listinfo/python-list

Re: Python: 404 Error when trying to login a webpage by using 'urllib' and 'HTTPCookieProcessor'

2014-01-12 Thread xDog Walker
On Sunday 2014 January 12 04:42, Chris Angelico wrote: As a last resort, try firing up Wireshark or something and watch exactly what gets sent and received. I went looking through the docs for a verbose mode or a debug setting but can't find one - that'd be ideal if it exists, though. I think

Problem writing some strings (UnicodeEncodeError)

2014-01-12 Thread Paulo da Silva
Hi! I am using a python3 script to produce a bash script from lots of filenames got using os.walk. I have a template string for each bash command in which I replace a special string with the filename and then write the command to the bash script file. Something like this:

Re: Problem writing some strings (UnicodeEncodeError)

2014-01-12 Thread Albert-Jan Roskam
On Sun, 1/12/14, Paulo da Silva p_s_d_a_s_i_l_...@netcabo.pt wrote: Subject: Problem writing some strings (UnicodeEncodeError) To: python-list@python.org Date: Sunday, January 12, 2014, 4:36 PM Hi! I am using a python3 script to produce a bash

Re: Problem writing some strings (UnicodeEncodeError)

2014-01-12 Thread Peter Otten
Paulo da Silva wrote: I am using a python3 script to produce a bash script from lots of filenames got using os.walk. I have a template string for each bash command in which I replace a special string with the filename and then write the command to the bash script file. Something like

Re: Python example source code

2014-01-12 Thread Joel Goldstick
On Sun, Jan 12, 2014 at 10:13 AM, ngangsia akumbo ngang...@gmail.com wrote: On Sunday, January 12, 2014 4:06:13 PM UTC+1, Dave Angel wrote: ngangsia akumbo ngang...@gmail.com Wrote in message: Thanks bro -- https://mail.python.org/mailman/listinfo/python-list Don't forget Python

Re: python first project

2014-01-12 Thread Emile van Sebille
On 01/11/2014 09:14 PM, ngangsia akumbo wrote: From all indication it is a very huge project. Yep -- I built such a system in the late 70's with a team of seven over two-three years. Then modifications and improvements continued over the next 20 years keeping about 2-4 programmers busy

Re: python first project

2014-01-12 Thread ngangsia akumbo
On Sunday, January 12, 2014 5:37:41 PM UTC+1, Emile van Sebille wrote: On 01/11/2014 09:14 PM, ngangsia akumbo wrote: For an example of a commercially available entry level alternative costs check out: That said, it wouldn't surprise me that the CEO hasn't already looked into

Re: Python example source code

2014-01-12 Thread Emile van Sebille
On 01/12/2014 06:37 AM, ngangsia akumbo wrote: where can i find example source code by topic? I'd recommend http://effbot.org/librarybook/ even though it's v2 specific and somewhat dated. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem writing some strings (UnicodeEncodeError)

2014-01-12 Thread Emile van Sebille
On 01/12/2014 07:36 AM, Paulo da Silva wrote: Hi! I am using a python3 script to produce a bash script from lots of filenames got using os.walk. I have a template string for each bash command in which I replace a special string with the filename and then write the command to the bash script

Re: parametized unittest

2014-01-12 Thread CraftyTech
On Saturday, January 11, 2014 11:34:30 PM UTC-5, Roy Smith wrote: In article mailman.5355.1389500996.18130.python-l...@python.org, W. Trevor King wk...@tremily.us wrote: On Sat, Jan 11, 2014 at 08:00:05PM -0800, CraftyTech wrote: I'm finding it hard to use unittest in a for loop.

Re: Python example source code

2014-01-12 Thread ngangsia akumbo
On Sunday, January 12, 2014 5:38:03 PM UTC+1, Joel Goldstick wrote: On Sun, Jan 12, 2014 at 10:13 AM, ngangsia akumbo ngang...@gmail.com wrote: Don't forget Python Module of the Week pymotw.com/ Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: Python example source code

2014-01-12 Thread ngangsia akumbo
On Sunday, January 12, 2014 5:52:19 PM UTC+1, Emile van Sebille wrote: On 01/12/2014 06:37 AM, ngangsia akumbo wrote: I'd recommend http://effbot.org/librarybook/ even though it's v2 specific and somewhat dated. Thank very much , it is very nice --

Data peeping function?

2014-01-12 Thread Thor Whalen
The first thing I do once I import new data (as a pandas dataframe) is to .head() it, .describe() it, and then kick around a few specific stats according to what I see. But I'm not satisfied with .describe(). Amongst others, non-numerical columns are ignored, and off-the-shelf stats will be

Re: Python example source code

2014-01-12 Thread memilanuk
On 01/12/2014 06:37 AM, ngangsia akumbo wrote: where can i find example source code by topic? Any help please nullege.com is usually helpful... -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem writing some strings (UnicodeEncodeError)

2014-01-12 Thread Paulo da Silva
Em 12-01-2014 16:23, Peter Otten escreveu: Paulo da Silva wrote: I am using a python3 script to produce a bash script from lots of filenames got using os.walk. I have a template string for each bash command in which I replace a special string with the filename and then write the command to

Re: 'Straße' ('Strasse') and Python 2

2014-01-12 Thread MRAB
On 2014-01-12 08:31, Peter Otten wrote: wxjmfa...@gmail.com wrote: sys.version 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] s = 'Straße' assert len(s) == 6 assert s[5] == 'e' jmf Signifying nothing. (Macbeth) Python 2.7.2+ (default, Jul 20 2012, 22:15:08) [GCC

Re: python first project

2014-01-12 Thread MRAB
On 2014-01-12 06:04, Chris Angelico wrote: On Sun, Jan 12, 2014 at 4:14 PM, ngangsia akumbo ngang...@gmail.com wrote: What options do you think i can give the Ceo. Because from what you have outline, i think i will like to follow your advice. If it is just some recording data stuff then some

Re: Problem writing some strings (UnicodeEncodeError)

2014-01-12 Thread Peter Otten
Paulo da Silva wrote: Em 12-01-2014 16:23, Peter Otten escreveu: Paulo da Silva wrote: I am using a python3 script to produce a bash script from lots of filenames got using os.walk. I have a template string for each bash command in which I replace a special string with the filename and

Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined?

2014-01-12 Thread Grant Edwards
On 2014-01-11, pintreo mardi bigearl...@outlook.com wrote: Hi, I've just begun to learn programming, I have an open question for the group: Is the Python language an all in one computer language which could replace C, C++, Java etc.. No. Python can not replace C in a number of application

efficient way to process data

2014-01-12 Thread Larry Martell
I have an python app that queries a MySQL DB. The query has this form: SELECT a, b, c, d, AVG(e), STD(e), CONCAT(x, ',', y) as f FROM t GROUP BY a, b, c, d, f x and y are numbers (378.18, 2213.797 or 378.218, 2213.949 or 10053.490, 2542.094). The business issue is that if either x or y in 2

python query on firebug extention

2014-01-12 Thread JAI PRAKASH SINGH
hello i am working on selenium module of python, i know how to make extension of firebug with selenium, but i want to know how to use firebug extension with request module / mechanize . i search a lot but unable to find it , please help . i want technique similar like :- from

Re: Problem writing some strings (UnicodeEncodeError)

2014-01-12 Thread Paulo da Silva
I think instead of the hard way sketched out above it will be sufficient to specify the error handler when opening the destination file shf = open(bashfilename, 'w', errors=surrogateescape) This seems to fix everything! I tried with a small test set and it worked. but I have not tried

Re: efficient way to process data

2014-01-12 Thread Petite Abeille
On Jan 12, 2014, at 8:23 PM, Larry Martell larry.mart...@gmail.com wrote: AFAIK, there is no way to do this in SQL. Sounds like a job for window functions (aka analytic functions) [1][2]. [1] http://www.postgresql.org/docs/9.3/static/tutorial-window.html [2]

Re: Problem writing some strings (UnicodeEncodeError)

2014-01-12 Thread Peter Otten
Paulo da Silva wrote: but I have not tried it myself. Also, some bytes may need to be escaped, either to be understood by the shell, or to address security concerns: Since I am puting the file names between , the only char that needs to be escaped is the itself. What about the escape

Re: Python: 404 Error when trying to login a webpage by using 'urllib' and 'HTTPCookieProcessor'

2014-01-12 Thread Terry Reedy
On 1/12/2014 7:17 AM, KMeans Algorithm wrote: But I get a 404 error (Not Found). The page https://www.mysite.com/loginpage; does exist Firefox tells me the same thing. If that is a phony address, you should have said so. -- Terry Jan Reedy --

Re: efficient way to process data

2014-01-12 Thread Chris Angelico
On Mon, Jan 13, 2014 at 6:53 AM, Petite Abeille petite.abei...@gmail.com wrote: On Jan 12, 2014, at 8:23 PM, Larry Martell larry.mart...@gmail.com wrote: AFAIK, there is no way to do this in SQL. Sounds like a job for window functions (aka analytic functions) [1][2]. That's my thought too. I

Re: Python example source code

2014-01-12 Thread Denis McMahon
On Sun, 12 Jan 2014 06:37:18 -0800, ngangsia akumbo wrote: where can i find example source code by topic? Any help please You don't want to be looking at source code yet, you want to be talking to the users of the system you're trying to design to find out what their requirements are. --

Re: efficient way to process data

2014-01-12 Thread Chris Angelico
On Mon, Jan 13, 2014 at 6:23 AM, Larry Martell larry.mart...@gmail.com wrote: I have an python app that queries a MySQL DB. The query has this form: SELECT a, b, c, d, AVG(e), STD(e), CONCAT(x, ',', y) as f FROM t GROUP BY a, b, c, d, f x and y are numbers (378.18, 2213.797 or 378.218,

Re: Problem writing some strings (UnicodeEncodeError)

2014-01-12 Thread Paulo da Silva
Em 12-01-2014 20:29, Peter Otten escreveu: Paulo da Silva wrote: but I have not tried it myself. Also, some bytes may need to be escaped, either to be understood by the shell, or to address security concerns: Since I am puting the file names between , the only char that needs to be

Re: efficient way to process data

2014-01-12 Thread Larry Martell
On Sun, Jan 12, 2014 at 2:53 PM, Petite Abeille petite.abei...@gmail.com wrote: On Jan 12, 2014, at 8:23 PM, Larry Martell larry.mart...@gmail.com wrote: AFAIK, there is no way to do this in SQL. Sounds like a job for window functions (aka analytic functions) [1][2]. [1]

Re: efficient way to process data

2014-01-12 Thread Larry Martell
On Sun, Jan 12, 2014 at 5:18 PM, Chris Angelico ros...@gmail.com wrote: On Mon, Jan 13, 2014 at 6:53 AM, Petite Abeille petite.abei...@gmail.com wrote: On Jan 12, 2014, at 8:23 PM, Larry Martell larry.mart...@gmail.com wrote: AFAIK, there is no way to do this in SQL. Sounds like a job for

Re: efficient way to process data

2014-01-12 Thread Larry Martell
On Sun, Jan 12, 2014 at 5:43 PM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Sun, 12 Jan 2014 14:23:17 -0500, Larry Martell larry.mart...@gmail.com declaimed the following: I have an python app that queries a MySQL DB. The query has this form: SELECT a, b, c, d, AVG(e), STD(e), CONCAT(x,

Re: efficient way to process data

2014-01-12 Thread Larry Martell
On Sun, Jan 12, 2014 at 6:27 PM, Chris Angelico ros...@gmail.com wrote: On Mon, Jan 13, 2014 at 6:23 AM, Larry Martell larry.mart...@gmail.com wrote: I have an python app that queries a MySQL DB. The query has this form: SELECT a, b, c, d, AVG(e), STD(e), CONCAT(x, ',', y) as f FROM t

Re: efficient way to process data

2014-01-12 Thread Chris Angelico
On Mon, Jan 13, 2014 at 2:35 PM, Larry Martell larry.mart...@gmail.com wrote: Thanks for the reply. I'm going to take a stab at removing the group by and doing it all in python. It doesn't look too hard, but I don't know how it will perform. Well, if you can't switch to PostgreSQL or such,

Re: extracting string.Template substitution placeholders

2014-01-12 Thread Steven D'Aprano
On Sun, 12 Jan 2014 10:08:31 -0500, Eric S. Johansson wrote: As part of speech recognition accessibility tools that I'm building, I'm using string.Template. In order to construct on-the-fly grammar, I need to know all of the identifiers before the template is filled in. what is the best way

[issue20158] Argument Clinic: add --clean option

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: Another use case here is if you want to check the remaining call sites of (say) PyArg_ParseTuple that aren't generated by clinic. Call it '--remove' if you want, but the functionality should be useful. -- nosy: +georg.brandl

[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: OK, here's a patch for _csv. Two problems here: First problem is the __new__ method of the Dialect class: * it has no docstring and no methoddef entry * it is a class method, but the first arg is conventionally called type I tried to hack something into clinic

[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: Tried to tackle symtable -- it uses an O converter. The clinic howto says ``'O'````object(converter='name_of_c_function')`` but Traceback (most recent call last): File Tools/clinic/clinic.py, line 2817, in module sys.exit(main(sys.argv[1:])) File

[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: _tracemalloc converted. Its existing docstrings did use the func(arg: argtype) - rettype convention. Is there a way in clinic to retain that? -- Added file: http://bugs.python.org/file33423/tracemalloc_clinic.patch

[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: Here's _iomodule. _io.open has a whopping 100-line docstring, which is ... unfortunate ... to have duplicated in the file :) -- Added file: http://bugs.python.org/file33424/io_clinic.patch ___ Python tracker

[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: And _heapq. No problems there, except that it also used - return annotations in the docstring. -- Added file: http://bugs.python.org/file33425/heapq_clinic.patch ___ Python tracker rep...@bugs.python.org

[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: And lsprof. -- Added file: http://bugs.python.org/file33426/lsprof_clinic.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20186 ___

[issue20115] NUL bytes in commented lines

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: I'm in favor of PyPy's behavior: null bytes anywhere in the source, even in comments, usually mean there's something weird or fishy going on with either the editor or (if downloaded/copied) the source of the code. -- nosy: +georg.brandl

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___

[issue19995] %c, %o, %x, %X accept non-integer values instead of raising an exception

2014-01-12 Thread STINNER Victor
STINNER Victor added the comment: Typo in the C code: depracation :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___

[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: Here's the signalmodule. -- keywords: +patch nosy: +georg.brandl Added file: http://bugs.python.org/file33427/signal_clinic.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20182

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 29732b43ccf2 by Serhiy Storchaka in branch '3.3': Issue #20138: The wsgiref.application_uri() and wsgiref.request_uri() http://hg.python.org/cpython/rev/29732b43ccf2 New changeset 73781fe1daa2 by Serhiy Storchaka in branch 'default': Issue #20138:

[issue20225] Argument Clinic: simplify METH_NOARGS generated code

2014-01-12 Thread Georg Brandl
New submission from Georg Brandl: For METH_NOARGS, you can get rid of the separate _impl function. This makes the generated code much smaller. -- messages: 207943 nosy: georg.brandl priority: normal severity: normal status: open title: Argument Clinic: simplify METH_NOARGS generated

[issue20225] Argument Clinic: simplify METH_NOARGS generated code

2014-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Seconded. But only if there are no self or result converters. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20225 ___

[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: Now without crap. -- Added file: http://bugs.python.org/file33428/signal_clinic.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20182 ___

[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2014-01-12 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: Removed file: http://bugs.python.org/file33427/signal_clinic.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20182 ___

[issue20226] Argument Clinic: support for simple expressions?

2014-01-12 Thread Georg Brandl
New submission from Georg Brandl: Take for example select.epoll.__new__(): static PyObject * pyepoll_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { int flags = 0, sizehint = FD_SETSIZE - 1; static char *kwlist[] = {sizehint, flags, NULL}; if

[issue20225] Argument Clinic: simplify METH_NOARGS generated code

2014-01-12 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- assignee: - larry nosy: +larry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20225 ___ ___

[issue20226] Argument Clinic: support for simple expressions?

2014-01-12 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- assignee: - larry nosy: +larry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20226 ___ ___

[issue20226] Argument Clinic: support for simple expressions?

2014-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also a discussion in issue20193. zlib needs this in many functions. -- nosy: +serhiy.storchaka versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20226

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-12 Thread Georg Brandl
New submission from Georg Brandl: This is a request to be able to name C arguments differently from Python arguments. Two reasons: * like for function renaming, some Python argument names are reserved in C (default for example, used in sys.getsizeof()) * sometimes the function uses 'O' in

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-12 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227 ___ ___ Python-bugs-list

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: OK, I see that AC automatically handles case 1, great! Still you have to decide if you like the code churn caused by case 2. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: One more: I can't have an argument called args. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227 ___ ___

[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: Here's sys. For it to generate the correct code you need to add args to c_keywords in clinic.py. -- Added file: http://bugs.python.org/file33429/sys_clinic.patch ___ Python tracker rep...@bugs.python.org

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-12 Thread Ram Rachum
Ram Rachum added the comment: (Replace `is` with `if` in my code sample, typo.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20218 ___ ___

[issue20158] Argument Clinic: add --clean option

2014-01-12 Thread Larry Hastings
Larry Hastings added the comment: You can accomplish that workflow by using the Clinic buffer prototype and moving all your output to the side. Or by using the buffer approach, and stopping when you hit the generated code. One of these might actually happen in Clinic, too, so hang on to

[issue20225] Argument Clinic: simplify METH_NOARGS generated code

2014-01-12 Thread Larry Hastings
Larry Hastings added the comment: (Actually a self converter would be fine too. Those are only allowed to cast.) I'm not doing this; here's why. I want the call signature to the impl function to be the *idealized* signature of that function. And METH_NOARGS passes in a dumb stupid second

[issue20225] Argument Clinic: simplify METH_NOARGS generated code

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: Sure, I wasn't concerned with compilation, only saving lines of code. But I agree that the buffer way sounds much more promising. Just seemed odd that METH_O was clean and METH_NOARGS less so :) -- ___ Python tracker

[issue20226] Argument Clinic: support for simple expressions?

2014-01-12 Thread Larry Hastings
Larry Hastings added the comment: Yes, this is supported, just undocumented (for now). The magic you want is, for example in Modules/_sre.c: endpos: Py_ssize_t(c_default=PY_SSIZE_T_MAX) = sys.maxsize -- ___ Python tracker rep...@bugs.python.org

[issue20226] Argument Clinic: support for simple expressions?

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: Nice, thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20226 ___ ___ Python-bugs-list mailing list

[issue18394] cgi.FieldStorage triggers ResourceWarning sometimes

2014-01-12 Thread Marcel Hellkamp
Marcel Hellkamp added the comment: This change breaks existing applications. The cgi.FieldStorage.file attribute is public and mentioned in the documentation. It even states You can then read the data at leisure from the file attribute. Consider this example:: form = cgi.FieldStorage()

[issue19092] ExitStack.__exit__ incorrectly suppresses exceptions in __exit__ callbacks of inner context managers

2014-01-12 Thread Senthil Kumaran
Senthil Kumaran added the comment: The last tracker message msg207926 is applicable to issue #19097 and not here. Sorry for the confusion. -- nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19092

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2014-01-12 Thread Senthil Kumaran
Senthil Kumaran added the comment: Fixed in: New changeset a3e49868cfd0 by Senthil Kumaran in branch '3.3': Issue #19092 - Raise a correct exception when cgi.FieldStorage is given an http://hg.python.org/cpython/rev/a3e49868cfd0 New changeset 1638360eea41 by Senthil Kumaran in branch

[issue20214] Argument Clinic rollup fixes

2014-01-12 Thread Larry Hastings
Larry Hastings added the comment: Freshened patch, -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20214 ___ ___

[issue20201] Argument Clinic: rwbuffer support broken

2014-01-12 Thread Larry Hastings
Larry Hastings added the comment: Do you have commit rights? I can commit this patch for you if you don't. Just wondering what (if anything) is holding this up. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20201

[issue20196] Argument Clinic generates invalid code for optional parameter

2014-01-12 Thread Larry Hastings
Larry Hastings added the comment: Georg, you mind reviewing this too? Six line patch. Just trying to clean my plate a little before I fix a bug for you :D -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org

[issue20201] Argument Clinic: rwbuffer support broken

2014-01-12 Thread Larry Hastings
Larry Hastings added the comment: Looks like you don't, so I'll commit this on your behalf. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20201 ___

[issue20214] Argument Clinic rollup fixes

2014-01-12 Thread Larry Hastings
Larry Hastings added the comment: Also adding the one-byte fix from #20201 to the rollup patch here. (Not bothering to upload a fresh patch because it is literally one byte, fixing a misspelled variable name.) -- ___ Python tracker

[issue19995] %c, %o, %x, %X accept non-integer values instead of raising an exception

2014-01-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset cc8b21988efb by Ethan Furman in branch 'default': Issue19995: fixed typo; switched from test.support.check_warnings to assertWarns http://hg.python.org/cpython/rev/cc8b21988efb -- ___ Python tracker

[issue20214] Argument Clinic rollup fixes

2014-01-12 Thread Larry Hastings
Larry Hastings added the comment: I goofed, I do have some additional fixes. Here's everything. Changes since patch #1: * Added 'converter' argument to 'object' converter. * Fixed misspelled variable name (see #20201). * Several documentation updates. -- Added file:

[issue20196] Argument Clinic generates invalid code for optional parameter

2014-01-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 250b481a0d28 by Larry Hastings in branch 'default': Issue #20196: Fixed a bug where Argument Clinic did not generate correct http://hg.python.org/cpython/rev/250b481a0d28 -- nosy: +python-dev ___ Python

[issue20196] Argument Clinic generates invalid code for optional parameter

2014-01-12 Thread Larry Hastings
Larry Hastings added the comment: Easy fix. Thanks for the report! -- resolution: - fixed stage: patch review - commit review status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20196

[issue18394] cgi.FieldStorage triggers ResourceWarning sometimes

2014-01-12 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- assignee: - brett.cannon keywords: +3.3regression -patch nosy: +larry priority: normal - release blocker status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18394

[issue17373] Add inspect.Signature.from_callable()

2014-01-12 Thread Eric Snow
Eric Snow added the comment: The difference is that inspect.signature is not friendly to Signature subclasses. Without from_callable you can't customize the behavior in inspect.signature easily. -- ___ Python tracker rep...@bugs.python.org

[issue17373] Add inspect.Signature.from_callable()

2014-01-12 Thread Yury Selivanov
Yury Selivanov added the comment: The difference is that inspect.signature is not friendly to Signature subclasses. Without from_callable you can't customize the behavior in inspect.signature easily. OK, suppose you have Signature.from_callable. You then create a subclass MySignature, and

  1   2   >