[issue30509] Optimize calling type slots

2017-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Despite the fact that `a + b` still is slower than `a.__add__(b)` in 3.7, it is more than 2 times faster than in 2.7 and 3.5. -- ___ Python tracker _

[issue30509] Optimize calling type slots

2017-05-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: In excellent Peter Cawley's article "Why are slots so slow?" [1] analysed causes why `a + b` is slower than `a.__add__(b)` for custom __add__ and provided suggestions for optimizing type slot calls. `a + b` and `a.__add__(b)` execute the same user code, `a

[issue30446] Embedded 3.6.1 distribution cannot find _socket module

2017-05-29 Thread Thomas Stevenson
Thomas Stevenson added the comment: Thank you Steve and Zachary. The context you provided helped me track it down, so I have marked this closed. In case it benefits anyone in future as well, I ran into a subsequent topic where the C++ app was compiled in debug and hence the actual file being

[issue29596] Unfinished sentence in howto/clinic.rst

2017-05-29 Thread Martin Panter
Martin Panter added the comment: Currently for the “buffer” destination, it says Suppress . . ., write . . . to ``block``, and write everything else to ``file``. Would it be more correct to change “file“ to “buffer”? I.e. Suppress . . ., write . . . to ``block``, and write everything else to

[issue15786] IDLE code completion window can hang or misbehave with mouse

2017-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Click still causes disappearance with fresh binary on Win10. -- ___ Python tracker ___ ___ Python-bu

[issue27115] IDLE: replace uses of tkinter simpledialog with query.Query

2017-05-29 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- title: IDLE: replace used of tkinter simpledialog with query.Query -> IDLE: replace uses of tkinter simpledialog with query.Query ___ Python tracker _

[issue27115] IDLE: replace used of tkinter simpledialog with query.Query

2017-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: We should not change simpledialog.py, but we could change bindings after import. However, since last summer, we can instead replace simpledialog.py with subclasses of ttk-using query.Query, with custom validators. editor.py uses askinterger for indent width, c

[issue23699] Add a macro to ease writing rich comparisons

2017-05-29 Thread Nick Coghlan
Nick Coghlan added the comment: Assigning to myself to review. To add some context that hasn't come up previously, the essential idea for this macro originated in the "Py3C" extension module compatibility project, where it helps authors of Python 2 extension modules update their projects to be

[issue23787] sum() function docstring lists arguments incorrectly

2017-05-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue23787] sum() function docstring lists arguments incorrectly

2017-05-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +1942 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue30508] "Task exception was never retrieved" reported for a canceled task

2017-05-29 Thread Yury Selivanov
Yury Selivanov added the comment: Yes, this is a known problem to me, thank you for creating the issue. Will work on a fix soon. -- ___ Python tracker ___ __

[issue30508] "Task exception was never retrieved" reported for a canceled task

2017-05-29 Thread Miguel Grinberg
New submission from Miguel Grinberg: I am seeing a strange issue that occurs when a task that is awaiting an asyncio.wait_for() is cancelled. I created a simple example that I think demonstrates the issue, even though it isn't exactly how it manifests on my application. When I run the attache

[issue29766] --with-lto still implied by --enable-optimizations in Python 2.7

2017-05-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: indeed, my mistake in the original backport. thanks! -- assignee: -> gregory.p.smith resolution: -> fixed stage: -> resolved status: open -> closed type: -> compile error ___ Python tracker

[issue29766] --with-lto still implied by --enable-optimizations in Python 2.7

2017-05-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 1f29cefc87c4c2ee629367ebe97a287d8e0b3e29 by Gregory P. Smith (Hanno Schlichting) in branch '2.7': bpo-29766: Do not force --with-lto to true for --enable-optimizations (#1858) https://github.com/python/cpython/commit/1f29cefc87c4c2ee629367ebe97a

[issue29766] --with-lto still implied by --enable-optimizations in Python 2.7

2017-05-29 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +1941 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue30495] IDLE: modernize textview module

2017-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Responses (without yet testing the code): 1. Generally, the only new subclass needed is for the master frame. Existing Toplevel derivatives may have a single frame in the toplevel, which should become an instance of a new subclass, in this case TextviewFrame.

[issue29670] argparse: does not respect required args pre-populated into namespace

2017-05-29 Thread paul j3
paul j3 added the comment: http://bugs.python.org/issue27859 argparse - subparsers does not retain namespace may complicate this issue. Due to changes in http://bugs.python.org/issue9351, a user defined namespace is not passed to the subparsers. They get a fresh namespace, which is then copi

[issue30503] It should be possible to use a module name with the same name as a package name

2017-05-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is just module shadowing in action. If you have two or more modules, or packages, in the module search path, the first one found will block access to the others. > this is a bad design in my opinion. *shrug* It is what it is. Often it is inconvenient.

[issue6721] Locks in the standard library should be sanitized on fork

2017-05-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: http://bugs.python.org/issue16500 added the os.register_at_fork() API which may be usable for this. -- ___ Python tracker ___

[issue6721] Locks in the standard library should be sanitized on fork

2017-05-29 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- versions: +Python 3.7 -Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue30501] Produce optimized code for boolean conditions

2017-05-29 Thread Emily Morehouse
Changes by Emily Morehouse : -- nosy: +emilyemorehouse ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue30300] asyncio.Controller

2017-05-29 Thread Yury Selivanov
Yury Selivanov added the comment: I'm not sure we want this to be in asyncio: it's a very high-level object somewhere in between the low-level and the application level. Some things off the top of my head that users will want from this API: - detailed logging or hooks to implement it - hooks

[issue16500] Allow registering at-fork handlers

2017-05-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: This may also allow us to do something reasonable for http://bugs.python.org/issue6721 as well. -- ___ Python tracker ___ ___

[issue30484] Garbage Collector can cause Segfault whilst iterating dictionary items

2017-05-29 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I could reproduce this on 3.4, but not on 3.3, 2.7, or master. -- nosy: +Jelle Zijlstra versions: +Python 3.4 ___ Python tracker ___ ___

[issue30346] Odd behavior when unpacking `itertools.groupby`

2017-05-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've looked at the patches but am still thinking about what I prefer before committing to a re-design. Please give it a little time. There is zero urgency here (nothing is broken, no user complaints, etc). I have a bunch of other stuff on my plate for a

[issue30361] Docs example: converting mixed types to floating point

2017-05-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Sorry, I don't know whether this was a sprint project or not.] Saw that the original PR has sprint label on it, I merely copied them over to the backport PRs. Thanks. -- ___ Python tracker

[issue30361] Docs example: converting mixed types to floating point

2017-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Just curious, what sprint? -- resolution: -> fixed stage: backport needed -> resolved status: open -> closed type: -> enhancement ___ Python tracker _

[issue30361] Docs example: converting mixed types to floating point

2017-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 03c7cfcd52be702957cc174f5cb2ce4c8be8bfca by terryjreedy (Mariatta) in branch '3.5': [3.5] bpo-30361: Use better example for mixed-type operands (GH-1701) (#1857) https://github.com/python/cpython/commit/03c7cfcd52be702957cc174f5cb2ce4c8be8bfca -

[issue30361] Docs example: converting mixed types to floating point

2017-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset d52f47a8f7794ee09151973a00d29c8612672e7a by terryjreedy (Mariatta) in branch '3.6': [3.6] bpo-30361: Use better example for mixed-type operands (GH-1701) (#1856) https://github.com/python/cpython/commit/d52f47a8f7794ee09151973a00d29c8612672e7a -

[issue30361] Docs example: converting mixed types to floating point

2017-05-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +1940 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue30361] Docs example: converting mixed types to floating point

2017-05-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +1939 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue30361] Docs example: converting mixed types to floating point

2017-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Go ahead. I don't care much either way. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue30361] Docs example: converting mixed types to floating point

2017-05-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks for merging the PR, Terry. Now it needs backport :) -- stage: -> backport needed ___ Python tracker ___ __

[issue30361] Docs example: converting mixed types to floating point

2017-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset e405d4b8dfb8b497e1c3d1f0f8e28030040c165e by terryjreedy (gfyoung) in branch 'master': bpo-30361: Use better example for mixed-type operands (#1701) https://github.com/python/cpython/commit/e405d4b8dfb8b497e1c3d1f0f8e28030040c165e -- ___

[issue30501] Produce optimized code for boolean conditions

2017-05-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: The improved code does look better. I'm +1 on this proposal as long as we're sure it doesn't introduce any new problems. -- ___ Python tracker

[issue30501] Produce optimized code for boolean conditions

2017-05-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Will this negatively impact code coverage reporting or code tracing (by optimizing across basic blocks)? -- ___ Python tracker ___ _

[issue28533] Replace asyncore

2017-05-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- stage: -> needs patch versions: +Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue28533] Replace asyncore

2017-05-29 Thread STINNER Victor
STINNER Victor added the comment: > I think it's a good idea to split this task into few parts/PR. Let me start > from ./Lib/test/test_poplib.py. Once you have a patch, open a new issue and mention it here. -- ___ Python tracker

[issue16500] Allow registering at-fork handlers

2017-05-29 Thread STINNER Victor
STINNER Victor added the comment: > New changeset 163468a766e16604bdea04a1ab808c0d3e729e5d by Gregory P. Smith in > branch 'master': > bpo-16500: Don't use string constants for os.register_at_fork() behavior > (#1834) > https://github.com/python/cpython/commit/163468a766e16604bdea04a1ab808c0d3e

[issue28533] Replace asyncore

2017-05-29 Thread Grzegorz Grzywacz
Grzegorz Grzywacz added the comment: I would like to work on this issue. I think it's a good idea to split this task into few parts/PR. Let me start from ./Lib/test/test_poplib.py. What about rewriting pop3 server stub using asyncio, i think requests could be handled synchronously, there will

[issue30496] Incomplete traceback with `exec` on SyntaxError

2017-05-29 Thread Stefan Seefeld
Stefan Seefeld added the comment: OK, fair enough, that makes sense. As I said, in my last message, I was mainly simply trying to figure out the exact location of the error in the executed script, which I got from inspecting the SyntaxError. So if all of this is expected behaviour, I think we c

[issue30497] Line number of docstring in AST

2017-05-29 Thread Steven Myint
Steven Myint added the comment: I think what you guys have brought up makes sense. Now that you mention it, I see that pyflakes gives the wrong line number if an escaped newline appears after the doctests. Though, it works fine if the escaped newline appears before it. https://github.com/PyCQ

[issue30496] Incomplete traceback with `exec` on SyntaxError

2017-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The traceback contain the location of the code that raised an exception when executed. In case of NameError this is a line in your script "x=u". In case of SyntaxError the code that failed is not in your script (it still is not executed), but in a compiler i

[issue30506] Replace 'list' with 'array' in array.remove and array.index

2017-05-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bu

[issue30497] Line number of docstring in AST

2017-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Even if the line number of a docstring is known, it is not easy to determine the line number corresponding to the particular line in a docstring if it contains backslashes following by newline. '''foo bar ''' and '''\ foo bar ''' are equal strings, but th

[issue16500] Allow registering at-fork handlers

2017-05-29 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- stage: commit review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list m

[issue30506] Replace 'list' with 'array' in array.remove and array.index

2017-05-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue16500] Allow registering at-fork handlers

2017-05-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 163468a766e16604bdea04a1ab808c0d3e729e5d by Gregory P. Smith in branch 'master': bpo-16500: Don't use string constants for os.register_at_fork() behavior (#1834) https://github.com/python/cpython/commit/163468a766e16604bdea04a1ab808c0d3e729e5d

[issue30507] Elements reports it is a list on Element.remove

2017-05-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: > The message, imo, is confusing Sorry, I think this is an invented issue and not a actual problem. ElementTree has been in the wild for a very long time. AFAICT, no user has ever had an actual issue with this error message. I've taught ElementTree (spec

[issue16500] Allow registering at-fork handlers

2017-05-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 29/05/2017 à 18:35, Serhiy Storchaka a écrit : > > Is it worth to guarantee the atomicity of os.register_at_fork(). I don't think so, honestly. -- ___ Python tracker _

[issue16500] Allow registering at-fork handlers

2017-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The one of potential advantages of the API proposed by Gregory is that os.register_at_fork() can be made atomic. Either register all callbacks, or do nothing in the case of error. But current proposed implementation is not atomic. If resizing of some list is

[issue30216] xdrlib.Unpacker.unpack_string returns bytes (docs say should be str)

2017-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Partially. Thank you for pointing on the predecessor Jan. -- ___ Python tracker ___ ___ Python-bug

[issue30216] xdrlib.Unpacker.unpack_string returns bytes (docs say should be str)

2017-05-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> xdrlib.Packer().pack_fstring throws a TypeError when called with a str() ___ Python tracker

[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()

2017-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: issue9544.patch LGTM as the first step. There are other mentions of strings in the documentation. -- nosy: +serhiy.storchaka stage: -> needs patch versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.2, Python 3.3

[issue30496] Incomplete traceback with `exec` on SyntaxError

2017-05-29 Thread Stefan Seefeld
Stefan Seefeld added the comment: Answering my own question: It appears I can get the location of a syntax error by inspecting the raised `SyntaxError`, which solves my specific use-case. The bug remains, though: The traceback is incomplete if it stems from a syntax error. -- ___

[issue26098] PEP 510: Specialize functions with guards

2017-05-29 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue30300] asyncio.Controller

2017-05-29 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On May 29, 2017, at 07:07 AM, Antoine Pitrou wrote: >For example I might write a UDP server. Or a distributed system that listens >to several ports at once, or launches a thread pool. etc. Thanks, those are nice motivational examples. -- ___

[issue30503] It should be possible to use a module name with the same name as a package name

2017-05-29 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue30507] Elements reports it is a list on Element.remove

2017-05-29 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- nosy: +eli.bendersky, scoder ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue30507] Elements reports it is a list on Element.remove

2017-05-29 Thread Jim Fasarakis-Hilliard
New submission from Jim Fasarakis-Hilliard: Another splinter issue from issue13349. Currently, Element reports it's a list when remove is called on it: from xml.etree.ElementTree import Element Element('').remove(Element('')) ValueError: list.remove(x): x not in list >From what I

[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()

2017-05-29 Thread Jan Hnatek
Changes by Jan Hnatek : -- nosy: +hnhn ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/m

[issue30216] xdrlib.Unpacker.unpack_string returns bytes (docs say should be str)

2017-05-29 Thread Jan Hnatek
Jan Hnatek added the comment: There's a patch for xdrlib documentation in Issue9544. Would that solve this issue? -- nosy: +hnhn ___ Python tracker ___ _

[issue30495] IDLE: modernize textview module

2017-05-29 Thread Cheryl Sabella
Cheryl Sabella added the comment: I've attached a patch for textview for your review. Thanks for suggesting that. I still need to work on test_textview. Some comments/questions: 1. I've made the Frame classes as you suggested. I had also made a class for TextviewText (as help.py has), but

[issue30500] urllib connects to a wrong host

2017-05-29 Thread Nam Nguyen
Nam Nguyen added the comment: I think the best behavior is to do what popular web browsers do. Chrome and Firefox, for example, parses this is host 127.0.0.1, path /, fragment #@evil.com. If the code does want to support username/password, it should do a custom opener (with basic HTTP authent

[issue30501] Produce optimized code for boolean conditions

2017-05-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Any high-level benchmarks (i.e. other than pybench and similar programs) impacted by this? -- nosy: +pitrou ___ Python tracker ___

[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-29 Thread Vinay Sajip
Vinay Sajip added the comment: Patch LGTM now, perhaps others will concur? -- nosy: +eryksun ___ Python tracker ___ ___ Python-bugs-li

[issue30496] Incomplete traceback with `exec` on SyntaxError

2017-05-29 Thread Stefan Seefeld
Stefan Seefeld added the comment: Some further experiements: Replacing the `exec(f.read(), env)` line by ``` code = compile(f.read(), 'script', 'exec') exec(code, env) ``` exhibits the same behaviour. If I remove the `try...except`, the correct (full) traceback is printed out. So it looks like t

[issue30502] Fix buffer handling of OBJ_obj2txt

2017-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your PR LGTM. But I think the code can be much simpler. Here is a patch that shares common code and applies other simplifications to surrounded code. PR 1852 increases the total number of lines by 37 lines, issue30502-simpler.diff -- only by 3 lines. PR 185

[issue30496] Incomplete traceback with `exec` on SyntaxError

2017-05-29 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- versions: +Python 2.7, Python 3.6, Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue30496] Incomplete traceback with `exec` on SyntaxError

2017-05-29 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- components: +Interpreter Core nosy: +benjamin.peterson, brett.cannon, ncoghlan, yselivanov stage: -> needs patch title: Incomplete traceback with `exec` -> Incomplete traceback with `exec` on SyntaxError ___ Python tra

[issue30506] Replace 'list' with 'array' in array.remove and array.index

2017-05-29 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- pull_requests: +1938 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue30506] Replace 'list' with 'array' in array.remove and array.index

2017-05-29 Thread Jim Fasarakis-Hilliard
New submission from Jim Fasarakis-Hilliard: Changes the error message for array.remove and array.index to say 'array.(x): x not in array' instead of 'array.(x): x not in list'. This is a splinter issue of issue13349. -- components: Library (Lib) messages: 294689 nosy: Jim Fasarakis-H

[issue30497] Line number of docstring in AST

2017-05-29 Thread STINNER Victor
STINNER Victor added the comment: > We use this feature in pyflakes (https://github.com/PyCQA/pyflakes/issues/271) AST is not designed to be 1-to-1 .py source to AST mapping. If you need the exact line number, you might use your own parser. I don't know what is using pylint for example? There

[issue30500] urllib connects to a wrong host

2017-05-29 Thread Nam Nguyen
Changes by Nam Nguyen : -- pull_requests: +1937 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue30502] Fix buffer handling of OBJ_obj2txt

2017-05-29 Thread Christian Heimes
Christian Heimes added the comment: IMO it doesn't make sense to share a couple of lines of code. It makes the code even harder to read. -- ___ Python tracker ___ __

[issue30505] Performance of typing._ProtocolMeta._get_protocol_attrs and isinstance

2017-05-29 Thread Oren Ben-Kiki
New submission from Oren Ben-Kiki: In 3.6.0, invocation of isinstance calls typing._ProtocolMeta._get_protocol_attrs. This creates a set of all attributes in all base classes, loops on these attributes to check they exist, and discards the set. It is very slow. My program uses isinstance to al

[issue30504] Allow inspecting buffering attribute of IO objects

2017-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> sys.stdout.line_buffering True For buffered streams I would expect the attribute named "buffer_size", conforming to the name of the parameter of the constructor. -- nosy: +serhiy.storchaka ___ Python tracker

[issue30502] Fix buffer handling of OBJ_obj2txt

2017-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can the common code of _create_tuple_for_attribute() and asn1obj2py() be shared? -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue30504] Allow inspecting buffering attribute of IO objects

2017-05-29 Thread Antoine Pitrou
New submission from Antoine Pitrou: It would be useful to be able to inspect the buffering attribute of buffered and text I/O objects, especially for debugging. I would expect e.g.: >>> sys.stdout.buffering 1 # line-buffered >>> sys.stdout.buffer.buffering 8192 -- components: IO mes

[issue30503] It should be possible to use a module name with the same name as a package name

2017-05-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +brett.cannon, eric.snow, ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue30503] It should be possible to use a module name with the same name as a package name

2017-05-29 Thread Håkon Hægland
New submission from Håkon Hægland: I have the following folder structure: . ├── aaa │   ├── bbb │   │   ├── ccc.py │   │   └── __init__.py │   ├── bbb.py │   └── __init__.py ├── __init__.py └── t.py ./t.py: import sys sys.path = ['.'] import aaa.bbb print(aaa.bbb.get_name()) ./aaa/bbb.py: de

[issue30501] Produce optimized code for boolean conditions

2017-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be hard to get the same optimization in the peepholer. For the first example, "if not a and b:", it is easy, just replace UNARY_NOT+POP_JUMP_IF_FALSE with POP_JUMP_IF_TRUE. The more complex third example, "if not (a and b) and c:", would need multip

[issue30502] Fix buffer handling of OBJ_obj2txt

2017-05-29 Thread Christian Heimes
Changes by Christian Heimes : -- pull_requests: +1935 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue30501] Produce optimized code for boolean conditions

2017-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Some examples. if not a and b: x Unpatched: 1 0 LOAD_NAME0 (a) 2 UNARY_NOT 4 POP_JUMP_IF_FALSE 14 6 LOAD_NAME1 (b) 8 POP_JUMP_IF_FALSE 14

[issue30502] Fix buffer handling of OBJ_obj2txt

2017-05-29 Thread Christian Heimes
New submission from Christian Heimes: Frawser Tweedle from Red Hat's identity management team found an issue in PyCA cryptography's handling of buffers for OpenSSL OBJ_obj2txt(). Cryptography fails to handle long OIDs as used by Active Directory. https://github.com/pyca/cryptography/pull/3612/

[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2017-05-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I did an experiment. I added "from __future__ import absolute_import" at the top of _multidict.c, and after a recompile the warning went away. What changed was that the following line: __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t

[issue30501] Produce optimized code for boolean conditions

2017-05-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1934 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2017-05-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Is it possible Cython is still supporting pre-PEP-328 style implicit relative > imports, even in Python 2.7+? That might be the case. I can't find anything in the Cython docs. Stefan, could you shed a light? -- ___

[issue7074] Turtle module crashes python

2017-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: I copied and pasted my code from turtlecrash.py into 3.7 editor, ran, and probably held key down for 3000 clicks, and it worked as it should. -- status: pending -> closed ___ Python tracker

[issue30300] asyncio.Controller

2017-05-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Can you elaborate? What's too specific about it? Do you have in mind a use > case where you wouldn't need to provide hostname and port? Any use case where setup is more elaborate than calling create_server(...). For example I might write a UDP server. Or