[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2017-12-29 Thread Mark Shannon
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

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2017-12-29 Thread Mark Shannon
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

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-01 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +4945 ___ Python tracker <https://bugs.python.org/issue17611> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-01 Thread Mark Shannon
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

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-02 Thread Mark Shannon
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

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-02 Thread Mark Shannon
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

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-02 Thread Mark Shannon
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

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-09 Thread Mark Shannon
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

[issue33996] Crash in gen_send_ex(): _PyErr_GetTopmostException() returns freed memory

2018-07-01 Thread Mark Shannon
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

[issue33996] Crash in gen_send_ex(): _PyErr_GetTopmostException() returns freed memory

2018-07-01 Thread Mark Shannon
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&#

[issue34705] Python 3.8 changes how returns through finally clauses are traced

2018-09-24 Thread Mark Shannon
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

[issue34705] Python 3.8 changes how returns through finally clauses are traced

2018-09-24 Thread Mark Shannon
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

[issue18090] dict_contains first argument declared register, and shouldn't be

2013-05-29 Thread Mark Shannon
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

[issue17206] Py_XDECREF() expands its argument multiple times

2013-06-25 Thread Mark Shannon
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

[issue13903] New shared-keys dictionary implementation

2012-04-23 Thread Mark Shannon
Changes by Mark Shannon : Added file: http://bugs.python.org/file25313/73423916a242.diff ___ Python tracker <http://bugs.python.org/issue13903> ___ ___ Python-bugs-list m

[issue13903] New shared-keys dictionary implementation

2012-04-23 Thread Mark Shannon
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

[issue13903] New shared-keys dictionary implementation

2012-04-23 Thread Mark Shannon
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

[issue13903] New shared-keys dictionary implementation

2012-04-24 Thread Mark Shannon
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

[issue14658] Overwriting dict.__getattr__ is inconsistent

2012-04-24 Thread Mark Shannon
Changes by Mark Shannon : -- nosy: +Mark.Shannon ___ Python tracker <http://bugs.python.org/issue14658> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13903] New shared-keys dictionary implementation

2012-04-24 Thread Mark Shannon
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.

[issue13903] New shared-keys dictionary implementation

2012-04-27 Thread Mark Shannon
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

[issue13903] New shared-keys dictionary implementation

2012-04-30 Thread Mark Shannon
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

[issue14699] Calling a classmethod_descriptor directly raises a TypeError for wrong number of parameters.

2012-04-30 Thread Mark Shannon
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

[issue14699] Calling a classmethod_descriptor directly raises a TypeError for wrong number of parameters.

2012-05-01 Thread Mark Shannon
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

[issue12660] test_gdb fails when installed

2012-05-06 Thread Mark Shannon
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

[issue12370] Use of super overwrites use of __class__ in class namespace

2012-05-27 Thread Mark Shannon
Changes by Mark Shannon : -- nosy: +Mark.Shannon ___ Python tracker <http://bugs.python.org/issue12370> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15055] dictnotes.txt is out of date

2012-06-13 Thread Mark Shannon
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

[issue15055] dictnotes.txt is out of date

2012-06-13 Thread Mark Shannon
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

[issue13783] Clean up PEP 380 C API additions

2012-06-13 Thread Mark Shannon
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

[issue15003] make PyNamespace_New() public

2012-06-24 Thread Mark Shannon
Mark Shannon added the comment: -1 for the reasons Nick stated. -- nosy: +Mark.Shannon ___ Python tracker <http://bugs.python.org/issue15003> ___ ___ Python-bug

[issue15055] dictnotes.txt is out of date

2012-06-24 Thread Mark Shannon
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

[issue15055] dictnotes.txt is out of date

2012-06-24 Thread Mark Shannon
Mark Shannon added the comment: No apology needed :) Thanks. -- ___ Python tracker <http://bugs.python.org/issue15055> ___ ___ Python-bugs-list mailing list Unsub

[issue14241] io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails

2012-07-07 Thread Mark Shannon
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

[issue15301] os.chown: OverflowError: Python int too large to convert to C long

2012-07-13 Thread Mark Shannon
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,

[issue5765] stack overflow evaluating eval("()" * 30000)

2012-08-17 Thread 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 ___

[issue12370] Use of super overwrites use of __class__ in class namespace

2012-10-02 Thread 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

[issue13477] tarfile module should have a command line

2012-10-04 Thread Kyle Shannon
Changes by Kyle Shannon : -- nosy: +kyle ___ Python tracker <http://bugs.python.org/issue13477> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5765] stack overflow evaluating eval("()" * 30000)

2012-11-04 Thread Mark Shannon
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

[issue16676] Segfault under Python 3.3 after PyType_GenericNew

2012-12-14 Thread Mark Shannon
Changes by Mark Shannon : -- nosy: +Mark.Shannon ___ Python tracker <http://bugs.python.org/issue16676> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16956] Allow signed line number deltas in the code object's line number table

2013-01-13 Thread Mark Shannon
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

[issue16956] Allow signed line number deltas in the code object's line number table

2013-01-13 Thread Mark Shannon
Changes by Mark Shannon : -- keywords: +patch Added file: http://bugs.python.org/file28718/dd04caae6647.diff ___ Python tracker <http://bugs.python.org/issue16

[issue16956] Allow signed line number deltas in the code object's line number table

2013-01-15 Thread Mark Shannon
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

[issue19335] codeop misclassifies incomplete code with 'nonlocal'

2013-10-22 Thread Mark Shannon
Changes by Mark Shannon : -- nosy: +Mark.Shannon ___ Python tracker <http://bugs.python.org/issue19335> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22045] Python make issue

2014-07-23 Thread Shannon Kerr
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

[issue22045] Python make issue

2014-07-23 Thread Shannon Kerr
Changes by Shannon Kerr : -- type: -> compile error ___ Python tracker <http://bugs.python.org/issue22045> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue22045] Python make issue

2014-07-23 Thread Shannon Kerr
Changes by Shannon Kerr : -- type: compile error -> behavior ___ Python tracker <http://bugs.python.org/issue22045> ___ ___ Python-bugs-list mailing list Un

[issue22462] Modules/pyexpat.c violates PEP 384

2014-09-22 Thread Mark Shannon
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

[issue22462] Modules/pyexpat.c violates PEP 384

2014-09-22 Thread Mark Shannon
Changes by Mark Shannon : -- nosy: +nedbat ___ Python tracker <http://bugs.python.org/issue22462> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22462] Modules/pyexpat.c violates PEP 384

2014-10-06 Thread Mark Shannon
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

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-16 Thread Mark Shannon
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

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-16 Thread Mark Shannon
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

[issue29051] Improve error reporting involving f-strings (PEP 498)

2017-01-20 Thread Mark Shannon
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

[issue29051] Improve error reporting involving f-strings (PEP 498)

2017-01-20 Thread Mark Shannon
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

[issue27213] Rework CALL_FUNCTION* opcodes

2016-06-19 Thread Mark Shannon
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

[issue17170] string method lookup is too slow

2013-02-28 Thread Mark Shannon
Changes by Mark Shannon : -- nosy: +Mark.Shannon ___ Python tracker <http://bugs.python.org/issue17170> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17563] Excessive resizing of dicts when used as a cache

2013-03-27 Thread Mark Shannon
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

[issue17564] test_urllib2_localnet fails

2013-03-27 Thread Mark Shannon
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

[issue17564] test_urllib2_localnet fails

2013-03-27 Thread Mark Shannon
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

[issue16676] Segfault under Python 3.3 after PyType_GenericNew

2013-03-27 Thread Mark Shannon
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

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-31 Thread Mark Shannon
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

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2013-04-01 Thread Mark Shannon
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

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2013-04-01 Thread Mark Shannon
Changes by Mark Shannon : -- keywords: +patch Added file: http://bugs.python.org/file29646/b16527f84774.diff ___ Python tracker <http://bugs.python.org/issue17

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2013-04-03 Thread Mark Shannon
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

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2013-04-03 Thread Mark Shannon
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

[issue22653] Crash in insertdict

2014-10-16 Thread Mark Shannon
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

[issue22865] Allow pty.spawn to ignore data to copy

2014-11-13 Thread Geoff Shannon
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

[issue22865] Allow pty.spawn to ignore data to copy

2015-01-06 Thread Geoff Shannon
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

[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-02-02 Thread Mark Shannon
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

[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-02-02 Thread Mark Shannon
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

[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-02-02 Thread Mark Shannon
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

[issue22865] Document how to make pty.spawn not copy data

2015-06-07 Thread Geoff Shannon
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

[issue24325] Speedup types.coroutine()

2015-07-03 Thread Mark Shannon
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

[issue24407] Use after free in PyDict_merge

2015-07-04 Thread Mark Shannon
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

[issue24407] Use after free in PyDict_merge

2015-07-04 Thread Mark Shannon
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

[issue24407] Use after free in PyDict_merge

2015-07-04 Thread Mark Shannon
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

[issue24325] Speedup types.coroutine()

2015-07-05 Thread Mark Shannon
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

[issue23601] use small object allocator for dict key storage

2015-07-09 Thread Mark Shannon
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

[issue23601] use small object allocator for dict key storage

2015-07-09 Thread Mark Shannon
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

[issue23601] use small object allocator for dict key storage

2015-07-16 Thread Mark Shannon
Mark Shannon added the comment: +1 from me. -- ___ Python tracker <http://bugs.python.org/issue23601> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24648] Allocation of values array in split dicts should use small object allocator.

2015-07-16 Thread Mark Shannon
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

[issue23601] use small object allocator for dict key storage

2015-07-16 Thread Mark Shannon
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

[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate

2015-07-25 Thread Mark Shannon
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

[issue24667] OrderedDict.popitem()/__str__() raises KeyError

2015-07-25 Thread Mark Shannon
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

[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

2015-07-26 Thread Mark Shannon
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

[issue24721] The result of calling dict.* methods on OrderedDict is undefined.

2015-07-26 Thread Mark Shannon
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

[issue24272] PEP 484 docs

2015-08-03 Thread Mark Shannon
Changes by Mark Shannon : -- nosy: +Mark.Shannon ___ Python tracker <http://bugs.python.org/issue24272> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24912] The type of cached objects is mutable

2015-08-23 Thread Mark Shannon
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

[issue24912] The type of cached objects is mutable

2015-08-26 Thread Mark Shannon
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

[issue24912] The type of cached objects is mutable

2015-08-30 Thread Mark Shannon
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

[issue24912] The type of cached objects is mutable

2015-08-30 Thread Mark Shannon
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

[issue24912] The type of cached objects is mutable

2015-09-01 Thread Mark Shannon
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

[issue24912] The type of cached objects is mutable

2015-09-03 Thread Mark Shannon
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

[issue24912] The type of cached objects is mutable

2015-09-05 Thread Mark Shannon
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

[issue24912] The type of cached objects is mutable

2015-09-05 Thread Mark Shannon
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

[issue24912] The type of cached objects is mutable

2015-09-05 Thread Mark Shannon
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

[issue24912] The type of cached objects is mutable

2015-09-05 Thread Mark Shannon
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 -&

[issue25210] Special-case NoneType() in do_richcompare()

2015-09-22 Thread Mark Shannon
Mark Shannon added the comment: +1 for special casing None. -- nosy: +Mark.Shannon ___ Python tracker <http://bugs.python.org/issue25210> ___ ___ Python-bug

[issue25217] Method cache can crash at shutdown in _PyType_Lookup

2015-09-22 Thread Mark Shannon
Changes by Mark Shannon : -- nosy: +Mark.Shannon ___ Python tracker <http://bugs.python.org/issue25217> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22865] Document how to make pty.spawn not copy data

2015-10-06 Thread Geoff Shannon
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

[issue26276] Inconsistent behaviour of PEP 3101 formatting between versions

2016-02-03 Thread Mark Shannon
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):

<    7   8   9   10   11   12   13   >