Matthew Barnett added the comment:
Yes. As msg99456 suggests, I fixed it the my source code before posting.
Compare re in Python 3.3.2:
>>> re.compile('x').findall('', 1, 3)
['x', 'x']
>>> re.compile('x').findall('x
Matthew Barnett added the comment:
I think the simplest and clearest approach from the user's point of view is
just to deprecate inline flags that are not at the start of the pattern.
In practice, they almost invariably occur at the start anyway, although I do
remember once seeing a pa
Matthew Barnett added the comment:
I've just come across the same problem.
I uninstalled Python 3.4.1 amd64. There were other things installed in that
version, so some stuff remained.
I then tried to install Python 3.4.2 amd64, but it failed (same problem as Zac).
I ran the Python
Matthew Barnett added the comment:
@Terry: Just to clarify, I didn't have a problem installing over Python 3.4.1,
only with uninstalling Python 3.4.1 (with other stuff installed there) and then
installing Python 3.4.2.
--
___
Python tracker
Matthew Barnett added the comment:
@Mateon1: "I hope it's fixed"? Did you report it?
--
___
Python tracker
<http://bugs.python.org/issue2636>
___
___
Matthew Barnett added the comment:
The page on PyPI says where the project's homepage is located:
Home Page: https://code.google.com/p/mrab-regex-hg/
The bug was fixed in the last release.
--
___
Python tracker
<http://bugs.python.org/i
Matthew Barnett added the comment:
I notice that it puts the inline flags at the end. It would be better to put
them at the start.
--
___
Python tracker
<http://bugs.python.org/issue22
Matthew Barnett added the comment:
The docs for Python 3.5.0a0 still say "Unicode Private Use Area".
--
nosy: +mrabarnett
versions: +Python 3.5
___
Python tracker
<http://bugs.python.o
Matthew Barnett added the comment:
Some error messages use the indefinite article:
"expected a bytes-like object, %.200s found"
"cannot use a bytes pattern on a string-like object"
"cannot use a string pattern on a bytes-like object"
but others don
Matthew Barnett added the comment:
Here's how I can build the regex module on Windows 8.1, 64-bit, using only
MinGW64.
For Python 3.5, I can link against "python35.dll", but for earlier versions,
including Python 2.7, I need "libpython??.a".
I have built regex
Matthew Barnett added the comment:
@steve.dower: Yes.
For Python 35, it appears that it'll link to libpython??.a or python??.dll,
whichever it finds in the given folder, so it doesn't actually need
libpython??.a anymore. Whi
Matthew Barnett added the comment:
I agree that it would be nice if len(mo) == len(mo.groups()), but Serhiy has
explained why that's not the case in the regex module.
The regex module does support mo[name], so:
print('Located coordinate at (%(row)s, %(col)s)' % mo)
Matthew Barnett added the comment:
Your regex is a pathological case: it suffers from catastrophic backtracking
and can take a long time to finish.
The other problem is that the re module never releases the GIL, so while it's
performing the search in the low-level C code, other Python th
Matthew Barnett added the comment:
"not" has a lower priority than unary "-"; this:
not a < b
is parsed as:
not (a < b)
How would you parse:
0 + not 0 + 0
?
Would it be parsed as:
0 + not (0 + 0)
?
Similar remarks could apply to "yield&qu
Matthew Barnett added the comment:
The or-ed patterns aren't between the anchors. The ^ is at the start of the
first alternative and the $ is at the end of the last alternative.
--
___
Python tracker
<http://bugs.python.org/is
Matthew Barnett added the comment:
There's an "executable installer"; it's a .exe instead of a .msi.
--
nosy: +mrabarnett
___
Python tracker
<http://bug
New submission from Matthew Barnett:
I'm unable to import tkinter in Python 3.5.0rc1.
The console says:
C:\Python35>python
Python 3.5.0rc1 (v3.5.0rc1:1a58b1227501, Aug 10 2015, 05:18:45) [MSC v.1900 64
bit (AMD64)] on win32
Type "help", "copyright", "credits&q
Matthew Barnett added the comment:
Yes, I can confirm that that works for me.
--
___
Python tracker
<http://bugs.python.org/issue24847>
___
___
Python-bugs-list m
Matthew Barnett added the comment:
On running the installer, Windows reports:
"""Windows SmartScreen prevented an unrecognised application from starting.
Running this application might put your PC at risk.
Application: Python-24847-2.exe
Publisher: Unknown Publisher"
Matthew Barnett added the comment:
After matching '^', it advances so that it won't find the same match again (and
again and again...).
Unfortunately, that means that it sometimes misses some matches.
It's a known issue.
--
__
Matthew Barnett added the comment:
Just to confirm, it _is_ a bug.
It tries to avoid getting stuck, but the way it does that causes it to skip a
character, sometimes missing a match it should have found.
--
___
Python tracker
<h
Matthew Barnett added the comment:
So, you write a string literal without a 'u' (or 'b') prefix, and there's no
'from __future__ import unicode_literals' in the module, so you expect it to be
a bytestring, but it's not, it's a Unicode str
Matthew Barnett added the comment:
I'm going to have to agree with ThiefMaster. String literals don't truncate
like that, nor do lists, nor tuples.
Are there any similar cases of truncation elsewhere in the standard library?
--
___
Pyth
Matthew Barnett added the comment:
The 4th argument of re.sub is the count, not the flags.
Not a bug.
--
___
Python tracker
<http://bugs.python.org/issue26
Matthew Barnett added the comment:
The pattern '\', which is the same as '', matches the string
'', and that is replaced with ''.
--
___
Python tra
Matthew Barnett added the comment:
The 3rd argument is the count (the maximum number of replacements, although 0
means no limit, not no replacements). You're passing in the flag re.I instead.
re.I happens to have the numeric value 2, so you're telling it to do no more
than 2 re
Changes by Matthew Barnett :
--
nosy: -mrabarnett
___
Python tracker
<http://bugs.python.org/issue24557>
___
___
Python-bugs-list mailing list
Unsubscribe:
Matthew Barnett added the comment:
@Mark is correct, it's not a bug.
In the first example:
It tries to match each alternative at position 0. Failure.
It tries to match each alternative at position 1. Failure.
It tries to match each alternative at position 2. Failure.
It tries to match
Matthew Barnett added the comment:
Not quite all. POSIX regexes will always look for the longest match, so the
order of the alternatives doesn't matter, i.e. x|xy would give the same result
as xy|x.
--
___
Python tracker
<http://bugs.py
Matthew Barnett added the comment:
The problem is with the "(\w+\s*)+". \s* can match an empty string, so when
matching a word it's like "(\w+)+".
If you have n letters, there are 2**n ways it could match, and if what follows
never matches, it'll try all of them.
Matthew Barnett added the comment:
The 4th argument of re.sub is the maximum count (0 means unlimited).
>>> help(re.sub)
Help on function sub in module re:
sub(pattern, repl, string, count=0, flags=0)
Return the string obtained by replacing the leftmost
non-overlapping occur
Matthew Barnett added the comment:
FTR, in "_odict_resize" there's this:
size_t i = _odict_get_index(od, _odictnode_KEY(node));
if (i < 0) {
Note that "i" is declared as unsigned and then tested whether it's negati
Matthew Barnett added the comment:
In "odict_new", if "_odict_initialize" fails, will the dict pointed to by
"od_inst_dict" be deallocated?
In "odictiter_new", there's "Py_INCREF(od);".
Matthew Barnett added the comment:
First some background: when you put a new entry into a dict, it looks for an
empty slot, the key's hash determining the initial choice, but if that slot's
occupied, it picks another, etc, so the key might not be in the slot of first
c
Matthew Barnett added the comment:
@Tim: Why are you using re.search with '^'? Does the pattern that's passed in
ever contain '(?m)'? If not, re.match without '^' is better.
--
___
Python tracker
Matthew Barnett added the comment:
I downloaded Python 3.6.0b1 not long after it was released and it works for me:
>>> re.match('(?i:CaseInsensitive)', 'caseinsensitive')
<_sre.SRE_Match object; span=(0, 15), match='caseinsensitive'>
--
_
Matthew Barnett added the comment:
I'd prefer an explicit suppression to changing a long-standing behaviour.
--
___
Python tracker
<http://bugs.python.org/is
Matthew Barnett added the comment:
@Sworddragon: Your post says that it should be more generic or complete the
list, but it doesn't make a suggestion as to what it should _actually_ say.
Example: "Compile a regular expression pattern into a regular expression
object, which can b
Matthew Barnett added the comment:
I split the file into sections, each containing no more 1000 lines, and tried
reading each section. Attached is a zip file of those that didn't return the
expected number of rows.
The problem appears to be due to unclosed quotes, which cause following
Matthew Barnett added the comment:
I hope you make it clear what you mean by 'equal', i.e. that it's comparing the
pattern and the flags (AFAICT), so re.compile('(?x)a') != re.compile('(?x) a ').
--
___
Pyth
Matthew Barnett added the comment:
@Barry: repl already supports some escapes, e.g. \g for named groups,
although not \xXX et al, so deprecating unknown escapes like in the pattern
makes sense to me.
BTW, the regex module already supports \xXX, \N{XXX}, etc
501 - 541 of 541 matches
Mail list logo