[issue33351] Support compiling with clang-cl on Windows

2018-04-24 Thread pmpp

Change by pmpp :


--
nosy: +pmpp

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33351] Support compiling with clang-cl on Windows

2018-04-24 Thread Ethan Smith

New submission from Ethan Smith :

The clang folks have been hard at work making an ABI compatible backend to 
clang for Windows. Additionally they have created a cl compatible driver for 
clang, which can be used in lieu of cl itself. Clang-cl has been adopted to 
build Chrome on Windows 
http://blog.llvm.org/2018/03/clang-is-now-used-to-build-chrome-for.html, so I 
think it is stable enough to be considered for use.

Clang-cl has several advantages, such as computed goto support and many other 
optimizations which would make Python faster on Windows.

I would be happy to start contributing patches to further this goal, I already 
have a couple of small patches.

--
components: Build
messages: 315721
nosy: Ethan Smith
priority: normal
severity: normal
status: open
title: Support compiling with clang-cl on Windows
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33317] `repr()` of string in NFC and NFD forms does not differ

2018-04-24 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

On Tue, Apr 24, 2018, at 04:33, Pekka Klärck wrote:
> 
> Pekka Klärck  added the comment:
> 
> I didn't submit this as a bug report but as an enhancement request. From 
> usability point of view, saying that results differ but you just cannot 
> see the difference is not very helpful.
> 
> The exact reason I didn't submit this as an enhancement request for 
> unittest, pytest, and all other modules/tools being affected is that 
> "I'm not sure if there's a good way to detect whether two unicode 
> strings are going to display confusingly similarly". Enhancing `repr()` 
> would be a logical solution to this problem.

I should have said "there's no way to unambiguously represent a particular  
unicode string except as a sequence of integers, which isn't normally want 
anyone wants to see". This decomposition problem is only one of many. Even in 
ASCII land, fonts often have very similar glyphs for "l", "I", and "1".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33128] PathFinder is twice on sys.meta_path

2018-04-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

Hartmut, thanks for the issue report, and Pablo, thanks for the PR to resolve 
it!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33128] PathFinder is twice on sys.meta_path

2018-04-24 Thread miss-islington

miss-islington  added the comment:


New changeset 52a5a17338dfa7fed259027e1ecceba9c8491189 by Miss Islington (bot) 
in branch '3.7':
bpo-33128 Fix duplicated call to importlib._install_external_importers  
(GH-6273)
https://github.com/python/cpython/commit/52a5a17338dfa7fed259027e1ecceba9c8491189


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library

2018-04-24 Thread Zsolt Dollenstein

Change by Zsolt Dollenstein :


--
nosy: +zsol

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33128] PathFinder is twice on sys.meta_path

2018-04-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6290

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33128] PathFinder is twice on sys.meta_path

2018-04-24 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset 0977091dca59709864b14cfc129388f1f0de7bf7 by Nick Coghlan (Pablo 
Galindo) in branch 'master':
bpo-33128 Fix duplicated call to importlib._install_external_importers  
(GH-6273)
https://github.com/python/cpython/commit/0977091dca59709864b14cfc129388f1f0de7bf7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33343] [argparse] Add subcommand abbreviations

2018-04-24 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
assignee:  -> bethard
nosy: +bethard

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-24 Thread Eric V. Smith

Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17050] argparse.REMAINDER doesn't work as first argument

2018-04-24 Thread paul j3

paul j3  added the comment:

Since this feature is buggy, and there isn't an easy fix, we should probably 
remove any mention of it from the docs.  We can still leave it as an 
undocumented legacy feature.

There is precedent for leaving `nargs` constants undocumented.  
`argparse.PARSER` ('+...') is used by the subparser mechanism, but is not 
documented.  https://bugs.python.org/issue16988

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers

2018-04-24 Thread iunknwn

iunknwn  added the comment:

I feel like there are two reasonable options here:

1) We can implement a thread pool with basic resource tracking. This means idle 
threads get recycled, and threads that have been sitting idle for a while are 
terminated as demand drops, so resources can be reclaimed. This wouldn't 
require very much work - we would just need to modify some of the queue 
operations to have timeouts, and track the number of idle threads (most of 
that's already in my first PR). We could easily add options like min_threads 
and idle_thread_timeout as options in kwargs to the init routine. 

2) We can skip all tracking, and spin a fixed number of threads at 
initialization. This removes the complexity of locks and counts, and means the 
thread pool executor will work identically to the process pool executor (which 
also eagerly spawns resources). If we want this, this is ready to go in the 
second PR. 

I personally like option 1 because it feels closer to other languages I've 
worked in, but I'd like a bit more guidance from the reviewers before 
proceeding.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33316] PyThread_release_lock always fails

2018-04-24 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

In all PyMUTEX_* and most PyCOND_* functions, all the underlying APIs are void. 
So there's no point for the functions to return anything other than as 
convention.

A comment at the start of condvar.h says: "APIs generally return 0 on success 
and non-zero on error".
In Python\ceval_gil.h:57, there are boilerplace checker macros for them
(which will never fire).

So I guess this is done for uniformity.
Regardless, PyMUTEX_UNLOCK and PyMUTEX_LOCK at least are called both with and 
without checking the return value.


So I would drop the pretense and make these fns void.

---

That said, the reported error still persists after the fix.
The code confusing about which value LeaveNonRecursiveMutex should return on 
success. Pushed another commit, confirmed to work now.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33346] Syntax error with async generator inside dictionary comprehension

2018-04-24 Thread Eric N. Vander Weele

Change by Eric N. Vander Weele :


--
nosy: +ericvw

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32552] Improve text for file arguments in argparse.ArgumentDefaultsHelpFormatter class

2018-04-24 Thread paul j3

paul j3  added the comment:

This subclass makes are one method change:

from:

def _get_help_string(self, action):
return action.help

to:

def _get_help_string(self, action):
help = action.help
if '%(default)' not in action.help:
if action.default is not SUPPRESS:
defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
if action.option_strings or action.nargs in defaulting_nargs:
help += ' (default: %(default)s)'
return help

So it conditionally adds a '%(default)s' to the help string.  

And in:

def _expand_help(self, action):
   ...
   return self._get_help_string(action) % params

where 'params' is derived from the attributes of the 'Action' object.

I don't off hand see a clean way of suppressing this addition.  We don't want 
to add a parameter to 'add_argument' just for this.

As a user you can explicitly add the `%(default)s` to selected arguments, and 
use the regular formatter.  Admittedly it involves a bit more typing.

Or write your own version of the formatter subclass.

--
nosy: +paul.j3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33343] [argparse] Add subcommand abbreviations

2018-04-24 Thread paul j3

paul j3  added the comment:

This issue was raised in https://bugs.python.org/issue12713, 

argparse: allow abbreviation of sub commands by users

A patch was implemented, and then reverted when it was found to be buggy.

Subcommands are not parsed the same as long options.  Subcommands are actually 
'choices' of a positional argument.  Trying to allow abbreviations of 
subcommands allowed them in all 'choices', resulting in backward compatibility 
problems.

I recommend using the suparser alias mechanism instead.

(I think this issue should be closed).

--
nosy: +paul.j3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17050] argparse.REMAINDER doesn't work as first argument

2018-04-24 Thread Alden

Alden  added the comment:

Paul.  This is a bug, not a feature in argparse.  Devin is 100% correct.  
According to the docs REMAINDER should be greedy and is used for passing 
arguments to sub commands.  In your example the expected behavior is that if 
you do put "d --foo x a b c" that --foo is none and args gets everything.  We 
shouldn't need to use a gatekeeper or resort to manually parsing the remainder 
arguments.  It also shouldn't take 5 years to acknowledged that it needs to be 
fixed.  I'm happy to make a patch if its a bandwidth issue.  Am I 
misunderstanding and you feel like its not possible to fix?  I guess if there 
is a backward compatibility issue then we need to write a new option that does 
literally return the remainder arguments as documented.

--
nosy: +aldencolerain

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33343] [argparse] Add subcommand abbreviations

2018-04-24 Thread Brett Cannon

Change by Brett Cannon :


--
title: Subcommand abbreviations -> [argparse] Add subcommand abbreviations

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I agree that anything that has the same FS-determined sorted or not behavior 
should get the same note, for the same reason.  Ben, can you test?  Eryk, can 
you enlighten us further?

PS: Ben, when responding by email, please delete the quote, as it is duplicate 
noise on the web page.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33350] WinError 10038 is raised when loop.sock_connect is wrapped with asyncio.wait_for

2018-04-24 Thread Alisue Lambda

Alisue Lambda  added the comment:

I've found an workaround. The point is that 'with s' should be included in a 
coroutine which will be timed-out.

import asyncio
import socket

ADDR = ('10.0.2.1', 22)


async def check(loop):
s = socket.socket(socket.AF_INET,
socket.SOCK_STREAM)
s.setblocking(False)
with s:
await loop.sock_connect(s, ADDR)


async def test(loop):
try:
await asyncio.wait_for(
check(loop),
timeout=3,
loop=loop,
)
except Exception as e:
print('Fail: %s' % e)
else:
print('Success')


if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(test(loop))

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33350] WinError 10038 is raised when loop.sock_connect is wrapped with asyncio.wait_for

2018-04-24 Thread Alisue Lambda

Alisue Lambda  added the comment:

I should have mentioned that the script works well on macOS and Linux.
This issue exists only on Windows.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33350] WinError 10038 is raised when loop.sock_connect is wrapped with asyncio.wait_for

2018-04-24 Thread Alisue Lambda

New submission from Alisue Lambda :

This is my first time to create an issue on the python bug tracker so let me 
know if I don't follow the rule which I need to follow.

# Summary

Using 'loop.sock_connect' with 'asyncio.wait_for' raises 'OSError [WinError 
10038]' in Windows 10 Pro when timed-out.

# Detail

I use 'loop.sock_connect' to establish a TCP connection for checking if a 
particular port on a target host is available.
However, when I wrap the coroutine with 'asyncio.wait_for', the following 
exception is raised when the wrapped coroutine has timed-out.

Traceback (most recent call last):
  File "C:\Users\alisue/test.py", line 41, in 
loop.run_until_complete(test(loop))
  File "C:\Python36\lib\asyncio\base_events.py", line 454, in 
run_until_complete
self.run_forever()
  File "C:\Python36\lib\asyncio\base_events.py", line 421, in run_forever
self._run_once()
  File "C:\Python36\lib\asyncio\base_events.py", line 1395, in _run_once
event_list = self._selector.select(timeout)
  File "C:\Python36\lib\selectors.py", line 323, in select
r, w, _ = self._select(self._readers, self._writers, [], timeout)
  File "C:\Python36\lib\selectors.py", line 314, in _select
r, w, x = select.select(r, w, w, timeout)
OSError: [WinError 10038] ...

While it is raised from 'lib\selectors.py', I cannot catch this exception so 
the event loop has halted.

The attached 'test.py' is a minimum script to reproduce the error.

Thanks.

--
components: asyncio
files: test.py
messages: 315707
nosy: Alisue Lambda, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: WinError 10038 is raised when loop.sock_connect is wrapped with 
asyncio.wait_for
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47548/test.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1284316] Win32: Security problem with default installation directory

2018-04-24 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

For those installing Python 2.7, I share here for others the [Powershell 
module](https://www.dropbox.com/s/62m9easad0iakat/python.ps1?dl=0) I include in 
my profile. With this module loaded, `get-python-ver 2.7.14` installs Python 
2.7.14 64-bit to "C:\Program Files\Python27". Feel free to copy/adopt the 
routine if you're deploying more than a couple of installs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33347] zlibmodule undefined reference

2018-04-24 Thread Lucian Cristian

Lucian Cristian  added the comment:

it seems that python-config --libs doesn't detect -lz and appending -lz fixes 
the problem

-PYTHON_LIBS="`\"${PYTHONCONFIG}\" --libs`"
+PYTHON_LIBS="`\"${PYTHONCONFIG}\" --libs` -lz"

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24356] venv documentation incorrect / misleading

2018-04-24 Thread Elena Oat

Change by Elena Oat :


--
keywords: +patch
pull_requests: +6289
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library

2018-04-24 Thread Guido van Rossum

Guido van Rossum  added the comment:

Lukasz, pleased consider seriously to move to a 3rd party package. Even
pgen2.

On Mon, Apr 23, 2018, 21:12 Benjamin Peterson 
wrote:

>
> Benjamin Peterson  added the comment:
>
> The stdlib is a bad place for anything that needs to evolve at a
> non-glacial place. For example, even when 2to3 had not yet fallen out of
> favor, there were effectively 3 versions of it: one 2.7 and two in
> maintained 3.x branches. That was a large pain. 2to3 also could only be
> updated as quickly as Python is released.
>
> --
> stage: patch review ->
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32797] Tracebacks from Cython modules no longer work

2018-04-24 Thread Jeroen Demeyer

Jeroen Demeyer  added the comment:

Alternatively, instead of not implementing `loader.get_source()`, we could 
define a new semantic: if it returns `NotImplemented`, assume that the loader 
doesn't know how to get the sources. In that case, linecache would fall back to 
the old behaviour.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33349] 2to3 fails to parse async generators in non-async functions

2018-04-24 Thread Zsolt Dollenstein

Change by Zsolt Dollenstein :


--
keywords: +patch
pull_requests: +6288
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-24 Thread Ben FrantzDale

Ben FrantzDale  added the comment:

Great point. Looks like the phrase is "in arbitrary order" in the docs for
those (both 2.7 and 3), which is better than saying nothing. I'd still
prefer a bit more specificity about the potential gotcha since "arbitrary"
seems a lot less deterministic than "some file systems will give you sorted
order, some won't".

On Tue, Apr 24, 2018 at 9:41 AM, Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka  added the comment:
>
> Are there such notes in the descriptions of os.listdir(), os.scandir(),
> os.walk(), os.fwalk() and corresponding Path methods? If explicitly
> document the sorting, this should be made for all files enumerating
> functions.
>
> --
> nosy: +serhiy.storchaka
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Are there such notes in the descriptions of os.listdir(), os.scandir(), 
os.walk(), os.fwalk() and corresponding Path methods? If explicitly document 
the sorting, this should be made for all files enumerating functions.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-24 Thread Elena Oat

Change by Elena Oat :


--
keywords: +patch
pull_requests: +6287
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> not a bug

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33349] 2to3 fails to parse async generators in non-async functions

2018-04-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +benjamin.peterson, lukasz.langa, yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33266] 2to3 doesn't parse all valid string literals

2018-04-24 Thread Zsolt Dollenstein

Change by Zsolt Dollenstein :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33349] 2to3 fails to parse async generators in non-async functions

2018-04-24 Thread Zsolt Dollenstein

New submission from Zsolt Dollenstein :

This is valid since python3.7:

```
def f():
return (i * 2 async for i in arange(42))
```

but lib2to3 doesn't parse this properly, because `async` is tokenized as a 
`NAME` instead of `ASYNC`

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 315700
nosy: zsol
priority: normal
severity: normal
status: open
title: 2to3 fails to parse async generators in non-async functions
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Kasra Vand

Change by Kasra Vand :


--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Kasra Vand

Kasra Vand  added the comment:

I think this will contradict to Python's operators precedence. What I mentioned 
seems like you're passing the number as an argument to `not`, and this is while 
`not` is not a function. There is an `operator.not_` function that does the 
same job as expected though.

Now I see why it's not efficient and wise to do so. This is violation of  
operators precedence.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33348] lib2to3 doesn't parse f(*[] or [])

2018-04-24 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

See related issue24176 and issue24791.

--
nosy: +benjamin.peterson, lukasz.langa, serhiy.storchaka, yselivanov
versions: +Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33348] lib2to3 doesn't parse f(*[] or [])

2018-04-24 Thread Zsolt Dollenstein

Change by Zsolt Dollenstein :


--
keywords: +patch
pull_requests: +6286
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33348] lib2to3 doesn't parse f(*[] or [])

2018-04-24 Thread Zsolt Dollenstein

Change by Zsolt Dollenstein :


--
components: 2to3 (2.x to 3.x conversion tool)
nosy: zsol
priority: normal
severity: normal
status: open
title: lib2to3 doesn't parse f(*[] or [])
type: behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

And consider the example `3 + not 4 + 5`.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

If `3 + not 4` be accepted, should it be evaluated to the same value as `not 4 
+ 3`? Currently the result of `not 4 + 3` is False.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33317] `repr()` of string in NFC and NFD forms does not differ

2018-04-24 Thread Pekka Klärck

Pekka Klärck  added the comment:

I didn't submit this as a bug report but as an enhancement request. From 
usability point of view, saying that results differ but you just cannot see the 
difference is not very helpful.

The exact reason I didn't submit this as an enhancement request for unittest, 
pytest, and all other modules/tools being affected is that "I'm not sure if 
there's a good way to detect whether two unicode strings are going to display 
confusingly similarly". Enhancing `repr()` would be a logical solution to this 
problem.

Finally, would any harm be done if `repr('hyva\u0308')` would be changed to 
`'hyva\\u0308'`? I don't see it being any different than `repr('foo\x00')` 
being `'foo\\x00'`; in both cases you can `eval()` the result to get the 
original value back like `repr()` is supposed to do when possible. Most 
importantly, the result would show that the value actually contains like you 
generally expect `repr()` to do.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Kasra Vand

Kasra Vand  added the comment:

Thanks, Indeed. But my question is more about the syntax and why it's not that 
straight? The reasons for that is because Python is known as a scientific 
programming language and many people come with mathematical background and may 
want to use this kind of syntax.

So is it possible to add this feature?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33347] zlibmodule undefined reference

2018-04-24 Thread Lucian Cristian

New submission from Lucian Cristian :

trying to compile a utility in Openwrt and when pip-install is selected and 
zlib is linked to python I get this:


staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`PyZlib_crc32':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1045: undefined 
reference to `crc32'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1053: undefined 
reference to `crc32'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`PyZlib_adler32':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1013: undefined 
reference to `adler32'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1021: undefined 
reference to `adler32'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`Decomp_dealloc':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:469: undefined reference 
to `inflateEnd'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`Comp_dealloc':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:459: undefined reference 
to `deflateEnd'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`PyZlib_objcompress':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:504: undefined reference 
to `deflate'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_copy':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:772: undefined reference 
to `deflateCopy'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`PyZlib_uncopy':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:821: undefined reference 
to `inflateCopy'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`PyZlib_decompressobj':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:434: undefined reference 
to `inflateInit2_'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`PyZlib_compressobj':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:398: undefined reference 
to `deflateInit2_'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`PyZlib_objdecompress':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:632: undefined reference 
to `inflate'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`PyZlib_decompress':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:308: undefined reference 
to `inflateInit2_'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:335: undefined reference 
to `inflate'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:360: undefined reference 
to `inflateEnd'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:318: undefined reference 
to `inflateEnd'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:344: undefined reference 
to `inflateEnd'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:349: undefined reference 
to `inflateEnd'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:330: undefined reference 
to `inflateEnd'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o):build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:365:
 more undefined references to `inflateEnd' follow
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`PyZlib_unflush':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:892: undefined reference 
to `inflate'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:918: undefined reference 
to `inflateEnd'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`PyZlib_flush':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:713: undefined reference 
to `deflate'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:728: undefined reference 
to `deflateEnd'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function 
`PyZlib_compress':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:220: undefined reference 
to `deflateInit_'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:233: undefined reference 
to `deflateEnd'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:250: undefined reference 
to `deflate'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:245: undefined reference 
to `deflateEnd'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:254: undefined reference 
to `deflateEnd'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:265: undefined reference 
to `deflateEnd'
collect2: error: ld returned 1 exit status

python has access to zlib headers and libraries

--
components: Build
messages: 315693
nosy: Lucian Cristian
priority: normal
severity: normal
status: open
title: zlibmodule undefined reference
type: compile error
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 

[issue33346] Syntax error with async generator inside dictionary comprehension

2018-04-24 Thread Pablo Galindo Salgado

New submission from Pablo Galindo Salgado :

Given this async function:

async def elements(n):
yield n
yield n*2
yield n*3
yield n*4

This definition is considered invalid:

async def test():
return { n: [x async for x in elements(n)] for n in range(3)}

SyntaxError: asynchronous comprehension outside of an asynchronous function

The reason (I suspect) is because the dict comprehension is not an async 
context (it would be if range was an async iterable and we use `async for n in 
range(3)`). 

Is this expected behaviour or something it needs to change?

--
components: asyncio
messages: 315692
nosy: asvetlov, pablogsal, yselivanov
priority: normal
severity: normal
status: open
title: Syntax error with async generator inside dictionary comprehension
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33345] Documentation for PowerShell instructions

2018-04-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

You can use 3 + (not 4).

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33345] Documentation for PowerShell instructions

2018-04-24 Thread Steve Piercy

New submission from Steve Piercy :

Effective 2017-11-20, PowerShell is now the default command shell on Windows 
10, and possibly other versions.  Command Prompt (cmd.exe) is still present, 
just no longer the default.

https://support.microsoft.com/en-us/help/4027690/windows-powershell-is-replacing-command-prompt

Current instructions for installing and configuring Python on Windows reference 
only Command Prompt.  There may be other places.

https://docs.python.org/3/using/windows.html#configuring-python

FYI, we're in the process of updating our documentation for Pyramid where we 
have both PowerShell and Command Prompt.  At some point in the future, we may 
drop the latter.

https://github.com/Pylons/pyramid/issues/3260

Let me know what y'all think is the best way to proceed, even if that is no 
action.

--
assignee: docs@python
components: Documentation
messages: 315690
nosy: docs@python, stevepiercy
priority: normal
severity: normal
status: open
title: Documentation for PowerShell instructions
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Kasra Vand

Kasra Vand  added the comment:

This may seem not very useful while except 0 for other numbers it returns False 
but one may want to use another proposition inside `not` that can use either 0 
or a nonzero number. Also, in this case we can form more comprehensive logical 
propositions.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Kasra Vand

New submission from Kasra Vand :

Logical Negation of integers in Python always returns a Boolean result which 
can be achieve using `not`. Sometimes it's necessary to use this result 
directly in a proposition within a list comprehension (mostly). But if we use 
`not` directly in such arithmatic proposition it will raise a `SyntaxError.

```
In [46]: 3 + not(4)
  File "", line 1
3 + not(4)
  ^
SyntaxError: invalid syntax

```

Isn't that possible to make this work for integers in future releases? I was 
more curious to know what would be the drawbacks of such feature if there are 
any?

--
components: Interpreter Core
messages: 315688
nosy: Kasra Vand
priority: normal
severity: normal
status: open
title: Use logical negation of integers directly in arithmatic propostions and 
equations
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com