Mark Shannon added the comment:
Why all these competing pull requests? It does feel like my original patch has
been hijacked.
Also, before any more PRs, we need to decide whether to use subroutines or code
duplication for finally blocks.
Here is my attempt at an objective comparison of the
Mark Shannon added the comment:
When I said "significant", I meant from a statistically, not as a judgement
meaning "useful" or "worthwhile". The code duplication approach is
significantly faster in the tests. Whether the small speed difference is worth
worryi
Change by Mark Shannon :
--
pull_requests: +4945
___
Python tracker
<https://bugs.python.org/issue17611>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Shannon added the comment:
It shouldn't be a surprise that I have submitted a PR. The original patch was
my work and a month ago I said I would update it over the Christmas break.
To avoid "competing" PRs in future, simply asking before appropriating other
peoples work w
Mark Shannon added the comment:
On 01/01/18 17:54, Antoine Pitrou wrote:
>
> Antoine Pitrou added the comment:
>
> I took a quick look at Mark's PR. The main thing going for it IMHO is that
> it produces simpler bytecode: it removes the complicated with/finally-relat
Mark Shannon added the comment:
I've added a commit to compute the stack size.
It should compute the exact stack size in all cases, and thus fix bpo-24340.
--
___
Python tracker
<https://bugs.python.org/is
Mark Shannon added the comment:
> It looks like the build core dumped on Travis-CI
I failed to account for the extra stuff left on the stack when handling
exceptions and jumping out of a finally block due to a `break`. Caught by
Serhiy's tests in https://github.com/python/cpython/p
Mark Shannon added the comment:
Can we stick to the one PR, please?
Once it is merged then we can improve things.
Also, I don't like leaving NULLs on the stack, they are an invitation to
seg-fault. PR 5143 leaves more NULLs on the stack for l
Mark Shannon added the comment:
Strange.
I could only reproduce this intermittently with 3.7 build.
But with a debug build, I cannot reproduce this at all.
Rebuilding Python (optimised, but without PGO) I cannot reproduce at all now.
--
___
Python
Mark Shannon added the comment:
This looks like a Greenlet bug to me.
Possibly
https://github.com/python-greenlet/greenlet/commit/780a12b51fcef9adcc4f2c9a4cc5b05c2d652ba4
is incomplete.
It is not clear to me why greenlets hold their own exception state, but I
suspect that if they didn
Mark Shannon added the comment:
The new behaviour looks the more correct to me.
Arguably the sequence should not include the second "4 line", but is otherwise
correct.
--
___
Python tracker
<https://bugs.python.o
Mark Shannon added the comment:
When I get a chance I'll see what happens with
https://github.com/python/cpython/pull/6641
--
___
Python tracker
<https://bugs.python.org/is
Mark Shannon added the comment:
The register qualifier on the parameter does not alter the calling convention,
it determines the storage class of the parameter variable within the function.
Having said that I am all in favour in removing any and all "register"
de
Mark Shannon added the comment:
I think blaming the crash in test_marshall
http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/2009/steps/test/logs/stdio
on the new macros (change aff41a6421c2) is correct.
It may be the proximate cause, but that doesn't make i
Changes by Mark Shannon :
Added file: http://bugs.python.org/file25313/73423916a242.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bugs-list m
Mark Shannon added the comment:
I've updated the repository and uploaded a new patch in response to Benjamin's
review. (And the contributor form is in the post).
One remaining issue is the return value of __sizeof__().
If it is an int, then it cannot accurately reflect the memor
Mark Shannon added the comment:
I fixed it back then, but didn't add the test.
It subsequently regressed.
Should know better.
Patch (with test this time) attached.
--
resolution: fixed ->
status: closed -> open
Added file: http://bugs.python.org/file25318/str_sub
Mark Shannon added the comment:
Failing to maintain GC tracking in setdefault and copy (for split-tables)
Patch attached
--
Added file: http://bugs.python.org/file25339/gc_tracking.patch
___
Python tracker
<http://bugs.python.org/issue13
Changes by Mark Shannon :
--
nosy: +Mark.Shannon
___
Python tracker
<http://bugs.python.org/issue14658>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Shannon added the comment:
Failed to differentiate between failure and error in make_split_table().
Patch attached
--
Added file: http://bugs.python.org/file25340/make_split_table_error.patch
___
Python tracker
<http://bugs.python.
Mark Shannon added the comment:
Decref cached-keys when type is deallocated.
Patch attached.
--
Added file: http://bugs.python.org/file25381/cached_keys.patch
___
Python tracker
<http://bugs.python.org/issue13
Mark Shannon added the comment:
Change insertdict to follow normal (non-stealing) ref-counting behaviour which
fixes possible leakage.
Patch attached.
--
Added file: http://bugs.python.org/file25422/insertdict.patch
___
Python tracker
<h
New submission from Mark Shannon :
classmethod_descriptor should either be uncallable or (better) accept the
correct number of arguments.
The classmethod_descriptor can be regarded as the Python object corresponding
directly to the underlying C function, as well as a descriptor object.
When
Mark Shannon added the comment:
New patch in response to review.
--
Added file: http://bugs.python.org/file25431/classmethoddescr_call.patch
___
Python tracker
<http://bugs.python.org/issue14
Mark Shannon added the comment:
python-gdb.py was modified for the new dictionary implementation.
Can you check that your 3.3 installation isn't using an earlier version of
python-gdb.py?
--
nosy: +Mark.Shannon
___
Python tracker
Changes by Mark Shannon :
--
nosy: +Mark.Shannon
___
Python tracker
<http://bugs.python.org/issue12370>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Mark Shannon :
dictnotes.txt is out of date w.r.t. dictobject.c
Remove notes from dictnotes.txt that duplicate comments in dictobject.c
and ensure comments in dictobject.c cover all aspects of tunable parameters.
Patch attached.
--
assignee: docs@python
components
Mark Shannon added the comment:
Raymond,
I don't think this is the place to discuss the changes to the tunables in
dictobject.c.
This patch merely ensures that dictnotes.txt and the comments in dictobject.c
are in agreement. It doesn't change any code (apart from creating the
G
Mark Shannon added the comment:
There is one call to PyGen_FetchStopIterationValue in ceval.c.
But I don't think it should be public.
There is no real reason for the "Gen" in the name. The function is used by
generator handling code, but the code itself relates to StopIterat
Mark Shannon added the comment:
-1 for the reasons Nick stated.
--
nosy: +Mark.Shannon
___
Python tracker
<http://bugs.python.org/issue15003>
___
___
Python-bug
Mark Shannon added the comment:
Is there any reason not to commit this patch?
The docs are out of sync with the code and need to be updated.
--
___
Python tracker
<http://bugs.python.org/issue15
Mark Shannon added the comment:
No apology needed :)
Thanks.
--
___
Python tracker
<http://bugs.python.org/issue15055>
___
___
Python-bugs-list mailing list
Unsub
Mark Shannon added the comment:
>>> io.UnsupportedOperation.__new__(io.UnsupportedOperation)
behaves correctly now (rev d9c98730e2e8)
This bug was (I believe) caused somehow by an error in OSError_new() which did
not initialize self->args if OSError_init() was not called.
Her
Mark Shannon added the comment:
Larry, you're the expert on this.
Looks to me like the format character in PyArg_ParseTuple in posix_fchown and
kin should be 'k' (unsigned long) rather than 'l' (signed long).
--
nosy: +Mark.Shannon,
Mark Shannon added the comment:
I've re-reviewed Andrea's patch (I was looking over Andrea's shoulder at the
EuroPython sprint when he wrote it).
It looks good and applies cleanly.
Could someone commit it please.
--
nosy: +Mark.Shannon
___
Mark Shannon added the comment:
There seems to be an ongoing confusion about scopes on this thread.
The __class__ variable used by super() is a non-local variable in the scope of
any function using super(), whereas the __class__ used to define the type of an
object is a class attribute like
Changes by Kyle Shannon :
--
nosy: +kyle
___
Python tracker
<http://bugs.python.org/issue13477>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Shannon added the comment:
I don't think there is any need for a scaling factor.
Expressions in auto-generated trees will tend to be trees of binary operator
rather lists of purely unary operators. A tree of a billion items only has a
depth of ~30.
There is no way an expression
Changes by Mark Shannon :
--
nosy: +Mark.Shannon
___
Python tracker
<http://bugs.python.org/issue16676>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Mark Shannon:
The restriction that line numbers must be monotonically increasing w.r.t
bytecode offset in the co_lnotab array prevents a number of beneficial
transformations in the bytecode compiler.
This patch allows negative line number deltas and uses this capability to
Changes by Mark Shannon :
--
keywords: +patch
Added file: http://bugs.python.org/file28718/dd04caae6647.diff
___
Python tracker
<http://bugs.python.org/issue16
Mark Shannon added the comment:
The interaction between bdb/pdb and the line number table is via the
frame.f_lineno attribute.
Allowing signed offsets changes the one-to-one line muber => bytecode offset
relation into a one-to-many relation.
Reading frame.f_lineno is not an issue as e
Changes by Mark Shannon :
--
nosy: +Mark.Shannon
___
Python tracker
<http://bugs.python.org/issue19335>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Shannon Kerr:
If you execute the following commands on a system that doesn’t already have
Python 2.7.X installed on it, it will result in bloated libs that statically
link libpythyon2.7.a instead of the locally built libpython2.7.so:
./configure
make
sudo make install
Changes by Shannon Kerr :
--
type: -> compile error
___
Python tracker
<http://bugs.python.org/issue22045>
___
___
Python-bugs-list mailing list
Unsubscrib
Changes by Shannon Kerr :
--
type: compile error -> behavior
___
Python tracker
<http://bugs.python.org/issue22045>
___
___
Python-bugs-list mailing list
Un
New submission from Mark Shannon:
Modules/pyexpat.c includes some archaic code to create temporary frames
so that, in even of an exception being raised, expat appears in the traceback.
The way this is implemented is a problem for three reasons:
1. It violates PEP 384.
2. It is incorrect, see
Changes by Mark Shannon :
--
nosy: +nedbat
___
Python tracker
<http://bugs.python.org/issue22462>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Shannon added the comment:
W.r.t PEP 384:
Every module, except pyexpat, in the stdlib library treats frames as opaque
objects, as PEP 384 requires.
(I'm exempting builtins and sys here)
I think it is unreasonable to expect authors of 3rd party modules to respect
PEP 384 if the sta
Mark Shannon added the comment:
Well spotted.
I don't think that the line
COPYVAL(tp_dictoffset);
should be removed.
inherit_special() is called from PyType_Ready
which is used to initialise static TypeObjects.
So builtin class B which doesn't set tp_dictoffset,
but has builtin clas
Mark Shannon added the comment:
This looks good to me.
Also, I think this should go into 3.4
It is a tiny patch and could result in significant memory saving for OO
programs with inheritance (e.g. Django)
--
___
Python tracker
<h
Mark Shannon added the comment:
This problem is the parsing of f-strings.
The expressions in an f-string are not "eval"ed in the sense of the eval()
function. They are evaluated exactly the same as any other Python expression.
However the parsing of f-strings does not provide co
Mark Shannon added the comment:
It is also worth mentioning that incorrect line numbers means that tools like
pyflakes, pylint, mypy, lgtm, etc, need to reimplement parsing of f-strings.
--
___
Python tracker
<http://bugs.python.org/issue29
Mark Shannon added the comment:
I seemed to have been added to the nosy list. I guess that means that my
opinions are wanted ;)
I have wanted to clean up the code around making calls for quite a while. I
just haven't had time.
I agree that adding a simpler opcode for making calls
Changes by Mark Shannon :
--
nosy: +Mark.Shannon
___
Python tracker
<http://bugs.python.org/issue17170>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Mark Shannon:
If a dict is used a cache, e.g. in functools.lru_cache,
the reduced resize factor in 3.3 can cause excessive resizing.
This can lead to a significant performance regression.
When the the number of deletions and insertions is roughly in balance
the reduced head
New submission from Mark Shannon:
The test_urllib2_localnet test fails when run with a clean build from a clean
checkout.
Machine:
Ubuntu 12.04 LTS, 64 bit
Intel i3-2370M CPU @ 2.40GHz × 4
Test output:
$ ./python -m test -v test_urllib2_localnet
== CPython 3.4.0a0 (default:53cc3dbb1918
Mark Shannon added the comment:
Bah, stupid BT :(
I opened the URL in my browser and got a "helpful" message telling me "Sorry,
the website sadflkjsasf.i.nvali.d. cannot be found"
Perhaps we should just remove this test?
I suspect this is only going t
Mark Shannon added the comment:
This issue should be considered closed.
PyType_GenericNew is a convenience function for typeobjects to put in their
tp_new slots. Calling it directly only works for some types.
It worked in 3.2 for dict, but that was happenstance.
You could use
((PyTypeObject
Mark Shannon added the comment:
Mark, it was written 20 years ago. Who knows (or cares) why it was written that
way?
Let's just write it correctly this time.
Py_INCREF, Py_DECREF, Py_XDECREF and Py_XINCREF should all expand their
argument exactly once.
Py_CLEAR should expand its arg
New submission from Mark Shannon:
The handling of "pseudo exceptions" (return, break and continue) are currently
handled in the interpreter. This make the interpreter loop more complex and
slower than it needs to be. This change moves the handling of pseudo exceptions
into the compi
Changes by Mark Shannon :
--
keywords: +patch
Added file: http://bugs.python.org/file29646/b16527f84774.diff
___
Python tracker
<http://bugs.python.org/issue17
Mark Shannon added the comment:
Stefan,
I tried running your pi_bench (increasing the numer of iterations by x10 to
reduce jitter). The run to run variation exceed the difference between the two
versions. Here are the fastest of 7 runs on my machine.
i3-2370M CPU @ 2.40GHz × 4. linux 64bit
Mark Shannon added the comment:
Antoine,
Two bytecode examples.
For the following function:
>>> def f(x):
... try:
... return x
... except:
... pass
Without the patch:
2 0 SETUP_EXCEPT 8 (to 11)
3 3 LOAD_FAST
Mark Shannon added the comment:
The assertion on line 855
is a duplicate of the assertion on line 821, which is just before the reentrant
DECREF.
The assertion on line 821 appears to be correct.
I don't know why the assertion is at the end of the function rather than
earlier, but hg
New submission from Geoff Shannon:
While using the pty.py module I had cause to want to be able to silently eat
characters from the input stream. I discovered that because of the check for
end of file being "if not data" that there was no way to do this.
Since the default functi
Geoff Shannon added the comment:
I tweaked the patch a bit to not include the parentheses since that seems to be
the style here.
--
Added file: http://bugs.python.org/file37620/pty.patch
___
Python tracker
<http://bugs.python.org/issue22
Mark Shannon added the comment:
This is caused by https://hg.python.org/cpython/rev/7c5c678e4164/
which is a supposed fix for http://bugs.python.org/issue16795
which claims to make "some changes to AST to make it more useful for static
language analysis", seemingly by breaking al
Mark Shannon added the comment:
It is now very hard to determine accurate locations for an expression such as
(x+y).attr as the column offset of leftmost subexpression of the expression is
not the same as the column offset of the location
Mark Shannon added the comment:
This also breaks the col_offset for subscripts like x[y] and, of course any
statement with one of these expressions as its leftmost sub-expression.
--
___
Python tracker
<http://bugs.python.org/issue21
Geoff Shannon added the comment:
Hey, pinging this issue. Hoping someone has time to take a look at it.
--
___
Python tracker
<http://bugs.python.org/issue22
Mark Shannon added the comment:
Does this have a measurable performance impact?
I'd be surprised if it did.
W.r.t. to profiling, the undecorated form will never be visible to any code
other than the decorator, so won't show up in the profiler.
--
nosy: +Ma
Mark Shannon added the comment:
The tracker won't let me assign this to myself.
Consider it assigned.
--
nosy: +Mark.Shannon
___
Python tracker
<http://bugs.python.org/is
Mark Shannon added the comment:
There are two parts to this fix.
First, we raise a runtime exception if the other dict is modified during the
update/merge.
Second, refcounts must be incremented around the PyDict_GetItem and insertdict
calls in case the key or value is otherwise deallocated
Mark Shannon added the comment:
If the tracker had let me assign the issue, you need not have wasted your time.
Oh well.
Indeed, your patch looks very similar to mine.
--
___
Python tracker
<http://bugs.python.org/issue24
Mark Shannon added the comment:
If type.coroutine is not the first and only decorator, then things may be even
worse.
Code objects are currently immutable.
This change would mean that a call to types.coroutine in one place in the code
would change the semantics of another piece of code in a
Mark Shannon added the comment:
I still think that this is a good idea, but I would like to see a small speed
test for large objects. Just to be sure that it is no slower.
--
___
Python tracker
<http://bugs.python.org/issue23
Mark Shannon added the comment:
Indeed there is no *obvious* reason why they should be slower.
But when it comes to optimisation, *never* trust your (or anyone else's)
intuition.
Running a simple check is always worth the effort.
--
___
P
Mark Shannon added the comment:
+1 from me.
--
___
Python tracker
<http://bugs.python.org/issue23601>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Mark Shannon:
Issue 23601 advocates using the small object allocator for dict-keys objects
and the results of tests are good.
Using the small object allocator for dict value-arrays as well seems like the
obvious next step.
--
components: Interpreter Core
keywords
Mark Shannon added the comment:
Yes, but that shouldn't block this issue.
I've opened issue 24648 instead.
--
___
Python tracker
<http://bugs.python.o
Mark Shannon added the comment:
Updated patch to support exception chaining and to merge cleanly.
--
versions: +Python 3.6 -Python 3.4
Added file: http://bugs.python.org/file40015/exc_info3.patch
___
Python tracker
<http://bugs.python.org/issue13
Mark Shannon added the comment:
The attached test case raises a KeyError for __str__()
--
nosy: +Mark.Shannon
Added file: http://bugs.python.org/file40019/test.py
___
Python tracker
<http://bugs.python.org/issue24
New submission from Mark Shannon:
Setting an item in an ordered dict via dict.__setitem__, or by using it as an
object dictionary and setting an attribute on that object, creates a dictionary
whose repr is:
OrderedDict([])
Test case attached.
--
components: Library (Lib)
files
Mark Shannon added the comment:
I think this is a bug. This is not a normal case of subclassing as the
interpreter calls the C API PyDict_XXX() in many cases where a dictionary
subclass is passed in.
For example:
class C: pass
c = C()
# Liskov substitution principle says this is OK.
c
Changes by Mark Shannon :
--
nosy: +Mark.Shannon
___
Python tracker
<http://bugs.python.org/issue24272>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Shannon added the comment:
If there is another issue for this, then it doesn't seem to be a release
blocker. I think it should be.
--
nosy: +Mark.Shannon
___
Python tracker
<http://bugs.python.org/is
Mark Shannon added the comment:
Eek! indeed :)
I intend to track down the cause of this on Monday, and hopefully come up with
a fix, unless anyone beats me to it.
Does anyone know if there is another issue for this?
--
___
Python tracker
<h
Mark Shannon added the comment:
Please revert c0d25de5919e.
Breaking the interpreter in order to facilitate some obscure use case is
unacceptable.
If you want to do fancy stuff with modules, fine. Take a look at the source of
the six module
https://bitbucket.org/gutworth/six/src
Mark Shannon added the comment:
Nathaniel, I'm hostile to this patch remaining in the code base.
I'm not hostile to you, sorry that I came across as that way.
The proper way to deal with issues like this is to revert the change and then
create a new patch, otherwise it becomes imp
Mark Shannon added the comment:
I think Nathaniel and Eugene argument that you cannot replace the module in
sys.modules safely in erroneous.
Immediately after the module is created by importlib it is inserted into
sys.modules. The code object for the module is then executed.
At that point
Mark Shannon added the comment:
Larry, of the two choices, I prefer rolling back the change entirely.
I would like to see the bug fixes for typeobject.c applied, but I see no reason
why making the __class__ of module objects assignable should be included
Mark Shannon added the comment:
Why has the change allowing the __class__ attribute of modules been merged?
It is not necessary (as I have stated repeatedly) and not known to be safe.
--
___
Python tracker
<http://bugs.python.org/issue24
Mark Shannon added the comment:
Well, there are important reasons why not to make the __class__ attribute of
modules mutable.
First of all, there is no valid rationale.
How do know for sure that modifying the class of the sys or builtins module is
not going to cause much the same problems
Mark Shannon added the comment:
Oh, and has anyone considered the potential impact this might have on Jython or
PyPy? Modules are quite fundamental to the way that Python works.
--
___
Python tracker
<http://bugs.python.org/issue24
Mark Shannon added the comment:
Guido,
I just think this change is misguided. The original rationale for the change
just doesn't hold water.
If you want the change anyway, then fine, but this seems an odd way to
introduce it.
--
status: closed -&
Mark Shannon added the comment:
+1 for special casing None.
--
nosy: +Mark.Shannon
___
Python tracker
<http://bugs.python.org/issue25210>
___
___
Python-bug
Changes by Mark Shannon :
--
nosy: +Mark.Shannon
___
Python tracker
<http://bugs.python.org/issue25217>
___
___
Python-bugs-list mailing list
Unsubscribe:
Geoff Shannon added the comment:
Hmm, I spoke improperly. I think you are entirely correct in your statements.
What I meant by "terminals ignore null bytes" is that returning a string
consisting of only a null byte doesn't cause anything observable to happen,
including
New submission from Mark Shannon:
In Python 2.7.6 and 3.2.3:
>>> "{ {{ 0} }}".format(**{' {{ 0} }': 'X'})
'X'
In Python 3.4.3:
>>> "{ {{ 0} }}".format(**{' {{ 0} }': 'X'})
Traceback (most recent call last):
1101 - 1200 of 1219 matches
Mail list logo