[issue44939] proposal: add support for regex in Literal type hint

2021-08-17 Thread Leon Mintz
New submission from Leon Mintz : Could typing.Literal (or analogous) accept a regex pattern to match against? For example, if I want a duration string, duration: str # allowed syntax: 3s, 3m, 3h etc. vs duration: LiteralPattern['[0-9]+[smh]'] -- messages: 399787 nosy: leon.mintz

[issue40043] RegExp Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem

2020-03-25 Thread Leon Hampton
Leon Hampton added the comment: Matthew Barnett & SilentGhost, Thank you for your prompt responses. (Really prompt. Amazing!) SilentGhost, Regarding your response, I used re.search, not re.match. When I used re.match, the regex failed. When I used re.search, it matched. Here are my t

[issue40043] RegExp Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem

2020-03-22 Thread Leon Hampton
Leon Hampton added the comment: Hello, There may be a bug in the implementation of the Conditional Construction of Regular Expressions, namely the (?(id/name)yes-pattern|no-pattern). In the Regular Expression documentation (https://docs.python.org/3.7/library/re.html), in the portion about

[issue40043] Poor RegEx example for (?(id/name)yes-pattern|no-pattern)

2020-03-22 Thread Leon Hampton
New submission from Leon Hampton : Hello, In the 3.7.7 documentation on Regular Expression, the Conditional Construct, (?(id/name)yes-pattern|no-pattern), is discussed. (This is a very thorough document, by the way. Good job!) One example given for the Conditional Construct does not work

[issue38574] Dataclasses documentation should show the necessary imports

2019-10-24 Thread Leon Matthews
New submission from Leon Matthews : In the code sample documentation for other modules we show the necessary imports, we should do the same for dataclasses. For example, the very first example uses the `dataclass` decorator without importing it first. It should read:: from dataclasses

[issue34020] Add '%(asctime)s' into default BASIC_FORMAT in logging module

2018-07-02 Thread Leon H.
New submission from Leon H. : Current BASIC_FORMAT: BASIC_FORMAT = "%(levelname)s:%(name)s:%(message)s" The first thing people do is set the format to '%(asctime)s:%(levelname)s:%(name)s:%(message)s' or like after importing logging module. Could we put the '%(asctime)s' into t

[issue31012] suggestion: allow termination argument in argparse to be specified as argument

2017-08-03 Thread Leon Avery
Leon Avery added the comment: The POSIX guideline suggests that -- should be available as an option argument. One should be able to say "command --opt --" in order to make '--' the value of the '--opt' option. > There are some known problems with this '--', specially when t

[issue31037] Results in section 4.4 break and continue

2017-07-25 Thread Lisabel Leon
Lisabel Leon added the comment: Thank you Zachary for such a speedy response. I'll paste text next time. Rgds! Lisabel On Tue, Jul 25, 2017 at 11:56 AM, Zachary Ware <rep...@bugs.python.org> wrote: > > Zachary Ware added the comment: > > Take a look at the statement imm

[issue31037] Results in section 4.4 break and continue

2017-07-25 Thread Lisabel Leon
New submission from Lisabel Leon: The first example of this section shows different results if typed into the Python interpreter. This is the documentation (documentation.png) and these are the results as I type it into my environment (testresults.jpg). -- assignee: docs@python

[issue31012] suggestion: allow termination argument in argparse to be specified as argument

2017-07-24 Thread Leon Avery
New submission from Leon Avery: In the argparse module, the argument '--' is interpreted as a signal that everything after it is a positional argument. '--' is literally written into the argparse code, in _parse_known_args. This means that a user who wishes to use '--' in some other way

[issue30904] Python 3 logging HTTPHandler sends duplicate Host header

2017-07-11 Thread Leon Helwerda
New submission from Leon Helwerda: The logging HTTPHandler sends two Host headers which confuses certain servers. Tested versions: Python 3.6.1 lighttpd/1.4.45 Steps to reproduce (MWE): 1) Set up a lighttpd server which is to act as the logging host (we do not actually implement anything

[issue20480] Add ipaddress property to get name of reverse DNS PTR record

2014-02-06 Thread Leon Weber
Leon Weber added the comment: I noticed an inconsistency between IPv4 and IPv6 in my temporary variable names when looking at the patch again after a few days. Here’s an updated patch. Not that it’s important, but I sleep better that way :) As consensus seems to have settled on leaving out

[issue20480] Add ipaddress property to get name of reverse DNS PTR record

2014-02-02 Thread Leon Weber
Leon Weber added the comment: I’ve changed the wording in the documentation a bit and added an explanatory sentence, how about this? I think this should make pretty clear what it does and does not, and also easy to find in the documentation when searching for “reverse”, “PTR” and “pointer

[issue20480] Add ipaddress property to get name of reverse DNS PTR record

2014-02-02 Thread Leon Weber
Leon Weber added the comment: As for what the host command does, it doesn't add any trailing dots here: Oh, interesting. It does on Fedora 19 with version 9.9.3, but not on my Ubuntu installation with version 9.8.1. So it seems this was added between 9.8.1 and 9.9.3

[issue20480] Add ipaddress property to get name of reverse DNS PTR record

2014-02-02 Thread Leon Weber
Leon Weber added the comment: According to apt-cache, the version I tried with is 1:9.9.3.dfsg.P2-4ubuntu1 Ok, then it depends on something else apparently. It’s not so relevant anyway because even with the trailing dot, “host” is inconsistent between IPv4 and IPv6, and we should choose

[issue20480] Add ipaddress property to get name of reverse DNS PTR record

2014-02-02 Thread Leon Weber
Leon Weber added the comment: I can live without the trailing dot, although I’d find it “more correct” to have it. I’ve attached an alternative patch that doesn’t return a trailing dot, it’s up to you guys to decide which one you prefer. -- Added file: http://bugs.python.org

[issue20480] Add ipaddress property to get reverse DNS name

2014-02-01 Thread Leon Weber
New submission from Leon Weber: I was missing a method to compute the reverse DNS name for an IP address, and I felt this is something that would belong in the ipaddress module; so here’s a patch for the ipaddress module adding a reverse_name property to IPv?Address. This is an example

[issue20480] Add ipaddress property to get name of reverse DNS pointer

2014-02-01 Thread Leon Weber
Leon Weber added the comment: Thanks for the feedback, I agree reverse_pointer is a better, less ambiguous name for the property. I’ve amended the patch to reflect this suggestion. Regarding the trailing dot, I felt it more appropriate to have it that to leave it out, but I don’t have

[issue20480] Add ipaddress property to get name of reverse DNS pointer

2014-02-01 Thread Leon Weber
Leon Weber added the comment: Oh nice, then fewer trees have to die. I’ve now signed the contributor’s agreement. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20480

[issue17848] issue about compile with clang and build a shared lib

2013-04-26 Thread leon zheng
New submission from leon zheng: build with prefix point to a arbitrary path, can't find the dynamic lib, and libffi upstream bug: ./configure --prefix=xxx --enable-shared --enable-ipv6 --with-threads CC=clang -- components: Build files: mywork.pitch messages: 187838 nosy: matrixsystem

[issue16941] TkInter won't update display on OS X if delay is too small

2013-01-12 Thread Leon Maurer
Leon Maurer added the comment: That's a good idea; I'll shoot them a message. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16941

[issue16941] TkInter won't update display on OS X if delay is too small

2013-01-12 Thread Leon Maurer
Leon Maurer added the comment: Well, it looks like the problem is known and can't be fixed: http://mail.python.org/pipermail/tkinter-discuss/2013-January/003343.html Oh well. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue16941] TkInter won't update display on OS X if delay is too small

2013-01-12 Thread Leon Maurer
Leon Maurer added the comment: It seems to depend on what you're doing. Plus, the delay I needed turned an already slow animation in to a slide show. In this case, a better fix seems to be sticking a root.update() right before the root.after. Then it works with no delay. However, apparently

[issue15574] IDLE crashes using clipboard copy command on OS X with ActiveTcl 8.5.12

2013-01-11 Thread Leon Maurer
Leon Maurer added the comment: Thanks for the update. IDLE does indeed work for me now. Unfortunately, the program I was trying to get working under OS X still has lots of problems. At least it doesn't crash due to copy and paste anymore

[issue16941] TkInter won't update display on OS X if delay is too small

2013-01-11 Thread Leon Maurer
New submission from Leon Maurer: I'm running in to a problem where TkInter won't update the display on OS X. I've attached a simple piece of code that has this problem, and I've also made a short screen-cast of the problem: https://mywebspace.wisc.edu/lnmaurer/web/updatebug/updatebug.mov

[issue15574] IDLE crash in OS X even with 2.7.3 and ActiveTcl 8.5.12

2012-08-07 Thread Leon Maurer
New submission from Leon Maurer: I'm getting crashes with IDLE like those that have been reported before (e.g. by trying to copy using Command-C), but I followed (or at least tried to follow) the directions at http://www.python.org/getit/mac/tcltk/ and have installed Python 2.7.3 64-bit/32

[issue15574] IDLE crash in OS X even with 2.7.3 and ActiveTcl 8.5.12

2012-08-07 Thread Leon Maurer
Leon Maurer added the comment: Thanks for the quick response. I don't have access to an older version of ActiveTcl, but in truth, I'm mostly relieved that it's not just me. (I spent a long time trying to figure out why some Tkinter code I had written would work on Linux and Windows but not OS

[issue15076] Sometimes couldn't import os, shown 'import site' failed, use -v for trackback

2012-06-20 Thread Leon Zhang
Changes by Leon Zhang leozh...@cisco.com: Removed file: http://bugs.python.org/file26015/pygen.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15076

[issue15076] Sometimes couldn't import os, shown 'import site' failed, use -v for trackback

2012-06-20 Thread Leon Zhang
Leon Zhang leozh...@cisco.com added the comment: No people help me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15076 ___ ___ Python-bugs

[issue15076] Sometimes couldn't import os, shown 'import site' failed, use -v for trackback

2012-06-20 Thread Leon Zhang
Leon Zhang leozh...@cisco.com added the comment: Thank ramchandra.apte for the help. I checked linecache.py, and the file exists. Unfortunately I don't have root perssion to re-install Python. I also checked another bug http://bugs.python.org/issue10496;, I think that may be the truth

[issue15076] Sometimes couldn't import os, shown 'import site' failed, use -v for trackback

2012-06-15 Thread Leon Zhang
New submission from Leon Zhang leozh...@cisco.com: Hello Experts, I am using Python 2.6.2 on a Linux machine. I found sometimes I have problem to run my simple python script. Linux version and Python version leonz@fxcsgbu2c1% uname -a SunOS fxcsgbu2c1 5.8 Generic_117350-06

[issue14006] Improve the documentation of xml.etree.ElementTree

2012-02-26 Thread Leon Matthews
Leon Matthews pyt...@lost.co.nz added the comment: Thank you Éric and Ezio. I'll produce a patch to convert the javadoc to docstrings this week, then submit it here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14006

[issue14006] Improve the documentation of xml.etree.ElementTree

2012-02-21 Thread Leon Matthews
Leon Matthews l...@lost.co.nz added the comment: The ElementTree.py module has good JavaDoc-style function-level documentation, but as it's not in docstring format, it can't be seen from the interactive help. I'd be willing to convert the current comments into docstrings, as long as I

[issue14078] Add 'sourceline' property to xml.etree Elements

2012-02-21 Thread Leon Matthews
New submission from Leon Matthews l...@lost.co.nz: The lxml implementation of the ElementTree API puts a `sourceline` property onto every Element object, which I recently found useful when producing diagnostic messages. I think it would be a useful improvement to make the standard library's

[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2011-08-10 Thread Alex Leon
Alex Leon ael...@gmail.com added the comment: It could have a 2 phase regex match. We match the first one, and if it fails, match the second and produce a warning. I think producing a warning is a good idea, as it allows the programmer to know that the implementation of basic auth

[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2011-08-03 Thread Alex Leon
Alex Leon ael...@gmail.com added the comment: For some reason a caret went missing in the regex fix. It should read 'realm=([\']?)([^\']*)\\2', re.I) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12541

[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2011-07-12 Thread Alex Leon
New submission from Alex Leon ael...@gmail.com: It looks like some servers using basic authentication don't include quotes around the realm (example https://api.connect2field.com) as required by rfc 2617. urllib wont handle these requests and silently fails, but a simple change to the regex

[issue6407] multiprocessing Pool should allow custom task queue

2010-10-24 Thread Matthew Leon Grinshpun
Matthew Leon Grinshpun vertesp...@gmail.com added the comment: I should be able to do this in November. For the moment I'm a bit busy. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6407

Discarding STDERR generated during subprocess.popen

2010-08-23 Thread Leon Derczynski
Hi, I would like to run an external program, and discard anything written to stderr during its execution, capturing only stdout. My code currently looks like: def blaheta_tag(filename): blaheta_dir = '/home/leon/signal_annotation/parsers/blaheta/' process = subprocess.Popen

How to read source code of python?

2010-06-09 Thread Leon
Hi, there, I'm trying to read the source code of python. I read around, and am kind of lost, so where to start? Any comments are welcomed, thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

[issue6715] xz compressor support

2009-09-20 Thread Leon Matthews
Changes by Leon Matthews l...@lost.co.nz: -- nosy: +leonov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6715 ___ ___ Python-bugs-list mailing

[issue6541] SpooledTemporaryFile Cleanups

2009-07-22 Thread Leon Matthews
Changes by Leon Matthews l...@lost.co.nz: -- title: SpooledTemporaryFile operates differently to TemporaryFile - SpooledTemporaryFile Cleanups ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6541

[issue6541] SpooledTemporaryFile cleanups

2009-07-22 Thread Leon Matthews
Changes by Leon Matthews l...@lost.co.nz: -- title: SpooledTemporaryFile Cleanups - SpooledTemporaryFile cleanups ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6541

[issue6541] SpooledTemporaryFile operates differently to TemporaryFile

2009-07-21 Thread Leon Matthews
New submission from Leon Matthews l...@lost.co.nz: According the docs for the tempfile module, SpooledTemporaryFile() should operate exactly as TemporaryFile() does. However, while playing around trying to learn the module I found a couple of places where this is not the case: import tempfile

[issue6407] multiprocessing Pool should allow custom task queue

2009-07-03 Thread Matthew Leon Grinshpun
New submission from Matthew Leon Grinshpun vertesp...@gmail.com: Multiprocessing's Pool class __init__ method is written in a way that makes it very difficult for a subclass to modify self._taskqueue. There are very good reasons for wanting to do this - ie, making the taskqueue block when

[issue6407] multiprocessing Pool should allow custom task queue

2009-07-03 Thread Matthew Leon Grinshpun
Matthew Leon Grinshpun vertesp...@gmail.com added the comment: I have attached a patch. All I did was shift the one line from __init__ to _setup_queues. That's it. You could take advantage of the change in the following way: class BlockingPool(pool.Pool): def _setup_queues(self

Re: Which one is best Python or Java for developing GUI applications?

2009-05-05 Thread Leon
I think there are two advantages over java for GUI application First, python is more productive and has very rich third modules support, you can check the demo of wxPython. Second, you can develop native-looking GUI BTW: I'm developing GUI application using python and wxPython. Second, On

what's the best way to call a method of object without a guarantee of its existence

2009-05-05 Thread Leon
One way, define the object before it is used, like this: object = None . . if object is not None: object.method() The other way, using try ... catch try: object.method() catch NameError: pass for big programs, which is better, or any other way? Miles --

Re: what's the best way to call a method of object without a guarantee of its existence

2009-05-05 Thread Leon
On May 5, 3:25 am, Marco Mariani ma...@sferacarta.com wrote: Leon wrote: One way,  define the object before it is used, like this: object = None This is a good practice anyway. Conditional existance of objects is quite evil. Resorting to if defined('foo') is double-plus-ugly

Re: do something in time interval

2008-10-06 Thread Leon Zhang
Petr, I am not an expert, but why not to use time.sleep(5)? If you are using wxPython, you may also try wx.Timer, in which you could set its interval. Good luck! Leon On Tue, Oct 7, 2008 at 2:07 AM, Petr Jakes [EMAIL PROTECTED] wrote: I have infinitive loop running script and I would like

Re: Socket Question

2008-10-01 Thread Leon Zhang
Maybe you need to close the socket somewhere else, rather than to close it when you receive the your response. On Tue, Sep 30, 2008 at 7:01 AM, Ali Hamad [EMAIL PROTECTED] wrote: Hello All : A socket question from a networking newbie. I need to create a server that: 1) receive a message

Re: Eclipse, Python, wxPython and code completion

2008-08-11 Thread leon . domingo
On 11 ago, 04:34, SPE - Stani's Python Editor [EMAIL PROTECTED] wrote: On 10 aug, 20:42, [EMAIL PROTECTED] wrote: Hello, I've installed Eclipse, Python 2.5 and wxPython on Ubuntu 8.04. The problem is that I can't get code completion for wx module. I don't know if it occurs the same

Eclipse, Python, wxPython and code completion

2008-08-10 Thread leon . domingo
Hello, I've installed Eclipse, Python 2.5 and wxPython on Ubuntu 8.04. The problem is that I can't get code completion for wx module. I don't know if it occurs the same with other libraries outside the python core. If I compile/run my code containing the wx library, I get an application running

the pipe reading in Thread dose not work.

2008-06-01 Thread Leon zhang
#!/usr/bin/env python # -*- coding: utf-8 -*- import string, sys from threading import Thread import os import time class test_pipe(Thread): def __init__(self, fd): Thread.__init__(self) self.testfd = fd def run(self): print started thread begin -

Re: TK 8.5

2008-01-01 Thread Leon
: the initial 2.6 target is for April 2008 Great ! But I found nothing about Tk 8.5 ? Leon -- http://mail.python.org/mailman/listinfo/python-list

TK 8.5

2007-12-31 Thread Leon
version of TK[inter] included in the last version of Python (2.5.1) ? Can you give me informations (or links, etc...) about this three questions ? Thanx in advance !!! Leon -- http://mail.python.org/mailman/listinfo/python-list

Find the ID, but how to select/copy the whole string by ID?

2007-09-19 Thread Leon
Hi everybody, I am a beginer for Python, hope can get help from you guys. What I want to do is : Input an ID - find the ID in the file - copy the whole string str id='xxx'y/str stringID = str(raw_input('Enter the string ID : ')) file = open('strings.txt') sourcefile = file.read()

Formatting a string to be a columned block of text

2006-12-26 Thread Leon
a newspaper on the screen. Text processing is very new to me, any ideas on how I could achieve a multi-columned text formatter. Are there any libraries that already do this? Thanks and happy holidays! Leon -- http://mail.python.org/mailman/listinfo/python-list

Freetype 2 Bindings

2006-09-07 Thread Leon
be forever grateful. Thanks, Leon -- http://mail.python.org/mailman/listinfo/python-list

Higher-level OpenGL modules

2006-09-05 Thread Leon
like the processing language - http://www.processing.org/reference/index.html). The closest thing I could find was devachan - http://www.cesaremarilungo.com/sw/devachan/, but its very limited. Any response would be greatly appreciated. Thanks Leon -- http://mail.python.org/mailman/listinfo/python

Re: Higher-level OpenGL modules

2006-09-05 Thread Leon
Thanks guys!, Ill look into your suggestions. I'm actually currently working directly with pyOpenGL, but hopefully Ill find something that would make me more efficient. I might end up writing a library myself. -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression: Matching substring

2006-04-12 Thread Leon
Hi Kevin, You may notice that, for matching the regex (0|(1(01*0)*1))*, the left most three characters of a string must not be ``101 while not followed by an `0'. After reading the first `1', automata expects `1' or ``00 or ``010 or ``11, right?:) Kevin CH 寫道: Hi, I'm currently running

Re: Regular Expression: Matching substring

2006-04-12 Thread Leon
You are right. In fact the procedure is as follows: The substr ``101101 is no problem, if stop here, match will successful. But the tailing `1' occurs, so we may imagine the working automata move to a state, which according to the regexp's outer most `)', and ready to repeat the whole regexp

what module can do html encoder??

2004-12-12 Thread Leon
example: s = ' ' --- nbsp; -- http://mail.python.org/mailman/listinfo/python-list