How to Manage Your Python Open Source - free webinar

2014-07-07 Thread rafi . michaeli
Hey everyone, We are conducting a webinar this Wednesday about How to Manage Your Python Open Source. the session will be mainly about challenge of managing open-source components that are embedded in your Python projects. If you are interested please register in this form:

pbr 0.9.0 released

2014-07-07 Thread Doug Hellmann
The Oslo team is pleased to announce the release of pbr 0.9.0. pbr (Python Build Reasonableness) is a wrapper for setuptools to make packaging python libraries and applications easier. For more details, see https://pypi.python.org/pypi/pbr and http://docs.openstack.org/developer/pbr/ This

ANN: python-blosc 1.2.7 released

2014-07-07 Thread Francesc Alted
= Announcing python-blosc 1.2.4 = What is new? This is a maintenance release, where included c-blosc sources have been updated to 1.4.0. This adds support for non-Intel architectures, most specially those not supporting

[CORRECTION] python-blosc 1.2.4 released (Was: ANN: python-blosc 1.2.7 released)

2014-07-07 Thread Francesc Alted
Indeed it was 1.2.4 the version just released and not 1.2.7. Sorry for the typo! Francesc On 7/7/14, 8:20 PM, Francesc Alted wrote: = Announcing python-blosc 1.2.4 = What is new? This is a maintenance release, where

finditer

2014-07-07 Thread gintare
If smbd has time, maybe you could advice how to accomplish this task in faster way. I have a text = word{vb} wordtransl {vb} sent1. sent1trans. sent2 sent2trans... I need to match once wordtransl, and than many times repeating patterns consisting of sent and senttrans. The way i

Module name does not match file name

2014-07-07 Thread Steven D'Aprano
Cut a long story short... I'm trying to debug a Tkinter app written in Python. The author of this app designed it as a maze of twisty dependencies, all alike, and his idea of source control was to make multiple copies of every file and drop them in random places on the hard drive. He also has

Re: Module name does not match file name

2014-07-07 Thread Chris Angelico
On Mon, Jul 7, 2014 at 5:57 PM, Steven D'Aprano st...@pearwood.info wrote: Can anyone explain how import pg can end up coming from pgmodule.so? First guess: There's a pg.py somewhere that imports the so, then replaces itself in sys.modules. # importme.py import sys sys.modules[importme]=sys

Re: open() and EOFError

2014-07-07 Thread Steven D'Aprano
On Mon, 07 Jul 2014 17:04:12 +1200, Gregory Ewing wrote: Steven D'Aprano wrote: Are there any circumstances where merely *opening* a file (before reading it) can raise EOFError? I don't think so. As far as I know, the only built-in thing that raises EOFError is input() (and raw_input() in

Re: open() and EOFError

2014-07-07 Thread Chris Angelico
On Mon, Jul 7, 2014 at 6:00 PM, Steven D'Aprano st...@pearwood.info wrote: How do people feel about code like this? try: name = input(Enter file name, or Ctrl-D to exit) # On Windows, use Ctrl-Z [enter] instead. fp = open(name) except EOFError: sys.exit() except IOError:

Re: Module name does not match file name

2014-07-07 Thread Steven D'Aprano
Ah, I think I have a partial answer... but not a complete answer. On Mon, 07 Jul 2014 07:57:21 +, Steven D'Aprano wrote: Can anyone explain how import pg can end up coming from pgmodule.so? Sure enough: import pg pg.__file__ '/usr/local/lib/python2.6/dist-packages/pgmodule.so'

Re: Module name does not match file name

2014-07-07 Thread Chris Angelico
On Mon, Jul 7, 2014 at 6:57 PM, Steven D'Aprano st...@pearwood.info wrote: which suggests that the pgmodule.so file creates a module called pg. What I don't understand is how import pg gets turned into run pgmodule.so? What happens if you *don't* import pg? Is there a sys.modules[pg] already?

Re: Module name does not match file name

2014-07-07 Thread Steven D'Aprano
On Mon, 07 Jul 2014 18:04:36 +1000, Chris Angelico wrote: On Mon, Jul 7, 2014 at 5:57 PM, Steven D'Aprano st...@pearwood.info wrote: Can anyone explain how import pg can end up coming from pgmodule.so? First guess: There's a pg.py somewhere that imports the so, then replaces itself in

Re: Module name does not match file name

2014-07-07 Thread Chris Angelico
On Mon, Jul 7, 2014 at 7:03 PM, Steven D'Aprano st...@pearwood.info wrote: On Mon, 07 Jul 2014 18:04:36 +1000, Chris Angelico wrote: On Mon, Jul 7, 2014 at 5:57 PM, Steven D'Aprano st...@pearwood.info wrote: Can anyone explain how import pg can end up coming from pgmodule.so? First guess:

Re: Module name does not match file name

2014-07-07 Thread Steven D'Aprano
On Mon, 07 Jul 2014 19:03:33 +1000, Chris Angelico wrote: On Mon, Jul 7, 2014 at 6:57 PM, Steven D'Aprano st...@pearwood.info wrote: which suggests that the pgmodule.so file creates a module called pg. What I don't understand is how import pg gets turned into run pgmodule.so? What happens

Re: Saving

2014-07-07 Thread Denis McMahon
On Sun, 06 Jul 2014 23:03:07 +, mrwhackadoo1 wrote: Hi, I’ve been looking forever for this and I cant get it. I need to know how to save my code and save as programs because I write code and I run it but then I cant save it for later. Please help and thank you for your time. Write

Emperor's New Coroutines?

2014-07-07 Thread Marko Rauhamaa
The asyncio module comes with coroutine support. Investigating the topic on the net reveals that FSM's are for old people and the brave new world uses coroutines. Unfortunately, all examples I could find seem to be overly simplistic, and I'm left thinking coroutines have few practical uses in

Re: Module name does not match file name

2014-07-07 Thread Peter Otten
Steven D'Aprano wrote: Ah, I think I have a partial answer... but not a complete answer. On Mon, 07 Jul 2014 07:57:21 +, Steven D'Aprano wrote: Can anyone explain how import pg can end up coming from pgmodule.so? Sure enough: import pg pg.__file__

Re: Module name does not match file name

2014-07-07 Thread Robert Kern
On 2014-07-07 09:57, Steven D'Aprano wrote: Ah, I think I have a partial answer... but not a complete answer. On Mon, 07 Jul 2014 07:57:21 +, Steven D'Aprano wrote: Can anyone explain how import pg can end up coming from pgmodule.so? Sure enough: import pg pg.__file__

Re: How do you use `help` when write your code

2014-07-07 Thread Roy Smith
In article mailman.11570.1404702375.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: That's about it, yeah. I tend to find both strace and tcpdump rather too spammy for most usage, so any time I reach for those tools, it's usually with some tight filtering - and even

Re: How do you use `help` when write your code

2014-07-07 Thread Chris Angelico
On Mon, Jul 7, 2014 at 9:22 PM, Roy Smith r...@panix.com wrote: In article mailman.11570.1404702375.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: That's about it, yeah. I tend to find both strace and tcpdump rather too spammy for most usage, so any time I reach for

Re: Module name does not match file name

2014-07-07 Thread Steven D'Aprano
On Mon, 07 Jul 2014 12:15:51 +0100, Robert Kern wrote: On 2014-07-07 09:57, Steven D'Aprano wrote: What I don't understand is how import pg gets turned into run pgmodule.so? This has been standard Python behavior for extension modules since forever. It's a very old practice and not

Re: Module name does not match file name

2014-07-07 Thread Chris Angelico
On Mon, Jul 7, 2014 at 9:56 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Hmmm. Well, that is very special. Is this documented anywhere? Special, in the sense of Shepherd Book addressing Mal. Isn't that... special. ChrisA --

Re: open() and EOFError

2014-07-07 Thread Dave Angel
Steven D'Aprano st...@pearwood.info Wrote in message: On Mon, 07 Jul 2014 17:04:12 +1200, Gregory Ewing wrote: Steven D'Aprano wrote: Are there any circumstances where merely *opening* a file (before reading it) can raise EOFError? I don't think so. As far as I know, the only built-in

Re: open() and EOFError

2014-07-07 Thread Chris Angelico
On Mon, Jul 7, 2014 at 6:00 PM, Steven D'Aprano st...@pearwood.info wrote: How do people feel about code like this? try: name = input(Enter file name, or Ctrl-D to exit) # On Windows, use Ctrl-Z [enter] instead. fp = open(name) except EOFError: sys.exit() except IOError:

Re: open() and EOFError

2014-07-07 Thread Roy Smith
In article 53ba538d$0$2926$c3e8da3$76491...@news.astraweb.com, Steven D'Aprano st...@pearwood.info wrote: On Mon, 07 Jul 2014 17:04:12 +1200, Gregory Ewing wrote: Steven D'Aprano wrote: Are there any circumstances where merely *opening* a file (before reading it) can raise EOFError?

Re: open() and EOFError

2014-07-07 Thread Roy Smith
In article mailman.11587.1404735570.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Mon, Jul 7, 2014 at 6:00 PM, Steven D'Aprano st...@pearwood.info wrote: How do people feel about code like this? try: name = input(Enter file name, or Ctrl-D to exit) #

Re: open() and EOFError

2014-07-07 Thread Chris Angelico
On Mon, Jul 7, 2014 at 10:39 PM, Roy Smith r...@panix.com wrote: $ stty -e speed 9600 baud; 24 rows; 80 columns; lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo -extproc iflags: -istrip icrnl -inlcr

Re: open() and EOFError

2014-07-07 Thread Chris Angelico
On Mon, Jul 7, 2014 at 10:46 PM, Roy Smith r...@panix.com wrote: We've since modified our cleanup script to run lsof and skip purging any releases which are still in use :-) LOL! I have a computer on which I periodically build and install new versions of a few pieces of software. Most of them

Re: open() and EOFError

2014-07-07 Thread Mark Lawrence
On 07/07/2014 09:09, Chris Angelico wrote: On Mon, Jul 7, 2014 at 6:00 PM, Steven D'Aprano st...@pearwood.info wrote: How do people feel about code like this? try: name = input(Enter file name, or Ctrl-D to exit) # On Windows, use Ctrl-Z [enter] instead. fp = open(name) except

Re: open() and EOFError

2014-07-07 Thread Chris Angelico
On Mon, Jul 7, 2014 at 11:06 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 07/07/2014 09:09, Chris Angelico wrote: It seems trivial in this example to break it into two try blocks: try: name = input(Enter file name, or Ctrl-D to exit) # On Windows, use Ctrl-Z [enter]

Re: open() and EOFError

2014-07-07 Thread Chris Angelico
On Mon, Jul 7, 2014 at 11:06 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: try: name = input(Enter file name, or Ctrl-D to exit) # On Windows, use Ctrl-Z [enter] instead. except EOFError: sys.exit() try: fp = open(name) except IOError: handle_bad_file(name)

Re: How to write this repeat matching?

2014-07-07 Thread rxjwg98
On Sunday, July 6, 2014 3:26:44 PM UTC-4, Ian wrote: On Sun, Jul 6, 2014 at 12:57 PM, rxjw...@gmail.com wrote: I write the following code: ... import re line = abcdb matchObj = re.match( 'a[bcd]*b', line) if matchObj: print matchObj.group() : ,

What is 're.M'?

2014-07-07 Thread rxjwg98
Hi, I learn this short Python code from: http://www.tutorialspoint.com/python/python_reg_expressions.htm but I still do not decipher the meaning in its line, even after read its command explanation. It says that: re.M: Makes $ match the end of a line (not just the end of the string) and

Re: What is 're.M'?

2014-07-07 Thread Skip Montanaro
Scroll down to the Module Contents section of this page: https://docs.python.org/2/library/re.html It explains re.M and other constants. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: What is 're.M'?

2014-07-07 Thread Mark Lawrence
On 07/07/2014 15:08, rxjw...@gmail.com wrote: Hi, I learn this short Python code from: http://www.tutorialspoint.com/python/python_reg_expressions.htm but I still do not decipher the meaning in its line, even after read its command explanation. It says that: re.M: Makes $ match the end of

Re: Module name does not match file name

2014-07-07 Thread Robert Kern
On 2014-07-07 12:56, Steven D'Aprano wrote: On Mon, 07 Jul 2014 12:15:51 +0100, Robert Kern wrote: On 2014-07-07 09:57, Steven D'Aprano wrote: What I don't understand is how import pg gets turned into run pgmodule.so? This has been standard Python behavior for extension modules since

Re: What is 're.M'?

2014-07-07 Thread Steven D'Aprano
On Mon, 07 Jul 2014 07:08:53 -0700, rxjwg98 wrote: More specific, what does 're.M' means? Feel free to look at it interactively. re.M is a flag to control the meaning of the regular expression. It is short for re.MULTILINE, just as re.I is short for re.IGNORECASE: py import re py re.M ==

Re: What is 're.M'?

2014-07-07 Thread rxjwg98
On Monday, July 7, 2014 10:46:19 AM UTC-4, Steven D'Aprano wrote: On Mon, 07 Jul 2014 07:08:53 -0700, rxjwg98 wrote: More specific, what does 're.M' means? Feel free to look at it interactively. re.M is a flag to control the meaning of the regular expression. It is short

Re: What is 're.M'?

2014-07-07 Thread rxjwg98
On Monday, July 7, 2014 10:46:19 AM UTC-4, Steven D'Aprano wrote: On Mon, 07 Jul 2014 07:08:53 -0700, rxjwg98 wrote: More specific, what does 're.M' means? Feel free to look at it interactively. re.M is a flag to control the meaning of the regular expression. It is short

Re: What is 're.M'?

2014-07-07 Thread rxjwg98
On Monday, July 7, 2014 10:46:19 AM UTC-4, Steven D'Aprano wrote: On Mon, 07 Jul 2014 07:08:53 -0700, rxjwg98 wrote: More specific, what does 're.M' means? Feel free to look at it interactively. re.M is a flag to control the meaning of the regular expression. It is short

[Python Brasil 10] Registrations are now open!

2014-07-07 Thread Renato Oliveira
Hey everyone! Registrations for Python Brasil are now open! http://2014.pythonbrasil.org.br/register Sadly the payment form is in portuguese, so if you have any trouble please let me know (in private message). The call for papers will open on Jul 10th as you can see here

Re: open() and EOFError

2014-07-07 Thread Steven D'Aprano
On Mon, 07 Jul 2014 22:19:20 +1000, Chris Angelico wrote: It's possible for input() to raise IOError, if I'm not mistaken; consider redirection, for instance. What indirection? Do you mean, if built-in input() has been monkey- patched? Well, sure, but in that case it could do anything. I'm

Re: How to write this repeat matching?

2014-07-07 Thread Anssi Saari
rxjw...@gmail.com writes: Because I am new to Python, I may not describe the question clearly. Could you read the original problem on web: https://docs.python.org/2/howto/regex.html It says that it gets 'abcb'. Could you explain it to me? Thanks again Actually, it tries to explain how *

Re: open() and EOFError

2014-07-07 Thread Chris Angelico
On Tue, Jul 8, 2014 at 1:45 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 07 Jul 2014 22:19:20 +1000, Chris Angelico wrote: It's possible for input() to raise IOError, if I'm not mistaken; consider redirection, for instance. What indirection? Do you mean, if

Re: open() and EOFError

2014-07-07 Thread Dan Stromberg
On 7/7/14, Mark Lawrence breamore...@yahoo.co.uk wrote: On 07/07/2014 09:09, Chris Angelico wrote: On Mon, Jul 7, 2014 at 6:00 PM, Steven D'Aprano st...@pearwood.info wrote: How do people feel about code like this? try: name = input(Enter file name, or Ctrl-D to exit) # On

Re: open() and EOFError

2014-07-07 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: On Mon, 07 Jul 2014 22:19:20 +1000, Chris Angelico wrote: It's possible for input() to raise IOError, if I'm not mistaken; consider redirection, for instance. What indirection? Do you mean, if built-in input() has been monkey- patched?

Re: open() and EOFError

2014-07-07 Thread Marko Rauhamaa
Marko Rauhamaa ma...@pacujo.net: input() quite naturally can raise an IOError. For example: import os, socket s = socket.socket(socket.AF_UNIX) s.bind(xyz) os.dup2(s.fileno(), 0); print(input()) results in an IOError (EINVAL, to be exact). Even simpler: import os

Re: How to write this repeat matching?

2014-07-07 Thread Ian Kelly
On Mon, Jul 7, 2014 at 7:30 AM, rxjw...@gmail.com wrote: Because I am new to Python, I may not describe the question clearly. Could you read the original problem on web: https://docs.python.org/2/howto/regex.html It says that it gets 'abcb'. Could you explain it to me? Thanks again The

Re: thread.interrupt_main() behaviour

2014-07-07 Thread Ian Kelly
On Mon, Jul 7, 2014 at 8:41 AM, Piyush Verma 114piy...@gmail.com wrote: Thanks Ian for information. There is slightly more I want to do. Consider if I want to kill some threads not all, is there a way to do that? You can't safely interrupt threads. What you can do is *request* the thread to

Re: What is 're.M'?

2014-07-07 Thread Mark Lawrence
On 07/07/2014 16:20, rxjw...@gmail.com wrote: For the second time, would you please use the mailing list 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 single line

Re: Question about metacharacter '*'

2014-07-07 Thread Ian Kelly
On Sun, Jul 6, 2014 at 4:49 PM, MRAB pyt...@mrabarnett.plus.com wrote: \d also matches more than just [0-9] in Unicode. I think that anything matched by \d will also be accepted by int(). decimals = [c for c in (chr(i) for i in range(17 * 2**16)) if unicodedata.category(c) == 'Nd']

Re: open() and EOFError

2014-07-07 Thread Ian Kelly
On Mon, Jul 7, 2014 at 2:09 AM, Chris Angelico ros...@gmail.com wrote: But if the code's more complicated and it's not so easy to split, then sure, doesn't seem a problem. It's like spam[foo//bar] and then catching either IndexError or ZeroDivisionError - there's no big confusion from having

Re: open() and EOFError

2014-07-07 Thread Chris Angelico
On Tue, Jul 8, 2014 at 3:25 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Mon, Jul 7, 2014 at 2:09 AM, Chris Angelico ros...@gmail.com wrote: But if the code's more complicated and it's not so easy to split, then sure, doesn't seem a problem. It's like spam[foo//bar] and then catching either

Re: open() and EOFError

2014-07-07 Thread Marko Rauhamaa
Ian Kelly ian.g.ke...@gmail.com: It's good practice to keep your try blocks as narrow as possible in any case. True. Unfortunately, that leads to trouble with the handy with construct: with open(path) as f: ... If the open() call is guarded against exceptions (as it usually

Re: open() and EOFError

2014-07-07 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: if you always break everything out to keep exception-catching scope as narrow as possible, you begin to lose readability in other ways. I've begun to wonder if there might exist a new, easier-to-read try-except syntax. Marko --

Re: open() and EOFError

2014-07-07 Thread Steven D'Aprano
On Mon, 07 Jul 2014 20:31:53 +0300, Marko Rauhamaa wrote: If the open() call is guarded against exceptions (as it usually should), one must revert to the classic syntax: try: f = open(path) except IOError: ... try: ... finally:

Re: open() and EOFError

2014-07-07 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: try: f = open(path) except Whatever: handle_error() else: with f: do_stuff() That's cool. Never really used try-else. That gets old really quickly! But then, handling errors is always the ugliest part of coding.

Re: open() and EOFError

2014-07-07 Thread Terry Reedy
On 7/7/2014 8:39 AM, Roy Smith wrote: On a different topic, I've always disliked embedding instructions to type Ctrl-D. The problem is, how to generate an EOF (or interrupt, or whatever) is configurable in the tty driver (see below). In theory, the user could have remapped EOF to be something

Re: Question about metacharacter '*'

2014-07-07 Thread rxjwg98
On Sunday, July 6, 2014 8:09:57 AM UTC-4, Devin Jeanpierre wrote: On Sun, Jul 6, 2014 at 4:51 AM, rxjw...@gmail.com wrote: Hi, I just begin to learn Python. I do not see the usefulness of '*' in its description below: The first metacharacter for repeating

Re: Question about metacharacter '*'

2014-07-07 Thread Devin Jeanpierre
On Mon, Jul 7, 2014 at 11:51 AM, rxjw...@gmail.com wrote: Would you give me an example using your pattern: `.*` -- `.`? I try it, but it cannot pass. (of course, I use it incorrectly) Those are two patterns. Python 3.4.1 (default, Jul 7 2014, 13:22:02) [GCC 4.6.3] on linux Type help,

Re: Question about metacharacter '*'

2014-07-07 Thread Mark Lawrence
On 07/07/2014 19:51, rxjw...@gmail.com wrote: Will you please do something about the double spaced google crap that you keep sending, I've already asked you twice. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence ---

Re: open() and EOFError

2014-07-07 Thread Gregory Ewing
Roy Smith wrote: We've since modified our cleanup script to run lsof and skip purging any releases which are still in use :-) Or, if you're on Unix, make sure you open all the files you're likely to need at the beginning and hold onto them. :-) -- Greg --

Re: open() and EOFError

2014-07-07 Thread Gregory Ewing
Terry Reedy wrote: Avoid EOFError. Much better, I think, is the somewhat customary s = input(Enter something, or hit return to exit) if not s: sys.exit() else: process s I beg to differ -- on Unix, Ctrl-D *is* the customary way to exit from something that's reading from stdin. In any case,

Re: open() and EOFError

2014-07-07 Thread Gregory Ewing
Marko Rauhamaa wrote: with open(path) as f: ... If the open() call is guarded against exceptions (as it usually should), one must revert to the classic syntax: Hmmm, maybe we could do with a with-except statement: with open(path) as f: ... except IOError: #

Re: open() and EOFError

2014-07-07 Thread Mark Lawrence
On 07/07/2014 23:09, Gregory Ewing wrote: Marko Rauhamaa wrote: with open(path) as f: ... If the open() call is guarded against exceptions (as it usually should), one must revert to the classic syntax: Hmmm, maybe we could do with a with-except statement: with open(path) as

Re: open() and EOFError

2014-07-07 Thread Roy Smith
In article 53bae1db$0$29995$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: While I agree with the general idea that try blocks should be as narrow *as reasonable*, they shouldn't be as narrow *as possible* since one can start guarding

Re: open() and EOFError

2014-07-07 Thread Roy Smith
In article mailman.11589.1404737902.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: I love how Unix will happily let you unlink a file and keep using it. Sure, it's a pitfall for people who are trying to figure out where on earth their disk space has gone (I deleted that

Re: open() and EOFError

2014-07-07 Thread Roy Smith
In article mailman.11588.1404737728.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Mon, Jul 7, 2014 at 10:39 PM, Roy Smith r...@panix.com wrote: $ stty -e [...] Not sure what you're running, but 'stty -e' throws an error for me (Debian Wheezy). That was on OSX. --

Re: open() and EOFError

2014-07-07 Thread Chris Angelico
On Tue, Jul 8, 2014 at 3:40 AM, Marko Rauhamaa ma...@pacujo.net wrote: Chris Angelico ros...@gmail.com: if you always break everything out to keep exception-catching scope as narrow as possible, you begin to lose readability in other ways. I've begun to wonder if there might exist a new,

Re: PEP8 and 4 spaces

2014-07-07 Thread Ben Finney
Dan Sommers d...@tombstonezero.net writes: On Mon, 07 Jul 2014 11:00:59 +1000, Ben Finney wrote: […] a poor design decision (a line beginning with U+0020 SPACE is semantically different from a line beginning with U+0009 CHARACTER TABULATION) can be irrevocable – the syntax can't be

Re: finditer

2014-07-07 Thread Jason Friedman
On Mon, Jul 7, 2014 at 1:19 AM, gintare g.statk...@gmail.com wrote: If smbd has time, maybe you could advice how to accomplish this task in faster way. I have a text = word{vb} wordtransl {vb} sent1. sent1trans. sent2 sent2trans... I need to match once wordtransl, and than many

error handling when opening files

2014-07-07 Thread Alex Burke
Hi there, While reading up on a previous thread 'open() and EOFError' I saw the following (with minor changes to help make my question clearer) block suggested as a canonical way to open files and do something: try: f = open(path) except IOError: handle_error() else: with f:

Re: error handling when opening files

2014-07-07 Thread Chris Angelico
On Tue, Jul 8, 2014 at 9:49 AM, Alex Burke alexjeffbu...@gmail.com wrote: The reason I preferred the second was in addition to catching the IOError when attempting the open() if the file does not exist I thought I was accounting for the possibility en error occurs while reading data out of the

[issue21597] Allow turtledemo code pane to get wider.

2014-07-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Great improvement. Full screen on my system, the artifact ghosting band is about 1/4 inch, as with the empty panes, instead of several inches, as it was in the original patch moving right to left. This worst-case (Windows) behavior is good enough to commit

[issue21597] Allow turtledemo code pane to get wider.

2014-07-07 Thread Ned Deily
Ned Deily added the comment: The one thing I think this patch still needs is a notice to the user that the sash can be moved. Once place is one of the help files. I can do that. Can we also put a line in the text box on startup? Change text pane width by moving the divider == Is that

[issue21907] Update Windows build batch scripts

2014-07-07 Thread Martin v . Löwis
Martin v. Löwis added the comment: All fine with me. As for buildmsi.bat: note that we used to have a daily msi builder that was using the script. It took too much effort to keep it running. -- ___ Python tracker rep...@bugs.python.org

[issue19714] Add tests for importlib.machinery.WindowsRegistryFinder

2014-07-07 Thread Martin v . Löwis
Martin v. Löwis added the comment: The patch looks fine to me. Someone please apply. -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19714 ___

[issue21803] Remove macro indirections in complexobject

2014-07-07 Thread Mark Dickinson
Mark Dickinson added the comment: LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21803 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21926] Bundle C++ compiler with Python on Windows

2014-07-07 Thread Martin v . Löwis
Martin v. Löwis added the comment: No, it's not on the roadmap. The recommended compiler is Microsoft Visual C, which we are not legally allowed to redistribute. -- nosy: +loewis resolution: - not a bug status: open - closed ___ Python tracker

[issue20135] FAQ need list mutation answers

2014-07-07 Thread Berker Peksag
Berker Peksag added the comment: LGTM. -- nosy: +berker.peksag stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20135 ___

[issue21597] Allow turtledemo code pane to get wider.

2014-07-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: I don't really know what most beginners will expect. Perhaps an entry in the help will be enough. I would like have a better how to use summary at the top of the file anyway. If I swish the normal cursor across the divide, it jumps from I-bar on text side to

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-07 Thread Andy Maier
Andy Maier added the comment: I see. But I don't think it is a sensible default, as the source code states. The Python doc (v2 and v3) is quite consistent in stating that `==` compares the values of two objects, while `is` compares object identity. Having a default implementation on the

[issue20135] FAQ need list mutation answers

2014-07-07 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- assignee: docs@python - ezio.melotti nosy: +rhettinger stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20135

[issue10289] Document magic methods called by built-in functions

2014-07-07 Thread Andy Maier
Andy Maier added the comment: Uploaded a patch for Python 3.4, and for merging into default. The patch addresses items 1) to 3) from my previous post; item 4) does not need to be addressed IMHO. Andy -- keywords: +patch Added file:

[issue21929] Rounding properly

2014-07-07 Thread Jeroen de Jong
New submission from Jeroen de Jong: I ma trying to find a way to round correctly. So far I get unexpected results for some values. -- components: Windows files: Rounding.py messages: 222444 nosy: jeroen1225 priority: normal severity: normal status: open title: Rounding properly type:

[issue16099] robotparser doesn't support request rate and crawl delay parameters

2014-07-07 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- assignee: - berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16099 ___ ___

[issue21929] Rounding properly

2014-07-07 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +mark.dickinson, skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21929 ___ ___

[issue21881] python cannot parse tcl value

2014-07-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4514804d0e50 by Serhiy Storchaka in branch '2.7': Issue #21881: Be more tolerant in test_tcl to not parsable by float() NaN http://hg.python.org/cpython/rev/4514804d0e50 New changeset 4879f6337ef6 by Serhiy Storchaka in branch '3.4': Issue #21881:

[issue10289] Document magic methods called by built-in functions

2014-07-07 Thread Andy Maier
Andy Maier added the comment: Uploaded v2 of the 3.4/default patch, which removes the comment line at the top of Doc/library/functions.rst (mentioned by Éric in the original message of this issue). - Please review the patch. - Please also double check whether there are any additional

[issue14050] Tutorial, list.sort() and items comparability

2014-07-07 Thread Andy Maier
Andy Maier added the comment: Comments on v2 of both patches: 1. The paragraph Each item needs to ... describes the requirement in terms of ordering relationships between items. It would be both simpler and less ambiguous to describe the requirement in terms of type must be orderable. See

[issue19593] Use specific asserts in importlib tests

2014-07-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset f426bd85f808 by Serhiy Storchaka in branch '3.4': Issue #19593: Use specific asserts in importlib tests. http://hg.python.org/cpython/rev/f426bd85f808 New changeset cace5cc29df0 by Serhiy Storchaka in branch 'default': Issue #19593: Use specific

[issue19593] Use specific asserts in importlib tests

2014-07-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Ezio for the review. I hope issue18864 will be merged without conflicts. -- dependencies: -Implementation for PEP 451 (importlib.machinery.ModuleSpec) resolution: - fixed ___ Python tracker

[issue19593] Use specific asserts in importlib tests

2014-07-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: commit review - resolved status: open - closed versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19593 ___

[issue21930] new assert raises syntax proposal

2014-07-07 Thread Pavel Tyslyatsky
New submission from Pavel Tyslyatsky: This proposal look preaty close to pep-463: http://legacy.python.org/dev/peps/pep-0463/, but in assertion context. Now python test libraries have different aproach for assertions, some try use own implementations, for example, for equality `assertEqual`

[issue21707] modulefinder uses wrong CodeType signature in .replace_paths_in_code()

2014-07-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 59921d2f023c by Berker Peksag in branch '3.4': Issue #21707: Add missing kwonlyargcount argument to ModuleFinder.replace_paths_in_code(). http://hg.python.org/cpython/rev/59921d2f023c New changeset 4b6798e74dcf by Berker Peksag in branch

[issue21929] Rounding properly

2014-07-07 Thread Mark Dickinson
Mark Dickinson added the comment: This is working as designed, though admittedly the cause of the unexpected results is non-obvious. In Python 2, there's no way to implement `round` for a general type: instead, the `round` function converts its *input* to a Python (binary) float, and then

[issue21707] modulefinder uses wrong CodeType signature in .replace_paths_in_code()

2014-07-07 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- assignee: - berker.peksag resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21707

[issue21929] Rounding properly

2014-07-07 Thread Mark Dickinson
Mark Dickinson added the comment: There may be an opportunity for a documentation improvement here: it would be helpful if the Python 2.7 documentation for the round function explained that its input is converted to float. -- assignee: - docs@python components: +Documentation

[issue21707] modulefinder uses wrong CodeType signature in .replace_paths_in_code()

2014-07-07 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21707 ___ ___

[issue21765] Idle: make 3.x HyperParser work with non-ascii identifiers.

2014-07-07 Thread Martin v . Löwis
Martin v. Löwis added the comment: Two observations: 1. This issue is only about identifiers. So processing of string literals is technically out of scope. 2. I'd suggest to replace .translate with regular expressions: py re.sub('[^(){}\[\]]','','foo(b[a]{r}≠)') '([]{})' I'm sure people

  1   2   >