Ma Lin added the comment:
How about using a hybrid implementation for `int`.
For example, on 64-bit platform, if (a integer >=-9223372036854775808 and
<=9223372036854775807), use a native `signed long` to represent it.
People mostly use +-* operations, maybe using native int is faster
Ma Lin added the comment:
Greg, could you try this code after your patch?
>>> import re
>>> re.match(r'\s', '\x1e')
# <- before patch
------
nosy: +Ma Lin
___
Python tracker
<https://bu
Ma Lin added the comment:
How about write a suggestion on when to use them in the comment?
For example:
> You should use it only in cases when the likeliest branch is
> very very very likely, or when the unlikeliest branch is very
> very very unlikely.
from https://kernelnewbie
Ma Lin added the comment:
VC2017 optimizes multiple `unsigned char)((c) & 0xff` to a single `movzx`
operation, maybe other compilers do it as well.
If so, there will be no performance changes.
--
___
Python tracker
<https://bugs.pyt
Ma Lin added the comment:
Or remove Py_CHARMASK in Py_ISxxx/Py_TOLOWER/Py_TOUPPER macros?
Sometimes `c` is already a unsinged char, Py_CHARMASK is not necessary in these
cases.
--
___
Python tracker
<https://bugs.python.org/issue37
Ma Lin added the comment:
Search "Py_CHARMASK" in Python source code, there are more than a dozen
Py_CHARMASK can be deleted:
https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/mystrtoul.c#L102
https://github.com/python/cp
Ma Lin added the comment:
The current AF_UNIX address family of Windows10 doesn't support datagram,
adding this flag may break some cross-platform code:
https://github.com/osbuild/osbuild/blob/9371eb9eaa3d0a7cab876eb4c7b70f519dfbd915/osbuild/__init__.py#L253
https://github.com/watsona4
Ma Lin added the comment:
It would be nice to investigate the habit of using AF_UNIX in Python code on
GitHub:
https://github.com/search?l=Python=AF_UNIX=Code
If adding this flag will break a lot of code, due to lacking supports to
datagram, maybe we should not add AF_UNIX at once
Ma Lin added the comment:
Have you upgraded the building SDK that supports AF_UNIX?
And should remove AF_UNIX flag at runtime on systems older than Windows 10
1804, see issue32394.
--
nosy: +Ma Lin
___
Python tracker
<https://bugs.python.
Ma Lin added the comment:
Looks like a similar problem to issue29097.
>>> from datetime import datetime
>>> d = datetime.fromtimestamp(1)
>>> d.timestamp()
Traceback (most recent call last):
File "", line 1, in
OSError: [Errno 22] Invalid
Ma Lin added the comment:
I tried PR 14030 today.
By default, the fgcolor is black.
Looks like a black belt always on the left side, this makes me feel a bit
oppressive.
Of course, the fgcolor can be changed.
--
nosy: +Ma Lin
Added file: https://bugs.python.org/file48455/1.png
Ma Lin added the comment:
Try this pattern:
>>> re.split(r"\s+", text)
['Some', 'File', 'Num10', 'example.txt']
IMO 3.7 behaivor is more reasonable, it fixes a bug (issue25054).
------
nosy: +Ma Lin
___
Python tracker
<h
Ma Lin added the comment:
toggle conditions -> trigger conditions
--
___
Python tracker
<https://bugs.python.org/issue21872>
___
___
Python-bugs-list mai
Ma Lin added the comment:
I investigated this problem.
Here is the toggle conditions:
- The format is FORMAT_ALONE, this is the legacy .lzma container format.
- The file's header recorded "Uncompressed Size".
- The file doesn't have "End of Payload Marker" or &
Ma Lin added the comment:
2.7 branch:
PR 14182 is for Windows build
PR 14183 is for Mac OS X build
--
___
Python tracker
<https://bugs.python.org/issue35
Change by Ma Lin :
--
pull_requests: +14020
pull_request: https://github.com/python/cpython/pull/14183
___
Python tracker
<https://bugs.python.org/issue35
Change by Ma Lin :
--
pull_requests: +14019
pull_request: https://github.com/python/cpython/pull/14182
___
Python tracker
<https://bugs.python.org/issue35
Ma Lin added the comment:
PR 14179 is for Windows build
PR 14180 is for Mac OS X build
Both update to Sqlite 3.28.0
--
title: Update SQLite to 3.26 in Windows and macOS installer builds -> Update
SQLite to 3.28 in Windows and macOS installer bui
Change by Ma Lin :
--
pull_requests: +14018
pull_request: https://github.com/python/cpython/pull/14180
___
Python tracker
<https://bugs.python.org/issue35
Change by Ma Lin :
--
keywords: +patch
pull_requests: +14017
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/14179
___
Python tracker
<https://bugs.python.org/issu
Ma Lin added the comment:
I wrote a review guide in PR 14048.
--
versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python
3.6
___
Python tracker
<https://bugs.python.org/issue21
Change by Ma Lin :
--
pull_requests: +13910
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/14048
___
Python tracker
<https://bugs.python.org/issu
Ma Lin added the comment:
> 3.7/3.8 are done
3.7 and master (3.9) are done, 3.8 was missed.
--
nosy: +Ma Lin
___
Python tracker
<https://bugs.python.org/issu
Ma Lin added the comment:
fix-bug.diff fixes this bug, I will submit a PR after thoroughly understanding
the problem.
--
keywords: +patch
Added file: https://bugs.python.org/file48391/fix-bug.diff
___
Python tracker
<https://bugs.python.
Change by Ma Lin :
--
nosy: +Ma Lin
___
Python tracker
<https://bugs.python.org/issue21872>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Ma Lin added the comment:
@Mariatta Wijaya, would you update SQLite?
I want to do it myself, by following your patch in issue28791.
But I find I have to commit SQLite's source code to
https://github.com/python/cpython-source-deps, so I think this should be done
by a core developer
Change by Ma Lin :
--
nosy: +Ma Lin
___
Python tracker
<https://bugs.python.org/issue36859>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Ma Lin added the comment:
This bug was fixed in Python 3.7, see issue32308.
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit
(Intel)] on win32
>>> re.compile('(?m)(?P[
>>> \t]+\r*$)|(?P(?<=[^\n])\Z)').subn(lambda m:next('<'+k+'>'
Ma Lin added the comment:
> My initial idea was to add a lightweight module cachesreg with two functions:
> register() and clear_caches().
If it only has two functions, it could be a sub-module sys.cachesreg
Or a lifecycle module, as the name, dedicated to such kind of functions.
Re
Ma Lin added the comment:
I suggest the documentation be written in more detail.
For example, in __clearcache__'s section, state explicitly that this magic
function is for module-level cache, and it will be invoked by
sys.clear_caches().
Maybe also introduce the background: some caches may
Ma Lin added the comment:
FYI, re module's cache is using FIFO policy:
https://github.com/python/cpython/blob/v3.8.0a3/Lib/re.py#L288-L293
--
___
Python tracker
<https://bugs.python.org/issue36
Change by Ma Lin :
--
keywords: +patch
pull_requests: +12558
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36482>
___
___
Python-
New submission from Ma Lin :
Currently, when the cache is full, the entire cache is cleared.
This patch let it use FIFO policy.
Inada Naoki, Raymond Hettinger, could you review this patch? Thanks.
No hurry, just do it when you have time.
--
components: Library (Lib)
messages: 339168
Ma Lin added the comment:
> AC will not happen: It makes the module too large and unreadable.
AC has great performance improvements these days: issue35582 and issue36127
It's quite worthy of reconsidering this decision.
--
nosy: +Ma Lin
___
Pyt
Ma Lin added the comment:
It seems SSE2 can be re-enabled for 3.8 branch.
> Starting with the March 2018 Windows 7 updates,
> security patches will only install on SSE2 or higher
> computing devices. This change only affects a small #
> of users on 15-20 year old legacy
Change by Ma Lin :
--
versions: +Python 3.8 -Python 3.6
___
Python tracker
<https://bugs.python.org/issue25361>
___
___
Python-bugs-list mailing list
Unsub
Change by Ma Lin :
--
pull_requests: +12393
___
Python tracker
<https://bugs.python.org/issue25361>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Ma Lin :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue36357>
___
___
Python-bugs-list
Ma Lin added the comment:
I guess PR12427 is mature enough for review, I have been working on it these
days.
You may review these commits one by one, commit message is review guide.
https://github.com/python/cpython/pull/12427/commits
Maybe you will need two or three days to understand
Change by Ma Lin :
--
pull_requests: +12381
___
Python tracker
<https://bugs.python.org/issue35859>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Ma Lin :
On windows, it seems 32bit builds (3.7.2/3.8.0a2) don't using SSE2 sufficiently.
I test on 3.8 branch, python38.dll only uses XMM register 28 times. The
official build is the same.
After enable this option, python38.dll uses XMM register 11,704 times
Ma Lin added the comment:
> Could you please create and run some microbenchmarks to measure
> possible performance penalty of additional MARH_PUSHes? I am
> especially interesting in worst cases.
Besides the worst case, I prepared two solutions.
Solution_A (PR12288):
Fix the bugs, I
Change by Ma Lin :
Added file: https://bugs.python.org/file48204/t.py
___
Python tracker
<https://bugs.python.org/issue35859>
___
___
Python-bugs-list mailing list
Unsub
Change by Ma Lin :
--
pull_requests: +12271
___
Python tracker
<https://bugs.python.org/issue35859>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Ma Lin :
--
pull_requests: +12270
___
Python tracker
<https://bugs.python.org/issue35859>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Ma Lin :
--
pull_requests: +12269
___
Python tracker
<https://bugs.python.org/issue35859>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ma Lin added the comment:
PR11926 (closed) tried to allocate SRE_REPEAT on state's stack.
It's feasible, but messes up the code in sre_lib.h, and reduces performance a
little (roughly 6% slower), so I gave up this solution.
PR12160 uses a memory pool, this solution doesn't mess up the code
Change by Ma Lin :
--
pull_requests: +12158
___
Python tracker
<https://bugs.python.org/issue23689>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ma Lin added the comment:
Found another bug in re:
>>> re.match(r'(?:.*?\b(?=(\t)|(x))x)*', 'a\txa\tx').groups()
('\t', 'x')
Expected result: (None, 'x')
PHP 7.3.2 NULL, "x"
Java 11.0.2 "\t", "x"
Perl 5.28.1 "\
Ma Lin added the comment:
Just remind, the pattern r'"{1}', is same as r'"', means " repeats 1 time.
----------
nosy: +Ma Lin
___
Python tracker
<https://bugs.pyt
Change by Ma Lin :
--
pull_requests: +12137
___
Python tracker
<https://bugs.python.org/issue35859>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ma Lin added the comment:
The PR11756 is prepared.
I force-pushed the patch in four steps, hope you can review it easier:
https://github.com/python/cpython/pull/11756/commits
Step 1, test-cases
Show the wrong behaviors before this fix, the corresponding test-case will be
updated in next
Ma Lin added the comment:
only 3.8 branch has those non-ascii characters.
--
versions: -Python 3.7
___
Python tracker
<https://bugs.python.org/issue36
Change by Ma Lin :
--
keywords: +patch
pull_requests: +12049
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36101>
___
___
Python-
New submission from Ma Lin :
replace ’(\u2019) with '(\x27)
--
assignee: docs@python
components: Documentation
messages: 336468
nosy: Ma Lin, docs@python
priority: normal
severity: normal
status: open
title: remove non-ascii characters in docstring
versions: Python 3.7, Python 3.8
Ma Lin added the comment:
A bug harvest, see PR11756, maybe sre has more bugs.
Those bug exist since Python 2.
Any ideas from regular expression experts?
--
___
Python tracker
<https://bugs.python.org/issue35
Ma Lin added the comment:
Try to allocate SRE_REPEAT on state's stack, the performance has not changed
significantly.
It passes the other tests, except this one (test_stack_overflow):
https://github.com/python/cpython/blob/v3.8.0a1/Lib/test/test_re.py#L1225-L1230
I'll try to fix issue35859
Change by Ma Lin :
--
pull_requests: +11951
___
Python tracker
<https://bugs.python.org/issue23689>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Ma Lin :
--
nosy: +Ma Lin
___
Python tracker
<https://bugs.python.org/issue33376>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Ma Lin added the comment:
For a capture group, state->mark[] array stores it's begin and end:
begin: state->mark[(group_number-1)*2]
end: state->mark[(group_number-1)*2+1]
So state->mark[0] is the begin of the first capture group.
state->mark[1] is the end of the firs
Change by Ma Lin :
--
keywords: +patch, patch, patch
pull_requests: +11699, 11700, 11701
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Ma Lin :
--
keywords: +patch, patch
pull_requests: +11699, 11700
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Ma Lin :
--
keywords: +patch
pull_requests: +11699
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35859>
___
___
Python-
Ma Lin added the comment:
You can `#define VERBOSE` in file `_sre.c`, it will print the engine's actual
actions:
|02FAC684|02FC7402|MARK 0
...
|02FAC6BC|02FC7401|MARK 1
In my computer, 02FC7400 points to "ab", 02FC7401 points 'b' in "ab", 02FC7402
points to the end of
Change by Ma Lin :
--
nosy: +Ma Lin
___
Python tracker
<https://bugs.python.org/issue35859>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Ma Lin added the comment:
Hi, thanks for your replies.
To be honest, the reason is I fell it's a bit ugly, this line is very long at
REPL startup. And the information is not very clear [1].
I'm not strongly pushing this idea, just raise my feeling, keep it easy. :)
Yes, after
Ma Lin added the comment:
Original post's bug was introduced in Python 3.7.0
When investigate the code, I found another bug about capturing groups. This bug
exists since very early version.
regex module doesn't have this bug.
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v
Ma Lin added the comment:
Serhiy Storchaka lost his sight.
Please stop any work and rest, because your left eye will have more burden, and
your mental burden will make it worse.
Go to hospital ASAP.
If any other core developer want to review this patch, I would like to give a
detailed
Ma Lin added the comment:
It's interesting to see the a Python 1.5.2 from April 1999 :)
Thanks for your opinion, let me explain:
We only print simplified message in official binary release, any Linux/private
builds still using the current message. We know enough information about
official
New submission from Ma Lin :
The current version message in REPL is too complicate for official release.
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license"
Ma Lin added the comment:
I tried to fix it, feel free to create a new PR if you don't want this one.
PR11546 has a small question, should `state->data_stack` be dealloced as well?
FYI, function `state_reset(SRE_STATE* state)` in file `_sre.c`:
https://github.com/python/cpython/b
Change by Ma Lin :
--
keywords: +patch, patch, patch
pull_requests: +11162, 11163, 11164
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Ma Lin :
--
keywords: +patch
pull_requests: +11162
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34294>
___
___
Python-
Change by Ma Lin :
--
keywords: +patch, patch
pull_requests: +11162, 11163
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Ma Lin added the comment:
Simplify the test-case, it seem the `state` is not reset properly.
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47)
>>> import re
>>> re.findall(r"(?=(<\w+>)(<\w+>)?)", "")
[('', ''), ('', '')]
Python 3.
Change by Ma Lin :
--
keywords: +patch, patch, patch
pull_requests: +10974, 10975, 10976
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Ma Lin :
--
keywords: +patch, patch
pull_requests: +10974, 10975
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Ma Lin :
--
keywords: +patch
pull_requests: +10974
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35696>
___
___
Python-
New submission from Ma Lin :
static int
long_compare(PyLongObject *a, PyLongObject *b)
{
}
This function in /Objects/longobject.c is used to compare two PyLongObject's
value.
We only need the sign, converting to -1 or +1 is not necessary.
--
messages: 333293
nosy: Ma Lin
Ma Lin added the comment:
One scene is caching regular expresses, b'[a-z]', '[a-z]' may exist in the same
dict. Any way, it's trivial on the whole.
--
___
Python tracker
<https://bugs.python.org/issue35
Ma Lin added the comment:
> I'd advise against changing the hash function without a very good reason. You
> never know how much code relies on it in one way or another.
ok, maybe this can be changed in Python 4.0
--
___
Python tracker
Ma Lin added the comment:
Thanks for review.
Don't know why bytes and str generates the same hash value for ASCII sequence.
>>> hash('abc') == hash(b'abc')
True
This may brings some hash collisions, does it affect performance
Ma Lin added the comment:
please read this discussion
https://bugs.python.org/issue17252
behavior in Python 3.2- is correct for Turkish users.
behavior in Python 3.3+ is correct for non-Turkish users.
--
nosy: +Ma Lin
___
Python tracker
<ht
Ma Lin added the comment:
This redundant exists since Python 3.4 or earlier.
--
title: remove redundant code in unicode_hash(PyObject *self) -> remove
redundant check in unicode_hash(PyObject *self)
type: enhancement -> performance
versions: +Python 3.4, Pyth
Change by Ma Lin :
--
versions: +Python 3.6, Python 3.7
___
Python tracker
<https://bugs.python.org/issue35636>
___
___
Python-bugs-list mailing list
Unsub
Ma Lin added the comment:
Every non-empty str will be checked twice at present.
--
components: +Interpreter Core
type: -> enhancement
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/issu
Change by Ma Lin :
--
keywords: +patch, patch, patch
pull_requests: +10783, 10784, 10785
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Ma Lin :
--
keywords: +patch
pull_requests: +10783
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35636>
___
___
Python-
Change by Ma Lin :
--
keywords: +patch, patch
pull_requests: +10783, 10784
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
New submission from Ma Lin :
Please see the PR
--
messages: 332857
nosy: Ma Lin
priority: normal
severity: normal
status: open
title: remove redundant code in unicode_hash(PyObject *self)
___
Python tracker
<https://bugs.python.org/issue35
Ma Lin added the comment:
I solved this thoroughly: Format disk C: and install a clean Windows 10.
Don't forget to backup important files in C:\Users\\ folder.
--
___
Python tracker
<https://bugs.python.org/issue35
Ma Lin added the comment:
comes from html.escape(s, quote=True)
https://github.com/python/cpython/blob/4a9ee26750aa8cb37b5072b2bb4dd328819febb4/Lib/html/__init__.py#L24
Of course, it's not a bug.
It would be better to patch in Sphinx, I will do it at some point
Ma Lin added the comment:
amazing, you did find it.
--
___
Python tracker
<https://bugs.python.org/issue35482>
___
___
Python-bugs-list mailing list
Unsub
Ma Lin added the comment:
> I guess the next step is to try taking out those new index entries to figure
> out which one causes the problem.
Very big amount of work..., I would suggest to revert them.
chm is a successful product, but it out of support, and no replacement yet,
Ma Lin added the comment:
These first bad commits come from issue35054
--
___
Python tracker
<https://bugs.python.org/issue35482>
___
___
Python-bugs-list mailin
Ma Lin added the comment:
python368rc1.chm has the same problem.
I did a git bisect.
On 3.6 branch, e825b4e1a9bbe1d4c561f4cbbe6857653ef13a15 is the first bad commit
On 3.7 branch, 9a75b8470a2e0de5406edcabba140f023c99c6a9 is the first bad commit
--
title: python372rc1.chm is ill
Change by Ma Lin :
Added file: https://bugs.python.org/file47991/372rc1_compile_progress.png
___
Python tracker
<https://bugs.python.org/issue35482>
___
___
Python-bug
Change by Ma Lin :
Added file: https://bugs.python.org/file47990/371_compile_progress.png
___
Python tracker
<https://bugs.python.org/issue35482>
___
___
Python-bug
Change by Ma Lin :
Added file: https://bugs.python.org/file47989/372rc1_chm_files.png
___
Python tracker
<https://bugs.python.org/issue35482>
___
___
Python-bugs-list m
New submission from Ma Lin :
python372rc1.chm can't be opened, it seems the compiling is not successful.
Compare to python371.chm, the file size reduced a lot:
python371.chm 8,534,435 bytes
python372rc1.chm 5,766,102 bytes
Some files in chm are missing, see attached pictures
201 - 300 of 394 matches
Mail list logo