[issue36947] [Good first issue] Fix 3.3.3.1 Metaclasses Documentation

2019-05-17 Thread Josh Rosenberg
Josh Rosenberg added the comment: Clarification is fine, but "MyClass and MySubclass are instances of Meta:" is 100% true. Declaring a class to have a metaclass (or inheriting from a class with a metaclass) means that the class itself is an instance of the metaclass. New instan

[issue36947] [Good first issue] Fix 3.3.3.1 Metaclasses Documentation

2019-05-17 Thread Josh Rosenberg
Josh Rosenberg added the comment: Ah, you're right on __call__; I've never bothered to override it on a metaclass, but yes, since a class using a metaclass is an instance of the metaclass, like all instances, calling it invokes the __call__ of its type (it's just that the de

[issue25988] collections.abc.Indexable

2019-05-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: mbussonn: Your new PR looks like it's related to #36953 ("Remove collections ABCs?"), not this issue specifically. Can you withdraw/reissue attached to the correct issue? -- nosy: +josh.r, mbussonn ___

[issue36980] pass-by-reference clues

2019-05-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: 1. This is a bug tracker for bugs in the Python language spec and the CPython interpreter, not a general problem solving site. 2. The ids will differ for changeValue2 if you actually call it (kernel = kernel + 2 requires the the old id of kernel differ from

[issue37036] Iterating a text file by line should not implicitly disable tell

2019-05-24 Thread Josh Rosenberg
New submission from Josh Rosenberg : TextIOWrapper explicitly sets the `telling` flag to 0 when .__next__ ( textiowrapper_iternext ) is called ( https://github.com/python/cpython/blob/3.7/Modules/_io/textio.c#L2974 ), e.g. during standard for loops over the file of this form, trying to call

[issue37036] Iterating a text file by line should not implicitly disable tell

2019-05-24 Thread Josh Rosenberg
Josh Rosenberg added the comment: Left a dangling sentence in there: "I used two arg iter in both cases to keep the code paths as similar as possible so the `telling`." should read: "I used iter(f.readline, '') in both cases to keep the code paths as similar as

[issue33361] readline() + seek() on codecs.EncodedFile breaks next readline()

2019-05-24 Thread Josh Rosenberg
Josh Rosenberg added the comment: Possibly related to #8260 ("When I use codecs.open(...) and f.readline() follow up by f.read() return bad result"), which was never fully fixed in that issue, though #32110 ("Make codecs.StreamReader.read() more compatible with read() of ot

[issue37051] Glossary item "hashable" incorrect

2019-05-26 Thread Josh Rosenberg
Josh Rosenberg added the comment: For that matter, slices are immutable built-ins, but they're not hashable (presumably to avoid silently working with dictionaries in a non-slice capacity). -- nosy: +josh.r ___ Python tracker &

[issue37150] Do not allow to pass FileType class object instead of instance in add_argument

2019-06-04 Thread Josh Rosenberg
Josh Rosenberg added the comment: The docs specify what argparse.FileType() does via the default parameters: https://docs.python.org/3/library/argparse.html#argparse.FileType If you mean what does it do when you fail to call it at all (passing type=argparse.FileType), the answer is the same

[issue37150] Do not allow to pass FileType class object instead of instance in add_argument

2019-06-04 Thread Josh Rosenberg
Josh Rosenberg added the comment: Ah, right. It doesn't actually validate the mode string (it just stores it for when open is called, assuming open will validate it). So yeah, it silently accepts any string, not just valid mode strings. Not a contractual guarantee or anything, jus

[issue37340] remove free_list for bound method objects

2019-06-20 Thread Josh Rosenberg
Change by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <https://bugs.python.org/issue37340> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37549] os.dup() fails for standard streams on Windows 7

2019-07-10 Thread Josh Rosenberg
Josh Rosenberg added the comment: This seems likely to have been caused by the fixes for #37267, which fixes an issue with os.dup leaving character streams inheritable (when the documentation specifies that the result must be non-inheritable). The code originally didn't try to mak

[issue37267] os.dup() creates an inheritable fd when handling a character file on Windows

2019-07-10 Thread Josh Rosenberg
Josh Rosenberg added the comment: This may have caused a regression, see #37549. -- nosy: +josh.r ___ Python tracker <https://bugs.python.org/issue37

[issue37568] Misleading UnBoundLocalError on assignment to closure variable

2019-07-11 Thread Josh Rosenberg
Josh Rosenberg added the comment: I'm inclined to close as Not a Bug as well. I'm worried the expanded error message would confuse people when they simply failed to assign a variable, and make them try bad workarounds like adding global/nonlocal when it's not the problem, e.g

[issue30550] Document order-preserving dictionary output in json

2019-07-11 Thread Josh Rosenberg
Josh Rosenberg added the comment: Is there a reason to document object_pairs_hook=OrderedDict rather than just making the decoder populate a regular dict in an order-preserving way? (No idea if it does this already) -- nosy: +josh.r ___ Python

[issue37600] os.sched_getaffinity() is missing - module 'os' has no attribute 'sched_getaffinity'

2019-07-15 Thread Josh Rosenberg
Josh Rosenberg added the comment: Per the docs on the function group that includes os.sched_getaffinity ( https://docs.python.org/3/library/os.html#interface-to-the-scheduler ): > These functions control how a process is allocated CPU time by the operating > system. They are only ava

[issue37602] nonzero fixer problem

2019-07-17 Thread Josh Rosenberg
Josh Rosenberg added the comment: I suspect these fixers were left out simply because no one expected anyone to call the dunder names directly; the whole point of the dunder names is that they're not used directly, being invoked by syntax/context (__nonzero__ being the first thing trie

[issue36793] Do not define unneeded __str__ equal to __repr__

2019-07-17 Thread Josh Rosenberg
Josh Rosenberg added the comment: Serhiy: Did you plan to do any further work, or can this issue be closed? -- ___ Python tracker <https://bugs.python.org/issue36

[issue37636] Deprecate slicing and ordering operations on sys.version

2019-07-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: Rolling to 4.0 implies backward incompatible changes; doing just to avoid 3.10 is breaking semantic versioning rules. -- nosy: +josh.r ___ Python tracker <https://bugs.python.org/issue37

[issue37648] Fix minor inconsistency in the order of == operands

2019-07-22 Thread Josh Rosenberg
Change by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <https://bugs.python.org/issue37648> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37685] Fix equality checks for some types

2019-07-26 Thread Josh Rosenberg
Josh Rosenberg added the comment: @p-ganssle: Yup. If both sides return NotImplemented, __eq__ and __ne__ return a result based on an identity comparison; all other rich comparisons raise TypeError in that case. Code is here: https://github.com/python/cpython/blob/3.7/Objects/object.c#L679

[issue37685] Fix equality checks for some types

2019-07-26 Thread Josh Rosenberg
Josh Rosenberg added the comment: Serhiy: Is there a reason not to use the functools.total_ordering decorator on TimerHandle, so you can get rid of __le__/__ge__/__gt__ rather than fixing them individually? I notice at least one behavioral difference (total_ordering's le/ge method

[issue35712] Make NotImplemented unusable in boolean context

2019-07-26 Thread Josh Rosenberg
Josh Rosenberg added the comment: Moving to 3.9 target, per Serhiy's request. PR has been rebased against master, including updating the What's New info to be in the 3.9 version, not 3.8. -- versions: +Python 3.9 -Python 3.8 ___ Pyth

[issue37729] gc: stats from multi process are mixed up

2019-07-31 Thread Josh Rosenberg
Josh Rosenberg added the comment: Delaying the write means you don't get an indication of the steps in the process; if someone is trying to debug a crash caused by corruption of the gc list (e.g. due to a bad extension module), deferring the writes means they won't see any output

[issue35786] get_lock() method is not present for Values created using multiprocessing.Manager()

2019-08-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: Reading the docs, I'd definitely expect multiprocessing.Manager().Value to obey the same interface as multiprocessing.Value. The SyncManager docs say: > Its methods create and return Proxy Objects for a number of commonly used > data

[issue24413] Inconsistent behavior between set and dict_keys/dict_items: for non-iterable object x, set().__or__(x) returns NotImplemented, but {}.keys().__or__(x) raises TypeError

2019-08-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: To be clear, set().__or__(x) returns NotImplemented, it doesn't raise NotImplementedError. I've edited the title to match. One major problem that gets in the way of a fix is that the interface of set and dict views doesn't match, because

[issue37774] Micro-optimize vectorcall using PY_LIKELY

2019-08-07 Thread Josh Rosenberg
Change by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <https://bugs.python.org/issue37774> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35712] Make NotImplemented unusable in boolean context

2019-08-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: In the docs for my PR, I mention using NotImplemented in a boolean context is deprecated, raising DeprecationWarning, and will raise TypeError in a future version of Python. Serhiy has suggested the end state might be RuntimeWarning instead of TypeError

[issue37774] Micro-optimize vectorcall using PY_LIKELY

2019-08-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: Is the intent to make these macros public? If not, shouldn't they be prefixed with an underscore, like _Py_SIZE_ROUND_DOWN/_Py_SIZE_ROUND_UP in the same header? -- ___ Python tracker <https://bugs.py

[issue37790] subprocess.Popen() is extremely slow

2019-08-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: Have you tried switching to using Popen itself (or run, which keeps it to one layer of convenience wrapping)? subprocess.getstatusoutput is three layers of wrapping (it calls check_output, which in turn calls run, which in turn calls Popen), and (unlike

[issue37831] bool(~True) == True

2019-08-12 Thread Josh Rosenberg
Change by Josh Rosenberg : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> ~True is not False ___ Python tracker <https://bugs.python

[issue28638] Optimize namedtuple creation

2017-09-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: Side-note: Some of the objections to a C level namedtuple implementation appear to be based on the maintenance hurdle, and other have noted that a structseq-based namedtuple might be an option. I have previously attempted to write a C replacement for

[issue31356] Add context manager to temporarily disable GC

2017-09-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: I'd be -1 on this without a demonstrated broad need for this in at least some context outside of microbenchmarking utilities (which presumably have already implemented similar stuff). If a minimum bar for applicability isn't applied, we'll end

[issue31513] Document structure of memo dictionary to enable more advanced __deepcopy__ uses

2017-09-18 Thread Josh Rosenberg
New submission from Josh Rosenberg: At present, the documentation for the copy module doesn't document anything about the memo dictionary for deepcopy except to say that it must be received by custom __deepcopy__ methods and passed along when calling copy.deepcopy, and that it

[issue35273] 'eval' in generator expression behave different in dict from list

2018-11-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: The "bug" is the expected behavior for 2.7, as previously noted, and does not exist on Python 3 (where list comprehensions follow the same rules as generator expressions for scoping), where NameErrors are raised consistently. -- nos

[issue35303] A reference leak in _operator.c's methodcaller_repr()

2018-11-26 Thread Josh Rosenberg
Josh Rosenberg added the comment: This is completely fixed, right? Just making sure there is nothing left to be done to close the issue. -- nosy: +josh.r ___ Python tracker <https://bugs.python.org/issue35

[issue35314] fnmatch failed with leading caret (^)

2018-11-26 Thread Josh Rosenberg
Josh Rosenberg added the comment: Finished typing this while Serhiy was closing, but just for further explanation: This isn't a bug. fnmatch provides "shell-style" wildcards, but that doesn't mean it supports every shell's extensions to the globbing syntax. It doesn&

[issue19865] create_unicode_buffer() fails on non-BMP strings on Windows

2018-11-28 Thread Josh Rosenberg
Change by Josh Rosenberg : -- keywords: +3.2regression versions: +Python 3.6, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue19

[issue19865] create_unicode_buffer() fails on non-BMP strings on Windows

2018-11-28 Thread Josh Rosenberg
Change by Josh Rosenberg : -- keywords: -3.2regression ___ Python tracker <https://bugs.python.org/issue19865> ___ ___ Python-bugs-list mailing list Unsub

[issue35338] set union/intersection/difference could accept zero arguments

2018-11-30 Thread Josh Rosenberg
Josh Rosenberg added the comment: set.union() without constructing the set you call union on only happens to work for the set.union(a) case because `a` is already a set. union takes arbitrary iterables, not just sets, and you're just cheating by explicitly passing `a` as the expected

[issue11107] Cache constant "slice" instances

2018-12-03 Thread Josh Rosenberg
Change by Josh Rosenberg : -- versions: +Python 3.8 -Python 3.5 ___ Python tracker <https://bugs.python.org/issue11107> ___ ___ Python-bugs-list mailin

[issue35434] Wrong bpo linked in What's New in 3.8

2018-12-06 Thread Josh Rosenberg
New submission from Josh Rosenberg : https://docs.python.org/3.8/whatsnew/3.8.html#optimizations begins with: shutil.copyfile(), shutil.copy(), shutil.copy2(), shutil.copytree() and shutil.move() use platform-specific “fast-copy” syscalls on Linux, macOS and Solaris in order to copy the file

[issue35438] Extension modules using non-API functions

2018-12-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: Batteries-included extension modules aren't limited to the public and/or limited API; they use tons of undocumented internal APIs (everything to do with Py_IDENTIFIERs being an obvious and frequently used non-public API). _PyObject_LookupSpeci

[issue35438] Cleanup extension functions using _PyObject_LookupSpecial

2018-12-10 Thread Josh Rosenberg
Josh Rosenberg added the comment: Agreed with everything in Serhiy's comments. This patch disregards why _PyObject_LookupSpecial and the various _Py_IDENTIFIER related stuff was created in the first place (to handle a non-trivial task efficiently/correctly) in favor of trying to av

[issue35338] set union/intersection/difference could accept zero arguments

2018-12-10 Thread Josh Rosenberg
Josh Rosenberg added the comment: Given the "feature" in question isn't actually an intended feature (just an accident of how unbound methods work), I'm closing this. We're not going to try to make methods callable without self. -- resolution: -> wont fi

[issue35588] Speed up mod/divmod/floordiv for Fraction type

2018-12-28 Thread Josh Rosenberg
Josh Rosenberg added the comment: divmod imposes higher fixed overhead in exchange for operating more efficiently on larger values. Given the differences are small either way, and using divmod reduces scalability concerns for larger values (which are more likely to occur in code that

[issue35657] multiprocessing.Process.join() ignores timeout if child process use os.exec*()

2019-01-04 Thread Josh Rosenberg
Josh Rosenberg added the comment: I don't know what triggered the change, but I strongly suspect this is not a supported use of the multiprocessing module; Process is for worker processes (still running Python), and it has a lot of coordination machinery set up between parent and child

[issue35657] multiprocessing.Process.join() ignores timeout if child process use os.exec*()

2019-01-04 Thread Josh Rosenberg
Josh Rosenberg added the comment: Looks like the cause of the change was when os.pipe was changed to create non-inheritable pipes by default; if I monkey-patch multiprocessing.popen_fork.Popen._launch to use os.pipe2(0) instead of os.pipe() to get inheritable descriptors or just clear

[issue35701] 3.8 needlessly breaks weak references for UUIDs

2019-01-09 Thread Josh Rosenberg
New submission from Josh Rosenberg : I 100% agree with the aim of #30977 (reduce uuid.UUID() memory footprint), but it broke compatibility for any application that was weak referencing UUID instances (which seems a reasonable thing to do; a strong reference to a UUID can be stored in a

[issue35700] Place, Pack and Grid should return the widget

2019-01-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: Closing as rejected; to my knowledge, *no* built-in Python method both mutate an object and returns the object just mutated, precisely because: 1. It allows for chaining that leads fairly quickly to unreadable code (Python is not Perl/Ruby) 2. It creates

[issue35698] Division by 2 in statistics.median

2019-01-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: vstinner: The problem isn't the averaging, it's the type inconsistency. In both examples (median([1]), median([1, 1])), the median is unambiguously 1 (no actual average is needed; the values are identical), yet it gets converted to 1.0 only in

[issue35712] Make NotImplemented unusable in boolean context

2019-01-10 Thread Josh Rosenberg
New submission from Josh Rosenberg : I don't really expect this to go anywhere until Python 4 (*maybe* 3.9 after a deprecation period), but it seems like it would have been a good idea to make NotImplementedType's __bool__ explicitly raise a TypeError (rather than leaving it

[issue29871] Enable optimized locks on Windows

2019-01-15 Thread Josh Rosenberg
Josh Rosenberg added the comment: I assume you meant #35662 (based on the superseder note in the history). -- ___ Python tracker <https://bugs.python.org/issue29

[issue35701] [uuid] 3.8 breaks weak references for UUIDs

2019-01-16 Thread Josh Rosenberg
Josh Rosenberg added the comment: David, the What's New note about weak references no longer being possible should be removed as part of this change. I'm not sure the note on arbitrary attributes no longer being addable is needed either (__setattr__ blocked that beforehand, it&#

[issue35701] [uuid] 3.8 breaks weak references for UUIDs

2019-01-17 Thread Josh Rosenberg
Josh Rosenberg added the comment: The UUID module documentation (and docstring) begin with: "This module provides immutable UUID objects" Immutable is a stronger guarantee than __slots__ enforces already, so the documentation already ruled out adding arbitrary attributes to UUI

[issue35757] slow subprocess.Popen(..., close_fds=True)

2019-01-17 Thread Josh Rosenberg
Josh Rosenberg added the comment: Others can correct me if I'm wrong, but I'm fairly sure 2.7 isn't making changes unless they fix critical or security-related bugs. The code here is suboptimal, but it's already been fixed in Python 3 (in #8052), as part of a C acce

[issue20399] Comparison of memoryview

2019-01-18 Thread Josh Rosenberg
Josh Rosenberg added the comment: The lack of support for the rich comparison operators on even the most basic memoryviews (e.g. 'B' format) means that memoryview is still a regression from some of the functionality buffer offered back in Python 2 ( https://stackoverflow.com/

[issue20399] Comparison of memoryview

2019-01-18 Thread Josh Rosenberg
Josh Rosenberg added the comment: Not my use case specifically, but my link in the last post (repeated below) was to a StackOverflow answer to a problem where using buffer was simple and fast, but memoryview required annoying workarounds. Admittedly, in most cases it's people wanting

[issue35842] A potential bug about use of uninitialised variable

2019-01-28 Thread Josh Rosenberg
Josh Rosenberg added the comment: Your analysis would be (almost) correct if a slice object could have a stop value of NULL. It's wrong in that the error would be a NULL deference, not a silent use of an uninitialized value, but it would be a bug. In your scenario where v == NULL, it

[issue35431] Add a function for computing binomial coefficients to the math module

2019-01-28 Thread Josh Rosenberg
Josh Rosenberg added the comment: Steven: I'm assuming Brett rearranged the title to put emphasis on the new function and to place it earlier in the title. Especially important if you're reading e-mails with the old subject on an e-mail client with limited subject preview length

[issue35707] time.sleep() should support objects with __float__

2019-01-28 Thread Josh Rosenberg
Josh Rosenberg added the comment: You've got a reference leak in your __index__ based paths. PyNumber_Index is returning a new reference (either to the existing obj, or a new one, if the existing obj isn't already an int). You never release this reference. Simplest fix is to make

[issue35842] A potential bug about use of uninitialised variable

2019-01-28 Thread Josh Rosenberg
Josh Rosenberg added the comment: Yes, the 2.7 version of _PyEval_SliceIndex would bypass the NULL pointer dereference, so *if* you could make a slice with a NULL stop value, you could trigger a read from uninitialized stack memory, rather than dying due to a NULL pointer dereference. But

[issue35842] A potential bug about use of uninitialised variable

2019-01-28 Thread Josh Rosenberg
Josh Rosenberg added the comment: One additional note, just in case you're wondering. slice explicitly does not set Py_TPFLAGS_BASETYPE (in either Py2 or Py3), so you can't make a subclass of slice with NULLable fields by accident (you'll get a TypeError the moment you t

[issue35866] concurrent.futures deadlock

2019-01-31 Thread Josh Rosenberg
Josh Rosenberg added the comment: I've only got 3.7.1 Ubuntu bash on Windows (also amd64) immediately available, but I'm not seeing a hang, nor is there any obvious memory leak that might eventually lead to problems (memory regularly drops back to under 10 MB shared, 24 KB priva

[issue35862] Change the environment for a new process

2019-01-31 Thread Josh Rosenberg
Change by Josh Rosenberg : Removed file: https://bugs.python.org/file48087/core-nix.snapshot.json ___ Python tracker <https://bugs.python.org/issue35862> ___ ___ Pytho

[issue35862] Change the environment for a new process

2019-01-31 Thread Josh Rosenberg
Josh Rosenberg added the comment: Why is not having the target assign to the relevant os.environ keys before doing whatever depends on the environment not an option? -- nosy: +josh.r ___ Python tracker <https://bugs.python.org/issue35

[issue35862] Change the environment for a new process

2019-01-31 Thread Josh Rosenberg
Change by Josh Rosenberg : Removed file: https://bugs.python.org/file48088/bq-nix.snapshot.json ___ Python tracker <https://bugs.python.org/issue35862> ___ ___ Python-bug

[issue35862] Change the environment for a new process

2019-01-31 Thread Josh Rosenberg
Change by Josh Rosenberg : -- Removed message: https://bugs.python.org/msg334593 ___ Python tracker <https://bugs.python.org/issue35862> ___ ___ Python-bug

[issue35862] Change the environment for a new process

2019-01-31 Thread Josh Rosenberg
Change by Josh Rosenberg : Removed file: https://bugs.python.org/file48089/bq-nix.manifest ___ Python tracker <https://bugs.python.org/issue35862> ___ ___ Python-bug

[issue35904] Add statistics.fmean(seq)

2019-02-05 Thread Josh Rosenberg
Josh Rosenberg added the comment: Correct me if I'm wrong, but at least initially, the first listed goal of statistics (per the PEP) was: "Correctness over speed. It is easier to speed up a correct but slow function than to correct a fast but buggy one." numpy already exists

[issue5996] abstract class instantiable when subclassing built-in types

2019-02-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: Closed #35958 as a duplicate of this issue (and updated the title, since clearly the problem is not specific to dict). Patch probably needs to be rebased/rewritten against latest trunk (given it dates from Mercurial days). -- nosy: +Jon McMahon

[issue35918] multiprocessing's SyncManager.dict.has_key() method is broken

2019-02-12 Thread Josh Rosenberg
Change by Josh Rosenberg : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35961] test_slice: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small

2019-02-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: Victor found the same bug I found while I was composing this, posting only to incorporate proposed solution: I *think* I have a cause for this, but someone else with greater understanding of the cycle collector should check me if the suggested fix has non

[issue35961] test_slice: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small

2019-02-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: Ah, I see Victor posted an alternative PR that avoids the reference counting overhead by explicitly removing the temporary tuples from GC tracking. I'm mildly worried by that approach, only because the only documented use case for PyObject_GC_UnTrack

[issue35961] test_slice: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small

2019-02-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: +1 on PR 11830 from me. Can always revisit if #11107 is ever implemented and it turns out that the reference count manipulation means startup is too slow due to all the slice interning triggered comparisons (unlikely, but theoretically possible I guess

[issue35988] Python interpreter segfault

2019-02-13 Thread Josh Rosenberg
Josh Rosenberg added the comment: "your application is using more memory than what is available in the system." Well, it alone may not be using more memory, but the cumulative usage on the system is "too high" by whatever metric the OOM killer is using (IIRC the default

[issue15753] No-argument super in method with variable arguments raises SystemError

2019-02-13 Thread Josh Rosenberg
Josh Rosenberg added the comment: Moving from pending back to open (not sure what was "pending" about it?). The workaround is viable (and used by Python implemented dict subclasses in the standard library since they must accept **kwargs with arbitrary strings, including self), b

[issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface (doc issue)

2019-02-14 Thread Josh Rosenberg
Josh Rosenberg added the comment: Wait, why should #25737 be closed? This bug is a docs issue; collections.abc shouldn't claim that all the ABCs do duck-typing checks since Sequence doesn't. But #25737 is specific: array.array *should* be registered as a Sequence, but isn't;

[issue25737] array is not a Sequence

2019-02-14 Thread Josh Rosenberg
Josh Rosenberg added the comment: This should not be closed as a duplicate. Yes, array.array isn't automatically a Sequence, but since it isn't, the array module should be modified to explicitly do the equivalent of: import _collections_abc _collections_abc.Sequence.register(

[issue25737] array is not a Sequence

2019-02-14 Thread Josh Rosenberg
Change by Josh Rosenberg : -- versions: +Python 3.7, Python 3.8 -Python 3.5 ___ Python tracker <https://bugs.python.org/issue25737> ___ ___ Python-bugs-list m

[issue25737] array is not a Sequence

2019-02-14 Thread Josh Rosenberg
Josh Rosenberg added the comment: Correction: It should actually be registered as a subclass of MutableSequence (which should make it a virtual subclass of Sequence too; list is only registered on MutableSequence as well). -- ___ Python tracker

[issue35996] Optional modulus argument for new math.prod() function

2019-02-14 Thread Josh Rosenberg
Josh Rosenberg added the comment: "One other issue is that the arguments to prod() need not be integers, so a modulus argument wouldn't make sense in those contexts." The arguments to pow don't need to be integers either, yet the optional third argument is only really

[issue29733] concurrent.futures as_completed raise TimeoutError wrong

2017-03-06 Thread Josh Rosenberg
Josh Rosenberg added the comment: The docs ( https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.as_completed ) do seem to indicate it shouldn't do so as long as results were available before the timeout expired: "The returned iterato

[issue13566] Increase pickle compatibility

2017-03-06 Thread Josh Rosenberg
Josh Rosenberg added the comment: Right, but Antoine's objection is that suddenly strs pickled in Py3 can end up as strs in Py2, rather than unicode. If the library enforces a Py3-like type separation on Py2 (text arguments are unicode only, binary data is str only), then you have the pr

[issue27151] multiprocessing.Process leaves read pipes open (Process.sentinel)

2017-03-07 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue27151> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23267] multiprocessing pool.py doesn't close inqueue and outqueue pipes on termination

2017-03-07 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue23267> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29752] Enum._missing_ not called for __getattr__ failures

2017-03-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: Could that perhaps be intentional? Attribute access seems like something where the developer would be explicitly naming a single, hard coded, canonical name for the type, while string construction seems like something where you're getting a string

[issue29756] Improve documentation for list methods that compare items by equality

2017-03-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: Steven: Technically, in CPython, they use both identity and equality testing, as a function of using RichCompareBool (which tests identity first, then equality), rather than RichCompare (which only tests equality). It makes a difference for stuff like NaN

[issue29762] Use "raise from None"

2017-03-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: To tie the exceptions to the actual line, would it perhaps make sense to copy over the traceback of the original exception using .with_traceback? -- nosy: +josh.r ___ Python tracker <http://bugs.python.

[issue29762] Use "raise from None"

2017-03-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: Particularly when the type of the exception isn't being changed, it's only altering the message to provide more information? -- ___ Python tracker <http://bugs.python.o

[issue29752] Enum._missing_ not called for __getattr__ failures

2017-03-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: Yeah, that sounds fine. -- ___ Python tracker <http://bugs.python.org/issue29752> ___ ___ Python-bugs-list mailing list Unsub

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-13 Thread Josh Rosenberg
Josh Rosenberg added the comment: I feel like adding a type check to partial_repr might not be the correct fix here. If PyUnicode_FromFormat returned NULL and set an exception here, then the existing code would work as written (raising an exception, but not segfaulting). Alternatively, if the

[issue29831] os.path.exists seems can not recgnize "~"

2017-03-16 Thread Josh Rosenberg
Josh Rosenberg added the comment: That's because os.system is executing the command in a shell (which expands ~). Without shell support, ~ doesn't mean anything unless used with the APIs that specifically support it (e.g. os.path.expanduser). You wanted os.path.exists(os.path.

[issue29842] Executor.map should not submit all futures prior to yielding any results

2017-03-17 Thread Josh Rosenberg
New submission from Josh Rosenberg: As currently implemented, Executor.map is not particularly lazy. Specifically, if given huge argument iterables, it will not begin yielding results until all tasks have been submitted; if given an infinite input iterable, it will run out of memory before

[issue29842] Executor.map should not submit all futures prior to yielding any results

2017-03-17 Thread Josh Rosenberg
Josh Rosenberg added the comment: Nosying folks suggested by GitHub, hope that's the right etiquette. For the record, filled out contributor agreement ages ago, but hadn't linked (or even created) GitHub account until after I got the warning. I've linked this account to my GitH

[issue29842] Make Executor.map work with infinite/large inputs correctly

2017-03-19 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- title: Executor.map should not submit all futures prior to yielding any results -> Make Executor.map work with infinite/large inputs correctly ___ Python tracker <http://bugs.python.org/issu

[issue29871] Enable optimized locks on Windows

2017-03-21 Thread Josh Rosenberg
New submission from Josh Rosenberg: Kristjan wrote improved locking primitives in #15038 that use the new (in Vista) SRWLock and Condition Variable APIs. SRWLocks (used in exclusive mode only) replace Critical Sections, which is slower than SRWLock and provides no features we use that might

[issue29871] Enable optimized locks on Windows

2017-03-21 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- pull_requests: +670 ___ Python tracker <http://bugs.python.org/issue29871> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29871] Enable optimized locks on Windows

2017-03-21 Thread Josh Rosenberg
Josh Rosenberg added the comment: Note: Beyond turning on the new primitives by default, I also made a change to PyCOND_TIMEDWAIT. The original code looked wrong, in that: 1. It assumed that when SleepConditionVariableSRW returned non-zero, you didn't know if the wait had timed out or no

[issue28767] Readd __index__ support on ipaddress objects

2017-03-21 Thread Josh Rosenberg
Josh Rosenberg added the comment: >From the original bugs, it looks like people liked being able to directly >produce the hex of the IP addresses using hex(). I'll admit I'm only +0.5 on >restoring __index__; having them be equivalent to int, not just convertable, >do

<    1   2   3   4   5   6   7   8   >