[issue27137] functools.partial: Inconsistency between Python and C implementations

2016-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PEP 399 requires that the C code must pass the test suite used for the pure Python code. -- ___ Python tracker ___ __

[issue27117] turtledemo does not work with IDLE's new dark theme.

2016-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Heads are not merged. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue16500] Add an 'atfork' module

2016-05-29 Thread Марк Коренберг
Changes by Марк Коренберг : -- nosy: +mmarkk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue16500] Add an 'atfork' module

2016-05-29 Thread Марк Коренберг
Марк Коренберг added the comment: Also I have to add, maybe you also add automatic file descriptor closing on fork. We already have O_CLOEXEC, we have no O_CLOFORK. So, maybe it useful to add such flag ? -- ___ Python tracker

[issue27150] PEP446 (CLOEXEC by default) violation with fcntl.fcntl(..., fcntl.F_DUPFD)

2016-05-29 Thread Марк Коренберг
New submission from Марк Коренберг: 1. Need fix the code 2. Fix documentation 3. Update PEP446 description. There is F_DUPFD_CLOEXEC constant, that must be used instead of F_DUPFD transparently when kernel >= 2.6.24. -- messages: 266591 nosy: mmarkk priority: normal severity: normal st

[issue27150] PEP446 (CLOEXEC by default) violation with fcntl.fcntl(..., fcntl.F_DUPFD)

2016-05-29 Thread Марк Коренберг
Changes by Марк Коренберг : -- assignee: -> docs@python components: +Documentation, Library (Lib) nosy: +docs@python type: -> behavior versions: +Python 3.4, Python 3.5, Python 3.6 ___ Python tracker

[issue27150] PEP446 (CLOEXEC by default) violation with fcntl.fcntl(..., fcntl.F_DUPFD)

2016-05-29 Thread Martin Panter
Martin Panter added the comment: I don’t see any violation or anything needing fixing in the documentation or code. Can you elaborate? The fcntl() documentation says “The values used for ‘cmd’ [F_DUPFD, etc] are operating system dependent, and are available as constants in the ‘fcntl’ module,

[issue27117] turtledemo does not work with IDLE's new dark theme.

2016-05-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 169551a8d5d1 by Martin Panter in branch 'default': Issue #27125: Merge typo fixes from 3.5 https://hg.python.org/cpython/rev/169551a8d5d1 -- ___ Python tracker ___

[issue27125] Typo in Python 2 multiprocessing documentation

2016-05-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset c817d1b5b937 by Martin Panter in branch '2.7': Issue #27125: Fix various errors like “will [be] inherited” https://hg.python.org/cpython/rev/c817d1b5b937 New changeset f7c85accbde9 by Martin Panter in branch '3.5': Issue #27125: Fix various errors l

[issue27150] PEP446 (CLOEXEC by default) violation with fcntl.fcntl(..., fcntl.F_DUPFD)

2016-05-29 Thread STINNER Victor
STINNER Victor added the comment: I don't think that it's possible nor worth it to wrap all fcntl() and all ioctl() calls. I see these functions as very low-level APIs and so I consider that the caller is responsible of what he/she does. If you want to change something, explian in fcntl module d

[issue27117] turtledemo does not work with IDLE's new dark theme.

2016-05-29 Thread Martin Panter
Martin Panter added the comment: It looks like your commit to the “default” branch already included the relevant changes, so I did the merge while keeping the files the same. If I missed something, it may need an extra update. But the tests seem to be working (is there a turtledemo test?) ---

[issue27125] Typo in Python 2 multiprocessing documentation

2016-05-29 Thread Martin Panter
Martin Panter added the comment: Thanks for the report Phoenix -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

2016-05-29 Thread Roman Bolshakov
New submission from Roman Bolshakov: There's no code that closes read pipe(Process.sentinel) when a Process is joined. That creates issues in long running programs as the pipe's file descriptors are effectively leaked. -- components: Library (Lib) files: leak.py messages: 266598 nosy:

[issue27137] functools.partial: Inconsistency between Python and C implementations

2016-05-29 Thread Emanuel Barry
Emanuel Barry added the comment: Functionally, both versions are equivalent, but one is a class and the other is not. From PEP 399: "Technical details of the VM providing the accelerated code are allowed to differ as necessary, e.g., a class being a `type` when implemented in C." It clearly s

[issue27137] functools.partial: Inconsistency between Python and C implementations

2016-05-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue27152] Additional assert methods for unittest

2016-05-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch adds the ExtraAssertions mix-in that provides additional assert methods. These methods provide better failure report than assertTrue/assertFalse with a result of corresponding function. For example assertStartsWith outputs shorten reprs of t

[issue27152] Additional assert methods for unittest

2016-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Additional statistics that proves that specified checks are not specific for narrow group of tests: assertHasAttr 121 times in 57 files assertNotHasAttr 99 times in 31 files assertIsSubclass243 times in 30 files assertNotIsSubclass 95 times in

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

2016-05-29 Thread SilentGhost
Changes by SilentGhost : -- nosy: +jnoller, sbt versions: +Python 3.6 -Python 3.3, Python 3.4 ___ Python tracker ___ ___ Python-bugs-l

[issue27148] Make VENV_DIR relative to Script directory

2016-05-29 Thread SilentGhost
Changes by SilentGhost : -- components: +Library (Lib) -Demos and Tools nosy: +vinay.sajip versions: -Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker ___ _

[issue27153] Default value shown by argparse.ArgumentDefaultsHelpFormatter is backwards for action='store_false'

2016-05-29 Thread Colin Morris
New submission from Colin Morris: Small example: import argparse parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--no-foo', dest='foo', action='store_false', help="Suppress foo") args = parser.parse_args() print(

[issue27117] turtledemo does not work with IDLE's new dark theme.

2016-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: I prepared and tested two slightly different patches for 3.5 and 3.6. I committed the 3.6 patch, then the 3.5 patch, and prepared a null merge (in default), but did not hit the commit button before pushing. I just finished the null merge, creating two heads

[issue27129] Wordcode, part 2

2016-05-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't see how this is a simplification. The additional /2 and *2 on the affected lines makes the code a little harder to reason about and it loses some of the cleanness achieved by the last patch. To me, it also increases conceptual complexity because

[issue27125] Typo in Python 2 multiprocessing documentation

2016-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Lib/tkinter/tix.py: -and a label into one mega widget. It can beused be used to simplify +and a label into one mega widget. It can be used be used to simplify Isn't "be used" duplicated? -- nosy: +serhiy.storchaka ___

[issue27154] Regression in file.writelines behavior

2016-05-29 Thread Alexey Borzenkov
New submission from Alexey Borzenkov: There's a regression in file.writelines behavior for binary files when writing unicode strings, which seems to have first appeared in Python 2.7.7. The problem is that when writing unicode strings the internal representation (UCS2 or UCS4) is written inste

[issue16500] Add an 'atfork' module

2016-05-29 Thread A. Jesse Jiryu Davis
Changes by A. Jesse Jiryu Davis : -- nosy: +emptysquare ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue27129] Wordcode, part 2

2016-05-29 Thread Demur Rumed
Demur Rumed added the comment: Attached is the larger potential change of replacing GET_ITER/FOR_ITER with FOR_BEGIN/FOR_ITER. I took awhile to getting this put together due to missing that CONTINUE_LOOP was jumping to the top of the loop, skipping past FOR_ITER -- Added file: http://b

[issue27129] Wordcode, part 2

2016-05-29 Thread Demur Rumed
Demur Rumed added the comment: Oops wrong issue, sorry. Please delete? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue27127] Never have GET_ITER not followed by FOR_ITER

2016-05-29 Thread Demur Rumed
Demur Rumed added the comment: Attached is the larger potential change of replacing GET_ITER/FOR_ITER with FOR_BEGIN/FOR_ITER. I took awhile to getting this put together due to missing that CONTINUE_LOOP was jumping to the top of the loop, skipping past FOR_ITER -- Added file: http://b

[issue27129] Wordcode, part 2

2016-05-29 Thread Emanuel Barry
Changes by Emanuel Barry : -- Removed message: http://bugs.python.org/msg266608 ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue27150] PEP446 (CLOEXEC by default) violation with fcntl.fcntl(..., fcntl.F_DUPFD)

2016-05-29 Thread Марк Коренберг
Марк Коренберг added the comment: OK, it will be consistent, if docs mention that F_DUPFD will not set O_CLOEXEC automatically, mentiont that F_DUPFD_CLOEXEC should be used for that, and also mention PEP446 somewhere. -- ___ Python tracker

[issue27129] Wordcode, part 2

2016-05-29 Thread Demur Rumed
Changes by Demur Rumed : Removed file: http://bugs.python.org/file43048/forbegin.patch ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue27129] Wordcode, part 2

2016-05-29 Thread Emanuel Barry
Changes by Emanuel Barry : -- Removed message: http://bugs.python.org/msg266607 ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue27154] Regression in file.writelines behavior

2016-05-29 Thread Марк Коренберг
Changes by Марк Коренберг : -- nosy: +mmarkk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue27129] Wordcode, part 2

2016-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: word-jump-offsets.patch doesn't simplify the code, but rather complicates it, because this is minimal patch that doesn't include the refactoring. The main benefit of this patch is that it extends the range addressed by short jump instruction. The other benef

[issue27073] redundant checks in long_add and long_sub

2016-05-29 Thread Oren Milman
Oren Milman added the comment: I agree. This assert only indirectly verifies that something bad doesn't happen. The bad thing that might happen is an in-place negating of an element of small_ints, so the most direct assert should be 'assert(Py_REFCNT(z) == 1);'. This is exactly what Victor di

[issue27149] Implement socket.sendmsg() for Windows

2016-05-29 Thread Марк Коренберг
Марк Коренберг added the comment: https://github.com/pauldotknopf/WindowsSDK7-Samples/blob/master/netds/winsock/sendmsg/SendMsg.cpp Seems, supported since Vista -- ___ Python tracker __

[issue27155] '-' sign typo in example

2016-05-29 Thread Ben Kane
New submission from Ben Kane: On page https://docs.python.org/3/library/subprocess.html#replacing-os-system it looks like the code in the realistic example has a spurious '-' sign. The line: print("Child was terminated by signal", -retcode, file=sys.stderr) shouldn't have the minus sig

[issue27127] Never have GET_ITER not followed by FOR_ITER

2016-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Interesting. How it works with continue? for x in a: if x: continue f() In this case we can use new FOR_ITER instead of JUMP_ABSOLUTE. I would rename FOR_ITER to something more appropriate (maybe containing NEXT or CONTINUE). How it wor

[issue27155] '-' sign typo in example

2016-05-29 Thread Emanuel Barry
Emanuel Barry added the comment: A negative return code generally means an error occurred. Negating retcode here is equivalent to abs(retcode), which shows you want a positive integer to appear in the message - it's not an error. Could replace '-retcode' with 'abs(retcode)' to be more clear. P

[issue27127] Never have GET_ITER not followed by FOR_ITER

2016-05-29 Thread Demur Rumed
Demur Rumed added the comment: Currently it'll work since in an except it'll generate a CONTINUE_LOOP that'll jump to the end of the loop & either jump back to the start or to the end Your example is incorrect. If the continue's JUMP_ABS were a FOR_ITER then if we were on the last iteration of

[issue27127] Never have GET_ITER not followed by FOR_ITER

2016-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, sorry. You are right. Do you have any microbenchmarks that shows the benefit? -- stage: -> patch review ___ Python tracker ___ _

[issue27149] Implement socket.sendmsg() for Windows

2016-05-29 Thread R. David Murray
R. David Murray added the comment: Would you like to propose a patch? -- nosy: +r.david.murray ___ Python tracker ___ ___ Python-bugs-

[issue27152] Additional assert methods for unittest

2016-05-29 Thread R. David Murray
R. David Murray added the comment: Why a mixin? (As an aside, there is a proposal to move all assert methods to a place where they can be accessed outside test cases.) -- ___ Python tracker __

[issue27149] Implement socket.sendmsg() for Windows

2016-05-29 Thread Марк Коренберг
Марк Коренберг added the comment: No, I hate Windows, Winapi and so on. But I have problems in patching asyncio https://github.com/python/asyncio/pull/339 Since greate optimisation may be acheived using sendmsg() -- ___ Python tracker

[issue27127] Never have GET_ITER not followed by FOR_ITER

2016-05-29 Thread Demur Rumed
Demur Rumed added the comment: Pretty small perf increase: timeit("for a in range(256):pass", number=10) Without patch: ~2.1 With patch: ~1.84 pybench is 1-2% faster. Would prefer others' results. Especially a benchmark where it doesn't wrap payloads in for loops -- _

[issue27153] Default value shown by argparse.ArgumentDefaultsHelpFormatter is backwards for action='store_false'

2016-05-29 Thread R. David Murray
R. David Murray added the comment: The message is correct. The default value of foo is True. It would be just as misleading to say default: False, since that would imply the default value of foo was false. It also makes no sense to think it would mean the default value of 'no-foo' is False.

[issue27127] Never have GET_ITER not followed by FOR_ITER

2016-05-29 Thread Demur Rumed
Demur Rumed added the comment: Microbenchmark of continue regression: timeit("for a in range(256):\n\tif a:continue",number=10) Without patch: ~3.57 With patch: ~3.64 -- ___ Python tracker

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

2016-05-29 Thread Марк Коренберг
Changes by Марк Коренберг : -- nosy: +mmarkk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue27033] Change the decode_data default in smtpd to False

2016-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your review David. Updated patch addresses your doc comments. As for bool calls, I think there are reasons to do this. -- Added file: http://bugs.python.org/file43050/smtpd_decode_data_false_doc2.patch __

[issue27033] Change the decode_data default in smtpd to False

2016-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Addressed other David's comment. -- Added file: http://bugs.python.org/file43051/smtpd_decode_data_false_doc3.patch ___ Python tracker ___ ___

[issue27152] Additional assert methods for unittest

2016-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have this proposal (issue19645) in mind. We can add these method just in TestCase. In any case I'm going to add the ExtraAssertions mixin in test.support in maintained versions to help keeping branches in sync. --

[issue27156] IDLE: remove unused code

2016-05-29 Thread Terry J. Reedy
New submission from Terry J. Reedy: With 3.6 not bound by compatibility with external imports, dead code can go. It is an annoying distraction. The resource saved is space in package and module content listings and maintainer time and attention. 1. module idlever.py. It is obsolete at lea

[issue27154] Regression in file.writelines behavior

2016-05-29 Thread R. David Murray
R. David Murray added the comment: Any chance you could bisect to figure out which changeset caused the problem? I'm surprised that something like this would happen, we aren't in general making changes at that level to python2 any more. -- nosy: +r.david.murray __

[issue27127] Never have GET_ITER not followed by FOR_ITER

2016-05-29 Thread Demur Rumed
Demur Rumed added the comment: Summer heat is getting to me. Please ignore this issue until I've uploaded a fixed patch -- ___ Python tracker ___ ___

[issue27154] Regression in file.writelines behavior

2016-05-29 Thread Alexey Borzenkov
Alexey Borzenkov added the comment: Didn't need to bisect, it's very easy to find the problematic commit, since writelines doesn't change that often: https://hg.python.org/releases/2.7.11/rev/db842f730432 The old code was buggy in a sense that it always called PyObject_AsCharBuffer due to the

[issue27155] '-' sign typo in example

2016-05-29 Thread R. David Murray
R. David Murray added the comment: The negative return code indicates the child was terminated by a signal, exactly as the example error message says. The signal number is the positive value of the return code. It makes more sense to negate it than it does to call abs, since we *know* it is

[issue27033] Change the decode_data default in smtpd to False

2016-05-29 Thread R. David Murray
R. David Murray added the comment: Oh, I forgot to say that the revisions look good to me. -- ___ Python tracker ___ ___ Python-bugs-l

[issue27033] Change the decode_data default in smtpd to False

2016-05-29 Thread R. David Murray
R. David Murray added the comment: What reasons? It's not a big deal, but like I say it isn't our normal style. -- ___ Python tracker ___ ___

[issue27154] Regression in file.writelines behavior

2016-05-29 Thread R. David Murray
R. David Murray added the comment: Thanks. -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue21350] bug in file.writelines accepting buffers

2016-05-29 Thread R. David Murray
R. David Murray added the comment: Unfortunately this caused a regression in unicode handling. See issue 27154. -- nosy: +r.david.murray ___ Python tracker ___ _

[issue27033] Change the decode_data default in smtpd to False

2016-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Since these arguments are saved for multiple testing, it is worth to ensure that every test returns consistent result. For public attribute there is additional benefit, it looks as boolean. -- ___ Python tracker

[issue27033] Change the decode_data default in smtpd to False

2016-05-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9abde519cc1e by Serhiy Storchaka in branch 'default': Improved docs for issue27033. Based on comments by R. David Murray. https://hg.python.org/cpython/rev/9abde519cc1e -- ___ Python tracker

[issue27033] Change the decode_data default in smtpd to False

2016-05-29 Thread R. David Murray
R. David Murray added the comment: Python uses duck typing, though. Maybe someone is depending on those public attributes not getting coerced to boolean. Probably not, granted, since they are newish, but a python programmer might expect the value to get passed through. I'm of two minds abou

[issue27033] Change the decode_data default in smtpd to False

2016-05-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 71813a05e488 by Serhiy Storchaka in branch 'default': Issue #27033: Removed unnecessary the bool calls. https://hg.python.org/cpython/rev/71813a05e488 -- ___ Python tracker

[issue27154] Regression in file.writelines behavior

2016-05-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue5252] 2to3 should detect and delete import of removed statvfs module

2016-05-29 Thread R. David Murray
R. David Murray added the comment: Closing based on Benjamin's comments. -- nosy: +r.david.murray resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker __

[issue10908] Improvements to trace._Ignore

2016-05-29 Thread R. David Murray
R. David Murray added the comment: SilentGhost: I don't see any discussion leading to closure here. Did you just give up on getting a review, or was the rejection discussed somewhere else? Since you have 10896 marked as being superceded by this, I'd like to know what you think we should do t

[issue27157] Unhelpful error message when one calls a subclass of type

2016-05-29 Thread ppperry
New submission from ppperry: >>>class x(type):pass >>> x(x) Traceback (most recent call last): File "", line 1, in x(x) TypeError: type() takes 1 or 3 arguments I am giving it one argument, and yet it's complaining that `type` expects one or three arguments. How unhelpful. -- co

[issue27158] `isnstance` builtin does not handle types that are their own type

2016-05-29 Thread ppperry
Changes by ppperry : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue27158] `isnstance` function does not handle types that are their own type

2016-05-29 Thread ppperry
Changes by ppperry : -- title: `isnstance` builtin does not handle types that are their own type -> `isnstance` function does not handle types that are their own type ___ Python tracker ___

[issue27158] `isnstance` builtin does not handle types that are their own type

2016-05-29 Thread ppperry
New submission from ppperry: If one executes the following statements: >>> class metatype(type):pass >>> class x(type,metaclass=metatype):pass >>> x.__class__ = x , one gets a type that is it's own type: (`type(x) is x`). However, `isinstance(x,x)` unexpectedly returns False. How is my `x` typ

[issue27158] `isinstance` function does not handle types that are their own type

2016-05-29 Thread ppperry
Changes by ppperry : -- title: `isnstance` function does not handle types that are their own type -> `isinstance` function does not handle types that are their own type ___ Python tracker _

[issue27157] Unhelpful error message when one calls a subclass of type

2016-05-29 Thread Emanuel Barry
Emanuel Barry added the comment: Works for me: >>> class X(type): pass ... >>> X(X) -- nosy: +ebarry resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker

[issue27158] `isinstance` function does not handle types that are their own type

2016-05-29 Thread Emanuel Barry
Emanuel Barry added the comment: Works for me: >>> class meta(type): pass ... >>> class X(type, metaclass=meta): pass ... >>> X.__class__ = X >>> type(X) is X True >>> isinstance(X, X) True -- nosy: +ebarry resolution: -> works for me stage: -> resolved status: open -> closed ___

[issue27158] `isinstance` function does not handle types that are their own type

2016-05-29 Thread Emanuel Barry
Emanuel Barry added the comment: This seems as though you might be using an older version of the interpreter (I tested in 3.4.3, 3.5.1 and 3.6.0a1+). Where did you get your interpreter? The official releases are on https://www.python.org/downloads/ - if you got it somewhere else, that might be

[issue27158] `isinstance` function does not handle types that are their own type

2016-05-29 Thread ppperry
ppperry added the comment: Never mind this issue, I was confused when reporting. -- ___ Python tracker ___ ___ Python-bugs-list mailin

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread ppperry
ppperry added the comment: This issue only happens when the type in question has a custom metaclass: >>> class meta(type):pass >>> class X(type,metaclass=meta):pass >>> X(X) [Same unhelpful TypeError] -- resolution: works for me -> status: closed -> open title: Unhelpful error message

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread ppperry
ppperry added the comment: Also happens on 2.7, although you have to declare the metaclass using `__metaclass__ = meta` instead. -- versions: +Python 2.7 ___ Python tracker ___

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread Emanuel Barry
Emanuel Barry added the comment: In Objects/typeobject.c#L2290, the code checks that the (meta?)class is exactly `type` and that there's one argument, then returns `Py_TYPE(x)`. Subclasses of `type` allowing a single argument is a side-effect of not overriding __new__, not a documented feature

[issue27157] Unhelpful error message when one calls an instance of a subclass of type

2016-05-29 Thread ppperry
ppperry added the comment: Further testing reveals that this issue has nothing to do with metaclasses: >>>class X(type):pass >>>X()(X) raises the same TypeError. Even if the possibly dubious feature of being able to call instances of subclasses of type with one argument is rejected, the error

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread ppperry
ppperry added the comment: Ignore the first part of my previous comment; I improperly tested that. -- title: Unhelpful error message when one calls an instance of a subclass of type -> Unhelpful error message when one calls a subclass of type with a custom metaclass __

[issue27043] Describe what ‘inspect.cleandoc’ does to synopsis line.

2016-05-29 Thread R. David Murray
Changes by R. David Murray : -- stage: patch review -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread Emanuel Barry
Emanuel Barry added the comment: Yes, that would be preferable. The error message is at Objects/typeobject.c#l2301, but keep in mind that this message is shown for both faulty calls to type() as well as any of its subclasses that don't override __new__, and I'm lukewarm on adding e.g. a PyType

[issue18478] Class bodies: when does a name become local?

2016-05-29 Thread R. David Murray
R. David Murray added the comment: As far as I can see this has been fixed by explaining the special rules for class definitions at the end of the section. Do you think there is anything left to do here, Terry? Perhaps a 2.7 backport of some of the clarifications? -- nosy: +r.david.m

[issue24647] Document argparse.REMAINDER as being equal to "..."

2016-05-29 Thread R. David Murray
R. David Murray added the comment: I would say nargs='...' is borderline...it's meaning is *fairly* intuitive, but unlike the other three it does not, as paul.j3 points out, have a regex (or shell) counterpart. I think we should respect the original author's decision in this case and leave we

[issue27127] Never have GET_ITER not followed by FOR_ITER

2016-05-29 Thread Demur Rumed
Demur Rumed added the comment: Two issues: One: `a = (i for i in 6)` does not throw until calling next(a). This applies to the first patch. If it's unacceptable to defer the throw then this whole issue should be closed unless there's interest in having a GET_ITER, FOR_ITER, FOR_BEGIN, FOR_NEX

[issue26589] Add HTTP Response code 451

2016-05-29 Thread R. David Murray
R. David Murray added the comment: Looks good to me. -- nosy: +r.david.murray stage: patch review -> commit review ___ Python tracker ___

[issue18478] Class bodies: when does a name become local?

2016-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: The new language *and* organization introduced sometime during 3.4 is good enough for me. " with an exception that unbound local variables are looked up in the global namespace." covers my example. Thanks for the pointer. -- resolution: -> out of date

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: I am unable to replicate this in Python 2.7, 3.3 or 3.6. I haven't bothered to test against other versions, because I think that this is a PyShell issue, not a Python issue. (I think you are using PyShell, based on the traceback given.) Before reporting bugs

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread ppperry
ppperry added the comment: steven.daprano, you don't appear to have properly read the issue comments. I originally underspecified the conditions necessary to reproduce this, producing Emanuel Barry's closure. I then added a proper reproducer in the third comment, which does work in the vanilla

[issue26667] Update importlib to accept pathlib.Path objects

2016-05-29 Thread R. David Murray
R. David Murray added the comment: Brett, is this made obsolete by PEP 519, or is its implementation informed by that PEP? -- nosy: +r.david.murray ___ Python tracker ___ __

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread R. David Murray
R. David Murray added the comment: When I hit this recently I assumed that that error message meant I'd screwed up the metaclass definition. But if there's a way to improve the error message that would be great. I'll add this to the list of bugs I'm making for the sprints, perhaps one of the

[issue27113] sqlite3 connect parameter "check_same_thread" not documented

2016-05-29 Thread Senthil Kumaran
Senthil Kumaran added the comment: Thank you for the patch, Dave. Following the language style of rest of the docs, check_same_thread, should be explained in a passive voice. Also, mentioning the version requirement at this place, does not seem suitable to me. When we provide this feature, it

[issue26589] Add HTTP Response code 451

2016-05-29 Thread Martin Panter
Martin Panter added the comment: It seems like this code does get used, so I agree to add it. I think the table in the RST documentation should also be updated, possibly with a versionadded/versionchanged notice. -- nosy: +martin.panter ___ Python t

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Mon, May 30, 2016 at 01:43:22AM +, ppperry wrote: > steven.daprano, you don't appear to have properly read the issue > comments. Ack; I saw your comment about the metaclass, then saw your retraction of the metaclass issue, then misinterpreted your retr

[issue26526] In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA

2016-05-29 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread Eryk Sun
Eryk Sun added the comment: All types are instances of `type`, so the single argument case makes sense to me as a 'constructor'. It always returns an instance of `type`, just not a new instance. >>> X = type('X', (type,), {}) >>> type(X) >>> isinstance(type(X), type) True

[issue27125] Typo in Python 2 multiprocessing documentation

2016-05-29 Thread Martin Panter
Martin Panter added the comment: Indeed it is duplicated! I must have read this in my head many times before pushing it, and never picked it up. -- ___ Python tracker ___ __

[issue27043] Describe what ‘inspect.cleandoc’ does to synopsis line.

2016-05-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset c1eb32e183fd by Senthil Kumaran in branch '3.5': issue27043 - Explain the inspect.cleandoc behavior on synopsis line and other lines. https://hg.python.org/cpython/rev/c1eb32e183fd New changeset 4d5a5d4e731d by Senthil Kumaran in branch 'default':

[issue27043] Describe what ‘inspect.cleandoc’ does to synopsis line.

2016-05-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8f841baa0e06 by Senthil Kumaran in branch '2.7': issue27043 - Explain the inspect.cleandoc behavior on synopsis line and other lines. https://hg.python.org/cpython/rev/8f841baa0e06 -- ___ Python tracker

  1   2   >