[issue22631] Feature Request CAN_RAW_FD_FRAMES

2015-04-13 Thread Joe Jevnik
Joe Jevnik added the comment: I am not going to be able to write docs on this because I am not totally sure how you would use this; There is an entry in the docs for CAN_* so that might be enough. I have a line now saying that this particular flag is available as of 3.5 though

[issue5438] test_bigmem.test_from_2G_generator uses more memory than expected

2015-04-13 Thread Joe Jevnik
Joe Jevnik added the comment: I am now computing the size based on the system's int and pointer size. -- keywords: +patch nosy: +ll Added file: http://bugs.python.org/file38945/bigmem.patch ___ Python tracker rep...@bugs.python.org http

[issue23910] C implementation of namedtuple (WIP)

2015-04-11 Thread Joe Jevnik
Joe Jevnik added the comment: I stripped down the patch to only the descriptor like we had discussed. -- Added file: http://bugs.python.org/file38896/namedtuple.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23910

[issue22631] Feature Request CAN_RAW_FD_FRAMES

2015-04-13 Thread Joe Jevnik
Joe Jevnik added the comment: I tried to provide a summary of the Linux page on the topic and then said that it was fully documented there. -- Added file: http://bugs.python.org/file38957/CAN_RAW_FD_FRAMES-doc.patch ___ Python tracker rep

[issue5438] test_bigmem.test_from_2G_generator uses more memory than expected

2015-04-13 Thread Joe Jevnik
Joe Jevnik added the comment: I have updated the test to make another test that does not have a __len__. -- Added file: http://bugs.python.org/file38952/bigmem-update.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5438

[issue23926] skipitem() in getargs.c still supports 'w' and 'w#', and shouldn't

2015-04-13 Thread Joe Jevnik
Joe Jevnik added the comment: here is a patch and test case. I added an entry to Misc/NEWS. I tried to follow the format; however, let me know if I have done this incorrectly. -- keywords: +patch nosy: +ll Added file: http://bugs.python.org/file38972/skipitems.patch

[issue22631] Feature Request CAN_RAW_FD_FRAMES

2015-04-13 Thread Joe Jevnik
Joe Jevnik added the comment: So I think the patch could be applied to 3.4; I will look into moving the other back sometime this week. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22631

[issue5438] test_bigmem.test_from_2G_generator uses more memory than expected

2015-04-13 Thread Joe Jevnik
Joe Jevnik added the comment: Steve, we talked about the possibility of having you run some of these tests on a machine with a large amount of ram; I am adding you to the nosy list. -- nosy: +steve.dower ___ Python tracker rep...@bugs.python.org

[issue5438] test_bigmem.test_from_2G_generator uses more memory than expected

2015-04-14 Thread Joe Jevnik
Joe Jevnik added the comment: I am not sure yet; I don't have access to a machine that can run the test. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5438

[issue5438] test_bigmem.test_from_2G_generator uses more memory than expected

2015-04-14 Thread Joe Jevnik
Joe Jevnik added the comment: The tests need to be run with higher memory caps, this can be set with the -M flag, like python -m test -M 64G test_bigmem. I am under the impression that these tests don't get run all the time so we might want to run that suite

[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Joe Jevnik
New submission from Joe Jevnik: There are a lot of optimizations that are being missed by only running a single pass of PyCode_Optimize. I originally started by trying to optimize for De Morgan's Laws in if tests; however, I realized that the issue actually went away if you run the optimizer

[issue23910] C implementation of namedtuple (WIP)

2015-04-26 Thread Joe Jevnik
Joe Jevnik added the comment: I was unable to see a performance increase by playing with the itemgetter.__call__ code; however, updating the propery code seemed to show a small improvement. I think that for simple indexing the cost of checking if it is a sequence outways the faster dispatch

[issue23910] C implementation of namedtuple (WIP)

2015-04-26 Thread Joe Jevnik
Joe Jevnik added the comment: This was very exciting, I have never run gprof before; so just to make sure I did this correctly, I will list my steps: 1. compile with the -pg flag set 1. run the test with ./python -m timeit ... 1. $ gprof python gmon.out profile.out Here is default: Each

[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Joe Jevnik
Joe Jevnik added the comment: I tried bumping the magic number; however, I still cannot get consistent results when running benchmark locally. I guess I will close this as I cannot consistently show an improvement. -- status: open - closed

[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Joe Jevnik
Joe Jevnik added the comment: I am actually getting inconsistent results from running benchmark; I am pretty surprised by this. I could look into making the second pass only happen if the code has the CO_OPTIMIZED bit set; however, based on the results I am seeing from the benchmark runs, I

[issue23990] Callable builtin doesn't respect descriptors

2015-04-19 Thread Joe Jevnik
Joe Jevnik added the comment: This is a different case from raising an AttributeError inside the __call__; class C(object): ... def __call__(self): ... raise AttributeError() ... hasattr(C(), '__call__') True class D(object): ... @property ... def __call__(self

[issue23910] property_descr_get reuse argument tuple

2015-04-29 Thread Joe Jevnik
Joe Jevnik added the comment: I don't think that we need to worry about reusing the single argument tuple in a recursive situation because we never need the value after we start the call. We also just write our new value and then clean up with a NULL to make sure that we don't blow up when we

[issue23910] C implementation of namedtuple (WIP)

2015-04-27 Thread Joe Jevnik
Joe Jevnik added the comment: I switched to the static tuple. -- Added file: http://bugs.python.org/file39216/with-static-tuple.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23910

[issue23910] C implementation of namedtuple (WIP)

2015-04-27 Thread Joe Jevnik
Joe Jevnik added the comment: I don't think that I can cache the __call__ of the fget object because it might be an instance of a heaptype, and if someone changed the __class__ of the object in between calls to another heaptype that had a different __call__, you would still get the __call__

[issue23910] C implementation of namedtuple (WIP)

2015-04-27 Thread Joe Jevnik
Joe Jevnik added the comment: I am currently on a different machine so these numbers are not relative to the others posted earlier. * default ./python -m timeit -s from collections import namedtuple as n;a = n('n', 'a b c')(1, 2, 3) a.a 1000 loops, best of 3: 0.0699 usec per loop * patch

[issue5438] test_bigmem.test_from_2G_generator uses more memory than expected

2015-04-14 Thread Joe Jevnik
Joe Jevnik added the comment: Has the test passed or is it still hung? Also, I guess this means that the tuple is over-allocating, maybe I need to revise the memory assumptions to account for the growth algorithm. -- ___ Python tracker rep

[issue5438] test_bigmem.test_from_2G_generator uses more memory than expected

2015-04-14 Thread Joe Jevnik
Joe Jevnik added the comment: I think that the idea is not to get as close to the limit as possible but just to hard cap the memory usage of the test suite so that it doesn't get oom-killed. twouters, does this sound correct? Also, I think that this means that the new decorator is reporting

[issue23910] C implementation of namedtuple (WIP)

2015-04-14 Thread Joe Jevnik
Joe Jevnik added the comment: I am updating the patch to include an entry in Misc/NEWS. -- Added file: http://bugs.python.org/file38994/namedtuple-indexer-with-news.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23910

[issue5438] test_bigmem.test_from_2G_generator uses more memory than expected

2015-04-15 Thread Joe Jevnik
Joe Jevnik added the comment: I can look into rewriting the framework to use multiprocessing; however, should we split this into a separate issue or block this one until that work is done. -- ___ Python tracker rep...@bugs.python.org http

[issue22189] collections.UserString missing some str methods

2015-04-15 Thread Joe Jevnik
Joe Jevnik added the comment: I have added a patch to add these to UserString. I also wrote a test case that would check the UserString, UserList, and UserDict's methods to make sure that new methods to str, list, or dict (or the removal of one of those methods from the User* version

[issue22631] Feature Request CAN_RAW_FD_FRAMES

2015-04-13 Thread Joe Jevnik
Joe Jevnik added the comment: I have added a patch to update this with conditional compilation. -- keywords: +patch nosy: +ll Added file: http://bugs.python.org/file38934/CAN_RAW_FD_FRAMES.patch ___ Python tracker rep...@bugs.python.org http

[issue22631] Feature Request CAN_RAW_FD_FRAMES

2015-04-13 Thread Joe Jevnik
Joe Jevnik added the comment: To show where I got my sources: https://github.com/torvalds/linux/commit/e2d265d3b587f5f6f8febc0222aace93302ff0be There does not appear to be any new structures needed other than supporting the constant. -- nosy: +larry

[issue23910] C implementation of namedtuple (WIP)

2015-04-12 Thread Joe Jevnik
Joe Jevnik added the comment: sorry, I meant pypy -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23910 ___ ___ Python-bugs-list mailing list

[issue23910] C implementation of namedtuple (WIP)

2015-04-12 Thread Joe Jevnik
Joe Jevnik added the comment: # Original version / new python implementation ./python -m timeit -s from collections import namedtuple;a = namedtuple('a', 'a b c')(1, 2, 3) a.a 1000 loops, best of 3: 0.07 usec per loop # C implementation ./python -m timeit -s from collections import

[issue23990] Callable builtin doesn't respect descriptors

2015-04-17 Thread Joe Jevnik
Changes by Joe Jevnik j...@quantopian.com: -- nosy: +ll ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list

[issue23990] Callable builtin doesn't respect descriptors

2015-04-17 Thread Joe Jevnik
Joe Jevnik added the comment: I am also confused by this; I would imagine that callable(obj) would respect the descriptor protocol. I have a proposed patch that would make this work with descriptors. -- keywords: +patch Added file: http://bugs.python.org/file39090/callable.diff

[issue23990] Callable builtin doesn't respect descriptors

2015-04-17 Thread Joe Jevnik
Changes by Joe Jevnik j...@quantopian.com: Removed file: http://bugs.python.org/file39090/callable.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990

[issue23990] Callable builtin doesn't respect descriptors

2015-04-17 Thread Joe Jevnik
Joe Jevnik added the comment: Oops, I messed up the test case; here is a fixed version (the class name was wrong). Just a note: all the existing test cases passed AND the one proposed in this thread. I understand that it is currently working as intended; however, the argument

[issue23990] Callable builtin doesn't respect descriptors

2015-04-17 Thread Joe Jevnik
Joe Jevnik added the comment: I don't think that using a property to define a callable in the class is a bug; while it seems less ideal, I don't understand why it would be unsupported with callable when it executes correctly. -- ___ Python tracker

[issue23990] Callable builtin doesn't respect descriptors

2015-04-17 Thread Joe Jevnik
Joe Jevnik added the comment: As ionelmc mentioned, it does address the issue proposed originally and in the patch this is added as another test case for the callable function -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue23990] Callable builtin doesn't respect descriptors

2015-04-17 Thread Joe Jevnik
Joe Jevnik added the comment: I don't see how it is a bug that you can make __call__ an arbitrary descriptor as long as it returns a valid callable. if n.__call__ is a valid callable, why should it matter that it was looked up as a descriptor or as an instancemethod? -- type

[issue23990] Callable builtin doesn't respect descriptors

2015-04-17 Thread Joe Jevnik
Joe Jevnik added the comment: The purpose of callable is to report whether an instance is callable or not I am totally with you so far until you get to: and that information is available on the instance's class, via the presence of __call__. I don't understand why this assumption must be made

[issue23910] C implementation of namedtuple (WIP)

2015-04-10 Thread Joe Jevnik
New submission from Joe Jevnik: I am working on implementing nameduple in C; I am almost there; however, on the path of moving to full compatibility, I ran into a refcount issue somewhere. Hopefully someone can help me work this out. To describe the issue, When I run the collections tests I

[issue23910] C implementation of namedtuple (WIP)

2015-04-10 Thread Joe Jevnik
Joe Jevnik added the comment: Ideally, namedtuple is used to make your code cleaner, using magic indecies is less clear than using a named index in a lot of cases. Because namedtuple is mainly to make the code more readable, I don't think that it should have an impact on the runtime

[issue23910] C implementation of namedtuple (WIP)

2015-04-10 Thread Joe Jevnik
Joe Jevnik added the comment: would the idea be to deprecate namedtuple in favor of a public structseq that is exposed through collections, or change structseq to fit the namedtuple API? -- ___ Python tracker rep...@bugs.python.org http

[issue24379] operator.subscript

2015-06-22 Thread Joe Jevnik
Joe Jevnik added the comment: Based on some discussion on python-ideas, this is being renamed to operator.subscript. Here is the patch that makes the correct the changes to move this object into the operator module. -- components: +Extension Modules -Interpreter Core title

[issue24379] operator.subscript

2015-06-22 Thread Joe Jevnik
Joe Jevnik added the comment: I just moved it over since I implemented it for slice originally, I can drop the C implementation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue24379] operator.subscript

2015-06-23 Thread Joe Jevnik
Joe Jevnik added the comment: I removed the C implementation. -- Added file: http://bugs.python.org/file39792/operator_subscript_pyonly.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue24379] slice.literal notation

2015-06-10 Thread Joe Jevnik
Joe Jevnik added the comment: It is a singleton, does not accept the `maketuple` flag, and is written in C. I did not know about the s_ attribute of numpy before writing this; however, I still think that moving this object to slice improves code clarity (s_ is not a super clear name). I also

[issue24379] slice.literal notation

2015-06-10 Thread Joe Jevnik
Joe Jevnik added the comment: slice.literal[0] 0 y = slice.literal[1:2] slice(1, 2, None) slice.literal[0:1, ..., 3] (slice(0, 1, None), Ellipsis, 3) The way this object works right now does not create instances of some inner class of slice, instead, indexing it returns the key without

[issue24379] slice.literal notation

2015-06-04 Thread Joe Jevnik
Joe Jevnik added the comment: Why not index the slice type itself? slice[1:2] I originally considered this and I personally really like this syntax, but I was concerned with ambiguity with the typing module The only question in my mind is what slice should do when given just a single

[issue24379] operator.subscript

2015-08-16 Thread Joe Jevnik
Joe Jevnik added the comment: Sorry about the ideas thread. Thank you for merging this! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue24379] operator.subscript

2015-07-28 Thread Joe Jevnik
Joe Jevnik added the comment: I posted this to python Ideas on June 10th of this year. That is where we decided to rename it from `slice.literal` to `operator.subscript`. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue24379] operator.subscript

2015-07-24 Thread Joe Jevnik
Joe Jevnik added the comment: Any more comments? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___ ___ Python-bugs-list mailing list

[issue23926] skipitem() in getargs.c still supports 'w' and 'w#', and shouldn't

2015-07-25 Thread Joe Jevnik
Joe Jevnik added the comment: bumping so that we don't forget about this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23926 ___ ___ Python

[issue24379] operator.subscript

2015-07-14 Thread Joe Jevnik
Joe Jevnik added the comment: I updated the docstring -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___ ___ Python-bugs-list mailing list

[issue23926] skipitem() in getargs.c still supports 'w' and 'w#', and shouldn't

2015-07-15 Thread Joe Jevnik
Joe Jevnik added the comment: Sorry it took so long to get back to this. I didn't realize this was still open. I have provided the update to the docs and moved it to the 3.6 section. I also made sure the patch still applies and the tests all pass. -- Added file: http://bugs.python.org

[issue23926] skipitem() in getargs.c still supports 'w' and 'w#', and shouldn't

2015-10-20 Thread Joe Jevnik
Joe Jevnik added the comment: bumping this issue -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23926> ___ ___ Python-bugs-list

[issue24379] operator.subscript

2015-07-11 Thread Joe Jevnik
Joe Jevnik added the comment: Ah, I hadn't seen that, I will address those now, sorry about that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue24379] operator.subscript

2015-07-11 Thread Joe Jevnik
Joe Jevnik added the comment: updating with the slots change This also adds a ton of test cases -- Added file: http://bugs.python.org/file39902/operator_subscript_pyonly.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue24379] operator.subscript

2015-07-11 Thread Joe Jevnik
Joe Jevnik added the comment: ping: is there anything blocking this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___ ___ Python-bugs

[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik
Joe Jevnik added the comment: updating to address the docs and order of assertions -- Added file: http://bugs.python.org/file39904/operator_subscript_pyonly.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik
Joe Jevnik added the comment: is it normal to get a lot of 500s when using the review system? -- Added file: http://bugs.python.org/file39906/operator_subscript_pyonly.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik
Changes by Joe Jevnik j...@quantopian.com: Added file: http://bugs.python.org/file39907/operator_subscript_pyonly.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik
Changes by Joe Jevnik j...@quantopian.com: Added file: http://bugs.python.org/file39913/operator_subscript_pyonly.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue25770] expose name, args, and kwargs from methodcaller

2015-12-02 Thread Joe Jevnik
Joe Jevnik added the comment: partial's unique usage is why I feel like it would be so jarring for them do be named differently. I would be happiest having this feature at all so I will change the name to 'kwargs' if you would like. I just want to be sure that my reasons for choosing

[issue25770] expose name, args, and kwargs from methodcaller

2015-12-01 Thread Joe Jevnik
Joe Jevnik added the comment: Thanks for pointing me at the refleak, uploading an update -- Added file: http://bugs.python.org/file41203/methodcaller-attrs-1.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25770] expose name, args, and kwargs from methodcaller

2015-12-01 Thread Joe Jevnik
Joe Jevnik added the comment: Added a test case for the mutation of keywords. -- Added file: http://bugs.python.org/file41204/methodcaller-attrs-2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25770] expose name, args, and kwargs from methodcaller

2015-12-01 Thread Joe Jevnik
Joe Jevnik added the comment: I only want this feature to keep the usage close to functools.partial. I was actually sort of surprised to see that mutation of the dict held in partial, but I would rather be consistent. -- ___ Python tracker <

[issue25770] expose name, args, and kwargs from methodcaller

2015-12-22 Thread Joe Jevnik
Joe Jevnik added the comment: Is there a decision on the name? I can update the patch if needed. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue24379] operator.subscript

2015-12-22 Thread Joe Jevnik
Joe Jevnik added the comment: > and the latter might give the impression it was some sort of special > method/attribute when it was not. Wouldn't adding this be special because it is specifically reserved by CPython as an implementation detail? Also, would adding this name (

[issue25770] expose name, args, and kwargs from methodcaller

2015-11-30 Thread Joe Jevnik
New submission from Joe Jevnik: This patch adds 3 properties to methodcaller objects for inspecting the object at runtime: 1. 'name': the name of the method to call 2. 'args': the position arguments to pass to the method 3. 'keywords': the keyword arguments to pass to the method args

[issue25770] expose name, args, and kwargs from methodcaller

2015-12-01 Thread Joe Jevnik
Joe Jevnik added the comment: Thanks for review, looking into the reference count issue. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27241] Catch exceptions raised in pstats add (repl)

2016-06-06 Thread Joe Jevnik
New submission from Joe Jevnik: I was trying to add a file and accidently mistyped the name which crashed the repl session. I think it would be nicer to report the failure but bring me back to the prompt so I can decide what I would like to do. This patch catches any IOErrors that can

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Joe Jevnik
New submission from Joe Jevnik: This proposes the following syntax for creating OrderedDict literals: OrderedDict[k1: v1, k2: v2, ...] This is implemented by putting a metaclass on OrderedDict which has a getitem that turns the slices into a list of tuples (after validation). The idea

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Joe Jevnik
Joe Jevnik added the comment: Assuming all dicts are ordered, there will be no need for this (as long as the parser preserves order) so I am okay with dropping this. One of the main use cases I have for wanting nice literals is when I am working on tests. I find it very nice to be able

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Joe Jevnik
Joe Jevnik added the comment: Sorry about undoing the settings, that was unintentional. The UI around these settings is sort of unintuitive. I was waiting to propose this on python-dev until I got it working, but I wanted to push up what I did have as a work in progress so I could try to get

[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-26 Thread Joe Jevnik
Changes by Joe Jevnik <j...@quantopian.com>: -- nosy: +ll ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26448> ___ __

[issue26379] zlib decompress as_bytearray flag

2016-02-17 Thread Joe Jevnik
New submission from Joe Jevnik: Adds a keyword only flag to zlib.decompress and zlib.Decompress.decompress which marks that the return type should be a bytearray instead of bytes. The use case for this is reading compressed data into a mutable array to do further operations without requiring

[issue25770] expose name, args, and kwargs from methodcaller

2016-02-17 Thread Joe Jevnik
Joe Jevnik added the comment: ping: any decision on this? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25770> ___ ___ Pyth

[issue26379] zlib decompress as_bytearray flag

2016-02-18 Thread Joe Jevnik
Joe Jevnik added the comment: The recipe you showed looks like it is very complicated for the expected use case of decompressing all of the data into a mutable buffer. One difference I see with this and struct.pack_into or socket.recv_into is that in both of those cases we know how large our

[issue27039] bytearray.remove cannot remove bytes with value greater than 127

2016-05-16 Thread Joe Jevnik
Joe Jevnik added the comment: This seems to just be a bug in the implementation of remove. I have a patch to fix this and a test case. -- keywords: +patch nosy: +ll Added file: http://bugs.python.org/file42875/bytearray-remove.patch

[issue25770] expose name, args, and kwargs from methodcaller

2016-05-04 Thread Joe Jevnik
Joe Jevnik added the comment: people have had some time to think about this, whats should the name be so we can merge this? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26802] Avoid copy in call_function_var when no extra stack args are passed

2016-04-18 Thread Joe Jevnik
New submission from Joe Jevnik: When star unpacking positions into a function we can avoid a copy iff there are no extra arguments coming from the stack. Syntactically this looks like: `f(*args)` This reduces the overhead of the call by about 25% (~30ns on my machine) based on some light

[issue26802] Avoid copy in call_function_var when no extra stack args are passed

2016-04-19 Thread Joe Jevnik
Joe Jevnik added the comment: > It's possible that stararg is already an empty tuple. Is it worth to use it? PyTuple_New(0) should return the unit tuple in most cases: #if PyTuple_MAXSAVESIZE > 0 if (size == 0 && free_list[0]) { op = free_list[0]; Py_INCR

[issue26802] Avoid copy in call_function_var when no extra stack args are passed

2016-04-19 Thread Joe Jevnik
Joe Jevnik added the comment: CALL_FUNCTION doesn't use extended arg; I don't see what we get by adding some opcode to convert the sequence into a tuple. We also don't want to box up the stack arguments into a tuple because when we do a CALL_FUNCTION to a python function we just copy

[issue23926] skipitem() in getargs.c still supports 'w' and 'w#', and shouldn't

2016-04-18 Thread Joe Jevnik
Joe Jevnik added the comment: bump -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23926> ___ ___ Python-bugs-list mailing list

[issue26802] Avoid copy in call_function_var when no extra stack args are passed

2016-04-19 Thread Joe Jevnik
Joe Jevnik added the comment: in _PyEval_EvalCodeWithName we will have already pulled the underlying array out of the tuple subclass and the then we will reconstruct the vararg value in the locals from this array. This means that with this patch we can get: >>> class C(tup

[issue26802] Avoid copy in call_function_var when no extra stack args are passed

2016-04-19 Thread Joe Jevnik
Changes by Joe Jevnik <j...@quantopian.com>: -- type: -> performance ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26802> ___ __

[issue27241] Catch exceptions raised in pstats add (repl)

2016-08-02 Thread Joe Jevnik
Joe Jevnik added the comment: bump -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27241> ___ ___ Python-bugs-list mailing list

[issue29468] zipfile should catch ValueError as well as OSError to detect bad seek calls

2017-02-06 Thread Joe Jevnik
New submission from Joe Jevnik: In zipfile.py only OSError is checked to see if seek fails: ``` def _EndRecData64(fpin, offset, endrec): """ Read the ZIP64 end-of-archive records and use that to update endrec """ try: fpin.seek(offse

[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

2016-09-23 Thread Joe Jevnik
New submission from Joe Jevnik: I was writing an extension module that was working with weakrefs and wanted to ensure that the GC would not run for a block of code. I noticed that gc.enable/gc.disable are not exposed to C and the state of the gc is in a static variable so it cannot be mutated

[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

2016-09-27 Thread Joe Jevnik
Joe Jevnik added the comment: I definitely could have used PyImport_Import and PyObject_Call to accomplish this task; however, when I looked at at the implementation of these functions it seemed like a lot of overhead and book keeping just to set a boolean. Since I was already in a C

[issue29096] Signal Handlers reliably cause UnboundLocalErrors

2016-12-28 Thread Joe Jevnik
Joe Jevnik added the comment: The issue appears to be in ceval.c:unicode_concatenate (or the py2 equivalent) The code sets the local variable on the lhs to NULL before doing a potentially inplace append to the string. This means that if a signal is raised during the concat, we never hit

[issue28638] Optimize namedtuple creation

2017-07-18 Thread Joe Jevnik
Joe Jevnik added the comment: I added a benchmark suite (using Victor's perf utility) to cnamedtuple. The results are here: https://github.com/ll/cnamedtuple#benchmarks To summarize: type creation is much faster; instance creation and named attribute access are a bit faster

[issue30180] PyArg_ParseTupleAndKeywords supports required keyword only arguments

2017-04-26 Thread Joe Jevnik
New submission from Joe Jevnik: I opened a pr to remove a line in the docs about $ needing to follow | in PyArg_ParseTupleAndKeywords. In practice, you can just use a $ to create required keyword arguments which intuitively makes sense. I was told this should raise a SystemError; however, you

[issue30180] PyArg_ParseTupleAndKeywords supports required keyword only arguments

2017-04-26 Thread Joe Jevnik
Changes by Joe Jevnik <j...@quantopian.com>: -- assignee: -> docs@python components: +Documentation nosy: +docs@python ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue13349] Non-informative error message in index() and remove() functions

2017-05-27 Thread Joe Jevnik
Changes by Joe Jevnik <j...@quantopian.com>: -- pull_requests: +1919 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13349> ___ _

[issue30477] tuple.index error message improvement

2017-05-25 Thread Joe Jevnik
Joe Jevnik added the comment: I agree, "%R in tuple" is enough information for me. This would also remove the need to manually repr the object. -- type: enhancement -> ___ Python tracker <rep...@bugs.python.org> <http://bugs

[issue30477] tuple.index error message improvement

2017-05-25 Thread Joe Jevnik
New submission from Joe Jevnik: The old error of tuple.index(x): x not in tuple seemed very confusing to me. It was also harder to quickly understand what the program was doing wrong. This saves people a second pass through the program under the debugger because they can just see what

[issue30477] tuple.index error message improvement

2017-05-25 Thread Joe Jevnik
Joe Jevnik added the comment: As a more meta question: I have noticed that many error messages in the stdlib use PyErr_SetString, or choose to use the type name instead of the repr of the object. Is there a reason for this? I normally try to fill the error message with as much context

[issue23927] getargs.c skipitem() doesn't skip 'w*'

2018-07-23 Thread Joe Jevnik
Change by Joe Jevnik : -- pull_requests: +7946 ___ Python tracker <https://bugs.python.org/issue23927> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23926] skipitem() in getargs.c still supports 'w' and 'w#', and shouldn't

2018-07-09 Thread Joe Jevnik
Change by Joe Jevnik : -- pull_requests: +7754 ___ Python tracker <https://bugs.python.org/issue23926> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36068] Make _tuplegetter objects serializable

2019-02-21 Thread Joe Jevnik
New submission from Joe Jevnik : The new _tuplegetter objects for accessing fields of a namedtuple are no longer serializable with pickle. Cloudpickle, a library which provides extensions to pickle to facilitate distributed computing in Python, depended on being able to pickle the members

[issue36068] Make _tuplegetter objects serializable

2019-02-21 Thread Joe Jevnik
Joe Jevnik added the comment: Thank you for reviewing this so quickly! -- ___ Python tracker <https://bugs.python.org/issue36068> ___ ___ Python-bugs-list mailin

  1   2   >