Re: The Mailing List Digest Project

2019-03-27 Thread Abdur-Rahmaan Janhangeer
continuing a better effort here:
https://github.com/PythonCHB/PythonListsSummaries
moving to an impersonal repo later!


Garanti
sans virus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36459] A possible double PyMem_FREE() due to tokenizer.c's tok_nextc()

2019-03-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pablogsal

___
Python tracker 

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



Re: The Mailing List Digest Project

2019-03-27 Thread Abdur-Rahmaan Janhangeer
hum maybe beacuse i speak french some settings got configured but i don't
see how. btw we are moving to a better repo with sphinx


Garanti
sans virus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Mar 28, 2019 at 5:48 AM Jason Friedman  wrote:

> On Mon, Mar 25, 2019 at 11:03 PM Abdur-Rahmaan Janhangeer <
> arj.pyt...@gmail.com> wrote:
>
> > As proposed on python-ideas, i setup a repo to turn mail threads into
> > articles.
> >
> > i included a script to build .md to .html (with syntax highlighting) here
> > is the index
> >
> > https://abdur-rahmaanj.github.io/py-mailing-list-summary/
> >
> >  Pretty cool.  FYI, the index page (now containing 4 articles) with
> Google
> Chrome 72.0.3626.x prompts me to translate to French.  The articles
> themselves do not.
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Abdur-Rahmaan Janhangeer
http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36459] A possible double PyMem_FREE() due to tokenizer.c's tok_nextc()

2019-03-27 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue36459] A possible double PyMem_FREE() due to tokenizer.c's tok_nextc()

2019-03-27 Thread Zackery Spytz


New submission from Zackery Spytz :

Commit cb90c89de14aab636739b3e810cf949e47b54a0c added a PyMem_FREE(tok->buf) 
call in tok_nextc() if a PyMem_REALLOC() call fails. This will cause a double 
free when PyTokenizer_Free() is called on the tokenizer state.

--
components: Interpreter Core
messages: 339013
nosy: ZackerySpytz
priority: normal
severity: normal
status: open
title: A possible double PyMem_FREE() due to tokenizer.c's tok_nextc()
type: crash
versions: Python 2.7, 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



[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2019-03-27 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue36458] Compile errors --without-threads

2019-03-27 Thread patrik


patrik  added the comment:

Not a problem. I wanted to record the issue just in case someone else 
encounters it, and also because there seems to have been a history of issues 
with the no-threads option. Happy to hear its sorted in 3.7.

--

___
Python tracker 

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



[issue6422] timeit called from within Python should allow autoranging

2019-03-27 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> Were you working on the additional functionality that you mentioned in 
> msg272704 or would that be open for someone else to do?  Thanks!

Please consider it open. I don't expect it to be difficult, it's just 
finding the Round Tuits. Perhaps an easy first issue for someone?

--

___
Python tracker 

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



[issue36458] Compile errors --without-threads

2019-03-27 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report. Unfortunately, Python 3.6.8 was the last bugfix release 
of 3.6 so we now only accept and fix security-related issues for it.  I did a 
quick check and this does not appear to be a problem in 3.7.x but feel free to 
re-open the issue if it can be reproduced there.  Sorry!

https://devguide.python.org/#status-of-python-branches
https://devguide.python.org/devcycle/#security-branches

--
nosy: +ned.deily
resolution:  -> out of date
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



[issue36458] Compile errors --without-threads

2019-03-27 Thread patrik


New submission from patrik :

Compiling python 3.6.8 configured with --without-threads (no other options) 
fails, with undefined references to PyGILState_GetThisThreadState in 
pylifecycle.c, and PyGILState_Ensure and PyGILState_Release in object.c.

I used Louis' fix from issue #24784 in pylifecycle.c, and placed #ifdef 
WITH_THREADS around the undefined calls in object.c (both in _PyObject_dump). 
With this, compiling works.

Installing then fails because Lib/threading.py attempts to import _thread, 
which is not available. This can be fixed by replacing the import with the 
pattern described in _dummy_thread:

try:
import _thread
except ImportError:
import _dummy_thread as _thread

import _thread happens in two places in threading.py (the second is "from 
_thread import stack_size"); both have to be rewritten as above.

There is also an unguarded import _thread in telnetlib, but it's inside a 
method def (mt_interact in class Telnet) so perhaps it does not cause 
installation to fail.

--
components: Build
messages: 339009
nosy: patrik
priority: normal
severity: normal
status: open
title: Compile errors --without-threads
type: compile error
versions: Python 3.6

___
Python tracker 

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



[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2019-03-27 Thread Tim Mitchell


New submission from Tim Mitchell :

The new functools.singledispatchmethod (issue32380) class interacts poorly with 
subclasses.
There is no way for a sub-class to override or extend the dispatch registry.
E.g.

class BaseVistor:
   @singledispatchmethod
   def visit(self, obj):
  raise ValueError('Explict vistor implementation missing)

class AVisitor(BaseVisitor):
   # problem: here we can only register against base class method
   @BaseVistor.visit.reister(int)
   def visit_int(self, obj):
   print ('integer')

The AVistor class has now changed the dispatch registry for BaseVistor class 
which is bad.

To fix this the dispatch registry needs to be copied for each subclass and an 
alternate register mechanism provided for subclasses to register against a 
subclass method.
See attached file and pypi methoddispatch for details :)

--
components: Library (Lib)
files: methoddispatch36.py
messages: 339008
nosy: Tim Mitchell2, inada.naoki
priority: normal
severity: normal
status: open
title: functools.singledispatchmethod interacts poorly with subclasses
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48235/methoddispatch36.py

___
Python tracker 

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



[issue36455] collections.abc.Sequence doesn't support reflection/introspection

2019-03-27 Thread James Edwards


James Edwards  added the comment:

Edit conflict -- indeed -- self closing.

---

I should point out that this could be fixed with something like the following:

@classmethod
def __subclasshook__(cls, C):
if cls is Sequence:
return _check_methods(C, "__reversed__", "__iter__",
  "__len__", "__contains__", "__getitem__")
return NotImplemented

But seeing as it's not the only abc that is without a subclass hook, I wanted 
to raise an issue before I submitted a complete PR implementing subclasshooks 
for the rest of the abcs that need them.

--
nosy:  -josh.r

___
Python tracker 

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



[issue36456] task.cancel unbound recursion

2019-03-27 Thread Dima Tisnek


New submission from Dima Tisnek :

Cancelling a deadlocked group of tasks results in MaximumRecursionError

Inspired by 
https://stackoverflow.com/questions/55341189/handling-asyncio-deadlocks

Given the following test-asyncio.py:

```
import asyncio


async def test():
async def f():
await g_task

async def g():
await f_task

f_task = asyncio.create_task(f())
g_task = asyncio.create_task(g())

async def release():
await asyncio.sleep(5)
f_task.cancel()

await asyncio.gather(f_task, g_task, release())

asyncio.run(test())
```

Results in:

```
Traceback (most recent call last):
  File ".../python3.8/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
  File ".../python3.8/asyncio/base_events.py", line 589, in run_until_complete
return future.result()
  File "test-asyncio.py", line 18, in test
await asyncio.gather(f_task, g_task, release())
  File "test-asyncio.py", line 16, in release
f_task.cancel()
RecursionError: maximum recursion depth exceeded while calling a Python object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test-asyncio.py", line 20, in 
asyncio.run(test())
  File ".../python3.8/asyncio/runners.py", line 46, in run
_cancel_all_tasks(loop)
  File ".../python3.8/asyncio/runners.py", line 59, in _cancel_all_tasks
task.cancel()
RecursionError: maximum recursion depth exceeded while calling a Python object
Exception in default exception handler
Traceback (most recent call last):
  File ".../python3.8/asyncio/base_events.py", line 1644, in 
call_exception_handler
self.default_exception_handler(context)
  File ".../python3.8/asyncio/base_events.py", line 1615, in 
default_exception_handler
value = repr(value)
  File ".../python3.8/asyncio/base_tasks.py", line 21, in _task_repr_info
info.insert(3, f'wait_for={task._fut_waiter!r}')
  File ".../python3.8/asyncio/base_tasks.py", line 21, in _task_repr_info
info.insert(3, f'wait_for={task._fut_waiter!r}')
  File ".../python3.8/asyncio/base_tasks.py", line 21, in _task_repr_info
info.insert(3, f'wait_for={task._fut_waiter!r}')
  [Previous line repeated 326 more times]
  File ".../python3.8/asyncio/base_tasks.py", line 9, in _task_repr_info
info = base_futures._future_repr_info(task)
  File ".../python3.8/asyncio/base_futures.py", line 57, in _future_repr_info
info.append(_format_callbacks(future._callbacks))
  File ".../python3.8/asyncio/base_futures.py", line 36, in _format_callbacks
cb = '{}, {}'.format(format_cb(cb[0][0]), format_cb(cb[1][0]))
  File ".../python3.8/asyncio/base_futures.py", line 31, in format_cb
return format_helpers._format_callback_source(callback, ())
  File ".../python3.8/asyncio/format_helpers.py", line 23, in 
_format_callback_source
func_repr = _format_callback(func, args, None)
  File ".../python3.8/asyncio/format_helpers.py", line 56, in _format_callback
func_repr += _format_args_and_kwargs(args, kwargs)
  File ".../python3.8/asyncio/format_helpers.py", line 41, in 
_format_args_and_kwargs
return '({})'.format(', '.join(items))
RecursionError: maximum recursion depth exceeded while calling a Python object
Exception in default exception handler
Traceback (most recent call last):
  File ".../python3.8/asyncio/base_events.py", line 1644, in 
call_exception_handler
self.default_exception_handler(context)
  File ".../python3.8/asyncio/base_events.py", line 1615, in 
default_exception_handler
value = repr(value)
  File ".../python3.8/asyncio/base_tasks.py", line 21, in _task_repr_info
info.insert(3, f'wait_for={task._fut_waiter!r}')
  File ".../python3.8/asyncio/base_tasks.py", line 21, in _task_repr_info
info.insert(3, f'wait_for={task._fut_waiter!r}')
  File ".../python3.8/asyncio/base_tasks.py", line 21, in _task_repr_info
info.insert(3, f'wait_for={task._fut_waiter!r}')
  [Previous line repeated 326 more times]
  File ".../python3.8/asyncio/base_tasks.py", line 9, in _task_repr_info
info = base_futures._future_repr_info(task)
  File ".../python3.8/asyncio/base_futures.py", line 57, in _future_repr_info
info.append(_format_callbacks(future._callbacks))
  File ".../python3.8/asyncio/base_futures.py", line 36, in _format_callbacks
cb = '{}, {}'.format(format_cb(cb[0][0]), format_cb(cb[1][0]))
  File ".../python3.8/asyncio/base_futures.py", line 31, in format_cb
return format_helpers._format_callback_source(callback, ())
  File ".../python3.8/asyncio/format_helpers.py", line 23, in 
_format_callback_source
func_repr = _format_callback(func, args, None)
  File ".../python3.8/asyncio/format_helpers.py", line 56, in _format_callback
func_repr += _format_args_and_kwargs(args, kwargs)
  File ".../python3.8/asyncio/format_helpers.py", line 41, in 
_format_args_and_kwargs
return '({})'.format(', '.join(items))
RecursionError: maximum recursion depth exceeded while 

[issue36455] collections.abc.Sequence doesn't support reflection/introspection

2019-03-27 Thread Josh Rosenberg


Change by Josh Rosenberg :


--
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



[issue36455] collections.abc.Sequence doesn't support reflection/introspection

2019-03-27 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

This is an exact duplicate of #35190 - "collections.abc.Sequence cannot be used 
to test whether a class provides a particular interface (doc issue)"

--
nosy: +josh.r
resolution:  -> duplicate
superseder:  -> collections.abc.Sequence cannot be used to test whether a class 
provides a particular interface (doc issue)

___
Python tracker 

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



[issue36455] collections.abc.Sequence doesn't support reflection/introspection

2019-03-27 Thread James Edwards


James Edwards  added the comment:

This was tagged as 3.7, but the issue still exists AFAICT in the latest github 
master: https://github.com/python/cpython/blob/master/Lib/_collections_abc.py

--

___
Python tracker 

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



[issue36455] collections.abc.Sequence doesn't support reflection/introspection

2019-03-27 Thread James Edwards


New submission from James Edwards :

Consider:

from collections.abc import *

class DefinitelyNotAList:
def __init__(self, backer):
self.backer = backer

def __getitem__(self, key):
return self.backer[key]

def __len__(self):
return len(self.backer)

def __contains__(self, needle):
return needle in self.backer

def __reversed__(self):
return reversed(self.backer)

def __iter__(self):
return list.__iter__(self.backer)

def index(self, *args, **kwargs): return self.backer.index(*args, 
**kwargs)

def count(self, *args, **kwargs): return self.backer.count(*args, 
**kwargs)


dnal = DefinitelyNotAList([2,4,6,8])

for abc in [Collection, Reversible, Sized, Iterable, Container, Sequence]:
print(abc.__name__.ljust(12), isinstance(dnal, abc))


Which prints:

Collection   True
Reversible   True
SizedTrue
Iterable True
ContainerTrue
Sequence False

I'm not sure whether this is a bug, a docs bug, or just a misunderstanding but 
my expectation, is that, somehow, I could get isinstance(obj, Sequence) to 
return *without* explicitly registering it, just as True is returned for the 
other abcs.

--
components: Library (Lib)
messages: 339003
nosy: jedwards
priority: normal
severity: normal
status: open
title: collections.abc.Sequence doesn't support reflection/introspection
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



[issue36454] test_time: test_monotonic() failed on AMD64 FreeBSD 10-STABLE Non-Debug 3.7

2019-03-27 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 FreeBSD 10-STABLE Non-Debug 3.7:
https://buildbot.python.org/all/#/builders/170/builds/354

==
FAIL: test_monotonic (test.test_time.TimeTestCase)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.7.koobs-freebsd10.nondebug/build/Lib/test/test_time.py",
 line 474, in test_monotonic
self.assertTrue(0.45 <= dt <= 1.0, dt)
AssertionError: False is not true : 1.0372954378835857

Extract of the test:

def test_monotonic(self):
...

# monotonic() includes time elapsed during a sleep
t1 = time.monotonic()
time.sleep(0.5)
t2 = time.monotonic()
dt = t2 - t1
self.assertGreater(t2, t1)
# Issue #20101: On some Windows machines, dt may be slightly low
self.assertTrue(0.45 <= dt <= 1.0, dt)

...

IMHO the test is too strict. It should not test the maximum value of dt, only 
the minimum.

--
components: Tests
messages: 339002
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_time: test_monotonic() failed on AMD64 FreeBSD 10-STABLE Non-Debug 
3.7
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



Re: The Mailing List Digest Project

2019-03-27 Thread Jason Friedman
On Mon, Mar 25, 2019 at 11:03 PM Abdur-Rahmaan Janhangeer <
arj.pyt...@gmail.com> wrote:

> As proposed on python-ideas, i setup a repo to turn mail threads into
> articles.
>
> i included a script to build .md to .html (with syntax highlighting) here
> is the index
>
> https://abdur-rahmaanj.github.io/py-mailing-list-summary/
>
>  Pretty cool.  FYI, the index page (now containing 4 articles) with Google
Chrome 72.0.3626.x prompts me to translate to French.  The articles
themselves do not.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36085] Enable better DLL resolution

2019-03-27 Thread Eryk Sun


Eryk Sun  added the comment:

> There are no specific "import" tests, because it's such a pain to set 
> those up (I need to delete files from the build directory during the 
> test, and if other tests have already used them that will fail, or I 
> need to copy the Python install elsewhere so it doesn't pick those
> up). 

Instead of copying the whole install, you should be able to symlink the core 
binaries (e.g. python.exe, python38.dll, python3.dll, vcruntime140.dll) to a 
temporary directory and set PYTHONHOME. Most (or at least some) of the build 
bots should be set up to grant the symlink privilege to the current user or all 
standard users, and %TEMP% should be on an NTFS/ReFS volume that supports 
reparse points.

--

___
Python tracker 

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



Re: Getting file extensions [linux fs]

2019-03-27 Thread Paulo da Silva
Às 23:09 de 27/03/19, Cameron Simpson escreveu:
> On 27Mar2019 21:49, Paulo da Silva  wrote:
...
> The filefrag manual entry says it works by calling one of 2 ioctls. You
> can do that from Python with the ioctl() function in the standard fcntl
> module. I haven't tried to do this, but the results should be basicly as
> fast as filefrag itself.
> 
> You'll need to decode the result the ioctl returns of course.
> 
Thanks Cameron, I'll take a look at that.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36451] Docs zh-cn roots error in nav bar

2019-03-27 Thread Ned Deily


Change by Ned Deily :


--
assignee:  -> mdk
components: +Documentation

___
Python tracker 

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



Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Ben Finney
Alexey Muranov  writes:

> It would be however more convenient to be able to write instead just
>
>f(x) = x*x

That's not an anonymous function then, is it? You want to assign a name
to that function, and (to be useful in development tools, such as a
stack trace) the function needs to know its own name.

The way to do that is, as you point out, the ‘def’ statement:

def f(x):
return (x * x)

What does that prevent you from doing? It will need to be pretty
significant improvement to be considered as a change to language syntax.

> Have this idea been discussed before?

Too many times to count :-)

-- 
 \   “Theology is the effort to explain the unknowable in terms of |
  `\ the not worth knowing.” —Henry L. Mencken |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36453] get_importer only return the first valid path_hook(importer)

2019-03-27 Thread Windson Yang


New submission from Windson Yang :

Is it an expected behavior the get_importer function only returns the first 
valid path_hook(importer) from sys.path_hooks?

def get_importer(path_item):
"""Retrieve a finder for the given path item

The returned finder is cached in sys.path_importer_cache
if it was newly created by a path hook.

The cache (or part of it) can be cleared manually if a
rescan of sys.path_hooks is necessary.
"""
try:
importer = sys.path_importer_cache[path_item]
except KeyError:
for path_hook in sys.path_hooks:
try:
importer = path_hook(path_item)
sys.path_importer_cache.setdefault(path_item, importer)
break
except ImportError:
pass
else:
importer = None
return importer

Does the order in sys.path_hooks matters? We should document it if it does. Btw 
get_importer function is lack of test.

--
components: Library (Lib)
messages: 339000
nosy: Windson Yang
priority: normal
severity: normal
status: open
title: get_importer only return the first valid path_hook(importer)
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



Re: configparser - which one?

2019-03-27 Thread Ben Finney
DL Neil  writes:

> After striking this problem, I was encouraged to take a look at JSON,
> and thence YAML. Once there, as they say, didn't look back!
> - multi-dimensional possibilities, cf .ini
> - similarity/correspondence with Python data structures
> - convenient PSL
> - easily adopted by (power-)users, cf Python code

Those are all true.

Drawbacks for YAML as a configuration format:

* Not implemented in Python standard library.

* Not a single, unambiguous standard which all implementations support
  (this may be one reason for no Python standard library implementation).

Despite those, yes I would very much prefer to use YAML as a
configuration format. (ConfigParser INI format is acceptable. JSON is
definitely not, because it has no simple way to put comments in the
file.)

-- 
 \  “In the long run, the utility of all non-Free software |
  `\  approaches zero. All non-Free software is a dead end.” —Mark |
_o__)Pilgrim, 2006 |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-27 Thread miss-islington


miss-islington  added the comment:


New changeset 1ff04dcadfb57a8a8f61a6ea93292e8ae96dca4a by Miss Islington (bot) 
in branch '3.7':
bpo-36245: Fix more empty environment variable checks (GH-12592)
https://github.com/python/cpython/commit/1ff04dcadfb57a8a8f61a6ea93292e8ae96dca4a


--

___
Python tracker 

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



Re: Your IDE's?

2019-03-27 Thread Ben Finney
Mr Zaug  writes:

> On Monday, March 25, 2019 at 5:38:41 PM UTC-4, John Doe wrote:
> > What is your favorite Python IDE?
>
> "Your IDE's?" is not a question

It is a topic for discussion though. Hence, appropriate for the Subject
field. Especially because he then wrote a full sentence question in the
message body.

> nor is any word in English made plural with an apostrophe  s.

Bob the Angry Flower agrees http://www.angryflower.com/247.html>.

-- 
 \  “The history of Western science confirms the aphorism that the |
  `\ great menace to progress is not ignorance but the illusion of |
_o__)knowledge.” —Daniel J. Boorstin, historian, 1914–2004 |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36448] Message "You will need to rebuild pythoncore to see the changes" should mention "make regen-all"

2019-03-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> For some reason, the Travis CI build on 
> https://github.com/python/cpython/pull/12582 isn't actually starting. It says 
> "Waiting for status to be reported" but I pushed 10 hours ago.

Travis CI had some problem with linux builds

https://www.traviscistatus.com

--
nosy: +xtreak

___
Python tracker 

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



[issue36452] Detect dict iteration "overflow" when changing keys

2019-03-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +inada.naoki, rhettinger

___
Python tracker 

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



[issue36452] Detect dict iteration "overflow" when changing keys

2019-03-27 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +12539
stage:  -> patch review

___
Python tracker 

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



[issue36452] Detect dict iteration "overflow" when changing keys

2019-03-27 Thread Thomas Perl


New submission from Thomas Perl :

Using: Python 3.8 (git commit ID: d5a5a33f12b60129d57f9b423b77d2fcba506834), 
the following code snippet:

=
a = {0: 0}

for i in a:
del a[i]
a[i+1] = 0
print(i)
=

Prints the following output:

=
0
1
2
3
4
=

The reason for this seems to be the way the internal key list is managed and 
the "next" value in this list is retrieved. The amount of items seems to be 
related to USABLE_FRACTION(PyDict_MINSIZE).

Since cases where the dictionary size changes are detected with a RuntimeError, 
I would expect the invariant to be "the number of iterations is the len() of 
the dict at the time the iterator is created to be enforced. Whether to raise a 
StopIteration instead or raising a RuntimeError is up for debate.

Attached is a patch that tries to detect this corner case and raise a 
RuntimeError instead (plus a unit test).

Note also that without the patch, the __length_hint__() of the iterator 
actually underflows:

=
a = {0: 0}
it = iter(a)
print('Length hint:', it.__length_hint__())
next(it)
print('Length hint:', it.__length_hint__())
del a[0]
a[1] = 0
next(it)
print('Length hint:', it.__length_hint__())
=

--
files: 0001-dictiterobject-Track-maximum-iteration-count-via-di-.patch
keywords: patch
messages: 338997
nosy: thomas.perl
priority: normal
severity: normal
status: open
title: Detect dict iteration "overflow" when changing keys
type: behavior
versions: Python 3.8
Added file: 
https://bugs.python.org/file48234/0001-dictiterobject-Track-maximum-iteration-count-via-di-.patch

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-27 Thread Steve Dower


Change by Steve Dower :


--
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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12538

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-27 Thread Steve Dower


Steve Dower  added the comment:


New changeset bb89aa24cf71f9874d1d26f3a2440fefa0b6bbcc by Steve Dower in branch 
'2.7':
bpo-36245: Avoid problems when building in a directory containing spaces. 
(GH-12241)
https://github.com/python/cpython/commit/bb89aa24cf71f9874d1d26f3a2440fefa0b6bbcc


--

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-27 Thread Steve Dower


Steve Dower  added the comment:


New changeset b95a79c928fc4a6135d91c0c553cb2a63cf15140 by Steve Dower in branch 
'master':
bpo-36245: Fix more empty environment variable checks (GH-12592)
https://github.com/python/cpython/commit/b95a79c928fc4a6135d91c0c553cb2a63cf15140


--

___
Python tracker 

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



[issue36085] Enable better DLL resolution

2019-03-27 Thread Steve Dower


Steve Dower  added the comment:

I implemented the feature Eryk was asking for, as it's also by far the easiest 
way to test the add_dll_directory function. So now ctypes.CDLL (and subclasses) 
have a `winmode` argument that gets turned directly into LoadLibraryEx flags 
(changing `mode` would have required a deprecation period, as it's explicitly 
documented as being ignored on Windows).

I believe the docs are updated as much as necessary, but if I missed something 
please call out.

There are no specific "import" tests, because it's such a pain to set those up 
(I need to delete files from the build directory during the test, and if other 
tests have already used them that will fail, or I need to copy the Python 
install elsewhere so it doesn't pick those up). But with ctypes I can exclude 
the application directory from the search paths. Open to brilliant ideas here.

--

___
Python tracker 

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



[issue36451] Docs zh-cn roots error in nav bar

2019-03-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I guess it will be fixed with https://bugs.python.org/issue36425

--
nosy: +mdk, xtreak, zhsj

___
Python tracker 

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



Re: Getting file extensions [linux fs]

2019-03-27 Thread Cameron Simpson

On 27Mar2019 21:49, Paulo da Silva  wrote:

I don't know if this is the right group to ask ... sorry if it isn't.

Is there a way to get the file extensions of a file in linux, the same
way as "filefrag -e " does?

The purpose is to see if two files are the same file, namely those
copied with the --reflink option in btrfs.

A solution for C is also welcome - I can write a small python extension
to handle that.

BTW, executing filefrag from python is not a solution, because I have
lots of files and that would be too slow.


The filefrag manual entry says it works by calling one of 2 ioctls. You 
can do that from Python with the ioctl() function in the standard fcntl 
module. I haven't tried to do this, but the results should be basicly as 
fast as filefrag itself.


You'll need to decode the result the ioctl returns of course.

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue36451] Docs zh-cn roots error in nav bar

2019-03-27 Thread Solo Lee


New submission from Solo Lee :

There is no link to zh-cn docs in python docs page, as in the file upload.
Thx!

--
files: python docs en page.png
messages: 338992
nosy: Solo Lee
priority: normal
severity: normal
status: open
title: Docs zh-cn roots error in nav bar
type: behavior
Added file: https://bugs.python.org/file48233/python docs en page.png

___
Python tracker 

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



Re: Your IDE's?

2019-03-27 Thread Cameron Simpson

On 27Mar2019 10:55, Anssi Saari  wrote:

Ben Finney  writes:

Emacs and a shell multiplexer (today, that's GNU Screen, but others
swear that I should try TMux).


I've actually been using tmux for a while. The only reason and the only
thing I can think of that it does and screen doesn't is that tmux can
display italic text and screen apparently can't. So I went with tmux for
Usenet.

Well, there were some claims from tmux about it being a better terminal
but I can't really see a difference.


I find the tmux command line far more regular and flexible. Screen's 
option set is ... weird and complex and has clearly just grown over 
time. Tmux is far better there.


It also has more features: panes within windows, etc. I rarely use that 
(I use panes in my terminal emulator heavily though), although my mutt 
composition mode uses a tmux pane for the composition so I still have 
access to the main index above it.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue31327] bug in dateutil\tz\tz.py

2019-03-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue31327] bug in dateutil\tz\tz.py

2019-03-27 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
stage:  -> needs patch
versions: +Python 3.7, Python 3.8 -Python 3.6

___
Python tracker 

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



[issue33953] The DEFAULT_ENTROPY variable used to store the current default random bytes value should be documented for `secrets` module

2019-03-27 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
nosy: +rhettinger
versions:  -Python 3.6

___
Python tracker 

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



[issue31292] `python setup.py check --restructuredtext` fails when a include directive is present.

2019-03-27 Thread miss-islington


miss-islington  added the comment:


New changeset 9cad523328324bd82fa19b597ead1614a0e61ae2 by Miss Islington (bot) 
in branch '3.7':
bpo-31292: Fixed distutils check --restructuredtext for include directives 
(GH-10605)
https://github.com/python/cpython/commit/9cad523328324bd82fa19b597ead1614a0e61ae2


--

___
Python tracker 

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



[issue31292] `python setup.py check --restructuredtext` fails when a include directive is present.

2019-03-27 Thread miss-islington


miss-islington  added the comment:


New changeset 600aca47f085a06579e7af4c6423ea7e907b4bb4 by Miss Islington (bot) 
in branch '2.7':
bpo-31292: Fixed distutils check --restructuredtext for include directives 
(GH-10605)
https://github.com/python/cpython/commit/600aca47f085a06579e7af4c6423ea7e907b4bb4


--
nosy: +miss-islington

___
Python tracker 

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



Create GUI with Python using Tkinter | Youtube Playlist

2019-03-27 Thread Attreya Bhatt
In this series of 30 videos we learn how to create a Music Player from scratch 
using Python.

Youtube Playlist - 
https://www.youtube.com/playlist?list=PLhTjy8cBISEp6lNKUO3iwbB1DKAkRwutl
-- 
https://mail.python.org/mailman/listinfo/python-list


Getting file extensions [linux fs]

2019-03-27 Thread Paulo da Silva
Hi!

I don't know if this is the right group to ask ... sorry if it isn't.

Is there a way to get the file extensions of a file in linux, the same
way as "filefrag -e " does?

The purpose is to see if two files are the same file, namely those
copied with the --reflink option in btrfs.

A solution for C is also welcome - I can write a small python extension
to handle that.

BTW, executing filefrag from python is not a solution, because I have
lots of files and that would be too slow.

Thanks for any help. Anyway, as last resource, I can always look at
filefrag source. I am just trying to avoid that.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31292] `python setup.py check --restructuredtext` fails when a include directive is present.

2019-03-27 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Thanks @flying sheep for the PR and @merwok for the review!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 2.7, Python 3.8 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue36448] Message "You will need to rebuild pythoncore to see the changes" should mention "make regen-all"

2019-03-27 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> As an aside, I thought we had a merge hook to check this on Travis?

For some reason, the Travis CI build on 
https://github.com/python/cpython/pull/12582 isn't actually starting. It says 
"Waiting for status to be reported" but I pushed 10 hours ago...

--

___
Python tracker 

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



[issue31292] `python setup.py check --restructuredtext` fails when a include directive is present.

2019-03-27 Thread Cheryl Sabella


Cheryl Sabella  added the comment:


New changeset d5a5a33f12b60129d57f9b423b77d2fcba506834 by Cheryl Sabella 
(Philipp A) in branch 'master':
bpo-31292: Fixed distutils check --restructuredtext for include directives 
(GH-10605)
https://github.com/python/cpython/commit/d5a5a33f12b60129d57f9b423b77d2fcba506834


--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue31292] `python setup.py check --restructuredtext` fails when a include directive is present.

2019-03-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12537

___
Python tracker 

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



[issue31292] `python setup.py check --restructuredtext` fails when a include directive is present.

2019-03-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12536

___
Python tracker 

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



Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Terry Reedy

On 3/27/2019 4:21 AM, Alexey Muranov wrote:
Whey you need a simple function in Python, there is a choice between a 
normal function declaration and an assignment of a anonymous function 
(defined by a lambda-expression) to a variable:


    def f(x): return x*x

or

    f = lambda x: x*x


PEP 8 properly recommends against this the latter as functionally it has 
no advantage and the disadvantage that f.__name__ becomes the generic 
'' instead of the specific 'f'.  This is not useful for code 
that expects specific names.  Tracebacks are one example.  Here is 
another intended to list callable objects and their types.


def call_clas(container):
for item in vars(container).values():
if hasattr(item, '__call__'):
yield item.__name__, item.__class__

def print_cc(container):
for name, clas in call_clas(container):
print(f'{name:30s}{clas}')

# Examples.
print_cc(int)
from idlelib import pyshell
print_cc(pyshell)

Multiple output lines of '   function' defeat the 
purpose.


So my opinion is that lambda expressions should only be used within 
larger expressions and never directly bound.



It would be however more convenient to be able to write instead just

    f(x) = x*x


Given my view above, this is, standing alone, strictly an abbreviation 
of the equivalent def statement.  I am presuming that a proper 
implementation would result in f.__name__ == 'f'.


Is the convenience and (very low) frequency of applicability worth the 
inconvenience of confusing the meaning of '=' and complicating the 
implementation?



I do not see any conflicts with the existing syntax.


It heavily conflicts with existing syntax.  The current meaning of
  target_expression = object_expression
is
1. Evaluate object_expression in the existing namespace to an object, 
prior to any new bindings and independent of the target_expression.
2. Evaluate target_expression in the existing namespace to one or more 
targets.

3. Bind object to target or iterate target to bind to multiple targets.

Part of step 2 is making calls, because calls cannot be targets.  This 
is why 'f(a+b)[c] = d' can work.  Note that 'a+b' makes calls to 
a.__add__ or b.__radd__ or both.


In the proposal, the treatment of the object expression would depend on 
the target expression and the alternative would be to quote it as code; 
compile the code in a manner that depends on the target expression to 
mark local names versus global names; and finally make a function 
instance, presumably taking __name__ from the target.


This would have the advantage over lambda assignment of getting the name 
right, but I don't think one should be doing lambda assignment anyway. 
There is a good reason to have a separate syntax.


Before 3.8, I would stop here and say no to the proposal.  But we now 
have assignment expressions in addition to assignment statements.


>>> int(s:='42'+'742')
42742
>>> s
'42742'

To me, function assignment expressions, as a enhanced replacement for 
lambda expressions, is more inviting than function assignment statements 
as an abbreviation for function definition statements.


In other words, replace

  map(lambda x: x*x, range(10))

with

  map(square(x):=x*x, range(10))

or, if one does not want a specific name,

  map(_(x):=x*x, range(10))

Many people dislike lambda expressions, to the point that Guido 
considered leaving them out of 3.x.  So this replacement might get more 
traction.  It would make assignment expressions much more useful.


--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


Re: Your IDE's?

2019-03-27 Thread Mr Zaug
On Monday, March 25, 2019 at 5:38:41 PM UTC-4, John Doe wrote:
> What is your favorite Python IDE?

"Your IDE's?" is not a question, nor is any word in English made plural with an 
apostrophe  s.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36373] asyncio.gather: no docs for deprecated loop parameter

2019-03-27 Thread dtrauma


dtrauma  added the comment:

Yes, exactly, document deprecation status XOR what it does :)

--

___
Python tracker 

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



[issue36373] asyncio.gather: no docs for deprecated loop parameter

2019-03-27 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

@dtrauma jus for clarify. You say that if loop is not deprecated document it 
else document it.


Right?

--

___
Python tracker 

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



[issue36373] asyncio.gather: no docs for deprecated loop parameter

2019-03-27 Thread dtrauma


dtrauma  added the comment:

Just to be clear, I don't know if loop is deprecated on this function like on 
all the others, I just suspect it to be. But it currently is completely 
undocumented, which either way is a bug. :)

--

___
Python tracker 

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



[issue36448] Message "You will need to rebuild pythoncore to see the changes" should mention "make regen-all"

2019-03-27 Thread Steve Dower


Steve Dower  added the comment:

So an important aspect of the "fix" is that this message only appears after the 
fix has been applied. Anyone running into this locally has already updated 
those files, and just needs to "git add -u" to include them in their next 
commit. (Unfortunately, MSBuild has no reasonable way to retrigger a build it 
has already completed, since that introduces cycles into its dependency 
resolution.)

The problem here is that when a non-Windows developer sees this error in CI, 
it's not clear what *they* should do about it.

The current text is: "@(_Updated->'%(Filename)%(Extension)',', ') updated. You 
will need to rebuild pythoncore to see the changes."

The PR adds: "You may also need to run 'make regen-all'."

I'd propose adding "%0D%0A%0D%0AIf you are developing on another platform, try 
make regen-all and commit the updated files"

(The %0D%0A's at the start add newlines to the output for readability.)

As an aside, I thought we had a merge hook to check this on Travis? Why didn't 
that trigger? There's no reason why any of our CI platforms should let you 
build with out-of-date frozens, so it's a bit of a shame to blame the Windows 
build for doing its job properly :)

--
versions: +Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Alexey Muranov

On mer., Mar 27, 2019 at 5:00 PM, python-list-requ...@python.org wrote:

On 27/03/19 09:21, Alexey Muranov wrote:
 Whey you need a simple function in Python, there is a choice 
between a
 normal function declaration and an assignment of a anonymous 
function

 (defined by a lambda-expression) to a variable:

def f(x): return x*x

 or

f = lambda x: x*x

 It would be however more convenient to be able to write instead just

f(x) = x*x

 (like in Haskell and such).

 Have this idea been discussed before?

 I do not see any conflicts with the existing syntax.   The following
 would also work:


I don't know. Something like the following is already legal:

f(x)[n] = x * n

And it does something completly different.



Thanks for pointing out this example, but so far i do not see any issue 
with this.


Of course assignment (to an identifier) is a completely different type 
of operation than in-place mutation (of an object) with __setitem__, 
etc.


In

   <...> [<...>] = <...>

the part to the left of "[<...>]=" is an expression that is to be 
evaluated, and only its value matters.  Here "[]=" can be viewed as a 
method call, which is distinguished by the context from "[]" method 
call (__getitem__).


In

= <...>

the  is not evaluated.

I still think that

   ()...() = <...>

is unambiguous.  The following seems possible too:

   a[m][n](x)(y) = m*x + n*y

It would be the same as

   a[m][n] = lambda x: lambda y: m*x + n*y

Here a[m] is evaluated, and on the result the method "[]=" 
(__setitem__) is called.


Basically, "()...()=" seems to technically fit all contexts where "=" 
fits...


Alexey.


--
https://mail.python.org/mailman/listinfo/python-list


Library for parsing binary structures

2019-03-27 Thread Paul Moore
I'm looking for a library that lets me parse binary data structures.
The stdlib struct module is fine for simple structures, but when it
gets to more complicated cases, you end up doing a lot of the work by
hand (which isn't that hard, and is generally perfectly viable, but
I'm feeling lazy ;-))

I know of Construct, which is a nice declarative language, but it's
either weak, or very badly documented, when it comes to recursive
structures. (I really like Construct, and if I could only understand
the docs better I may well not need to look any further, but as it is,
I can't see anything showing how to do recursive structures...) I am
specifically trying to parse a structure that looks something like the
following:

Multiple instances of:
  - a type byte
  - a chunk of data structured based on the type
types include primitives like byte, integer, etc, as well as
(type byte, count, data) - data is "count" occurrences of data of
the given type.

That last one is a list, and yes, you can have lists of lists, so the
structure is recursive.

Does anyone know of any other binary data parsing libraries, that can
handle recursive structures reasonably cleanly?

I'm already *way* past the point where it would have been quicker for
me to write the parsing code by hand rather than trying to find a
"quick way", so the questions, honestly mostly about finding out what
people recommend for jobs like this rather than actually needing
something specific to this problem. But I do keep hitting the need to
parse binary structures, and having something in my toolbox for the
future would be really nice.

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


asyncio KeyboardInterrupt in select

2019-03-27 Thread Thomas Grainger
It seems quite easy to cause asyncio to deadlock:

  File "/usr/lib/python3.6/asyncio/base_events.py", line 1404, in _run_once
event_list = self._selector.select(timeout)
  File "/usr/lib/python3.6/selectors.py", line 445, in select
fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt
^CError in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 40, in
_python_exit
t.join()
  File "/usr/lib/python3.6/threading.py", line 1056, in join
self._wait_for_tstate_lock()
  File "/usr/lib/python3.6/threading.py", line 1072, in
_wait_for_tstate_lock
elif lock.acquire(block, timeout):

and you get a lot of hits for this exception on google:
https://www.google.com/search?q=File+
"/usr/lib/python3.6/selectors.py",+line+445,+in+select+fd_event_list+%3D+self._epoll.poll(timeout,+max_ev)+KeyboardInterrupt=0

Thomas Grainger
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-03-27 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

To clarify: the purpose of MyList is specifically to check that no double 
deallocations occur. For this test to make sense, MyList should not use the 
trashcan itself.

--

___
Python tracker 

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



[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-03-27 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

Yes of course. When not using the trashcan, stuff crashes. I don't get your 
point...

--

___
Python tracker 

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



[issue36443] Disable coerce_c_locale and utf8_mode by default in _PyPreConfig?

2019-03-27 Thread STINNER Victor


STINNER Victor  added the comment:

Done. I close the issue.

--
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



[issue36202] Calling Py_DecodeLocale() before _PyPreConfig_Write() can produce mojibake

2019-03-27 Thread STINNER Victor


STINNER Victor  added the comment:

My commit disabled C locale coercion and UTF-8 Mode by default when Python is 
embedded which fix this issue in Python 3.8. I close the issue.

--
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



[issue36202] Calling Py_DecodeLocale() before _PyPreConfig_Write() can produce mojibake

2019-03-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d929f1838a8fba881ff0148b7fc31f6265703e3d by Victor Stinner in 
branch 'master':
bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589)
https://github.com/python/cpython/commit/d929f1838a8fba881ff0148b7fc31f6265703e3d


--

___
Python tracker 

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



[issue36443] Disable coerce_c_locale and utf8_mode by default in _PyPreConfig?

2019-03-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d929f1838a8fba881ff0148b7fc31f6265703e3d by Victor Stinner in 
branch 'master':
bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589)
https://github.com/python/cpython/commit/d929f1838a8fba881ff0148b7fc31f6265703e3d


--

___
Python tracker 

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



[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-03-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Disabling the trashcan mechanism returns the problem for solving which the 
trashcan mechanism was introduced.

>>> from _testcapi import MyList
>>> L = None
>>> for i in range(100):
... L = MyList((L,))
... 
>>> del L
Segmentation fault (core dumped)

I think we need better way to resolve this issue.

For example, setting the object type to the parent type should solve this issue.

--

___
Python tracker 

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



[issue36273] test_thread leaks a core dump on PPC64 AIX 3.x

2019-03-27 Thread Michael Felt


Michael Felt  added the comment:

I have looked at this briefly.

I would consider it a regression, or a spurious incident as the bot run before 
(https://buildbot.python.org/all/#/builders/10/builds/2223) and after 
(https://buildbot.python.org/all/#/builders/10/builds/2225) do not show this 
error. It may also be spurious - as there are other users on that bot system 
and the cause could be a side-effect of something else.

FYI: The error message is something similar to what I see when building using 
xlc - there is a core dump - but I cannot get a copy of the core dump to 
evaluate it.

See: https://bugs.python.org/issue35828#msg336134 - where I ask for a hint on 
how to get the code that reports the ENV change to save/copy a core dump.

--

___
Python tracker 

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



Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Alexandre Brault
On 2019-03-27 10:42 a.m., Paul Moore wrote:
> On Wed, 27 Mar 2019 at 12:27, Alexey Muranov  wrote:
>> On mer., mars 27, 2019 at 10:10 AM, Paul Moore 
>> wrote:
>>> On Wed, 27 Mar 2019 at 08:25, Alexey Muranov
>>>  wrote:
  Whey you need a simple function in Python, there is a choice
 between a
  normal function declaration and an assignment of a anonymous
 function
  (defined by a lambda-expression) to a variable:

  def f(x): return x*x

  or

  f = lambda x: x*x

  It would be however more convenient to be able to write instead just

  f(x) = x*x
>>> Why? Is saving a few characters really that helpful? So much so that
>>> it's worth adding a *third* method of defining functions, which would
>>> need documenting, adding to training materials, etc, etc?
>> Because i think i would prefer to write it this way.
> That's not likely to be sufficient reason for changing a language
> that's used by literally millions of people.
>
>> (Almost no new documentation or tutorials would be needed IMHO.)
> Documentation would be needed to explain how the new construct worked,
> for people who either wanted to use it or encountered it in other
> people's code. While it may be obvious to you how it works, it likely
> won't be to others, and there will probably be edge cases you haven't
> considered that others will find and ask about.

For what it's worth, if I encountered "f(x) = x * x" in code, my first
thought would be that Python somehow added a way to return an assignable
reference from a function, rather than this being an anonymous function
declaration.

So documentation of that syntax would 100% be required

Alex

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Rhodri James

On 27/03/2019 16:15, Bev in TX wrote:



On Mar 27, 2019, at 10:41 AM, Antoon Pardon  wrote:

I don't know. Something like the following is already legal:

f(x)[n] = x * n

And it does something completly different.


Where would I find information on what this does in the documentation?


Nowhere in particular, it's a consequence of putting things together. 
The part that Antoon isn't mentioning is that he's presuming the 
function f(x) returns a list or something similar that we can then 
index.  You're more likely to see that sort of code written as:


a = f(x)
a[n] = x *n

which makes it look a lot less magical.

--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Bev in TX


> On Mar 27, 2019, at 10:41 AM, Antoon Pardon  wrote:
> 
> I don't know. Something like the following is already legal:
> 
> f(x)[n] = x * n
> 
> And it does something completly different.

Where would I find information on what this does in the documentation?
Bev in TX




-- 
https://mail.python.org/mailman/listinfo/python-list


[issue20271] urllib.parse.urlparse() accepts wrong URLs

2019-03-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also issue36338 for a possible security issue for host of value 
"benign.com[attacker.com]" (spam[::1] format) where attacker.com is parsed as 
the host name assuming presence of [ and ] to be a IPV6 address without 
validation of the value attacker.com inside [] to be a valid IPV6 address.

As a datapoint input "http://[::1]spam; raises exception in Java, golang and 
Ruby. Browser's JS console returns invalid URL. I too would like exception 
being raised but not sure at which level.

Ruby seems to use a regex : 
https://github.com/ruby/ruby/blob/trunk/lib/uri/rfc3986_parser.rb#L6
Java parseurl : 
http://hg.openjdk.java.net/jdk/jdk/file/c4c225b49c5f/src/java.base/share/classes/java/net/URLStreamHandler.java#l124
golang : 
https://github.com/golang/go/blob/50bd1c4d4eb4fac8ddeb5f063c099daccfb71b26/src/net/url/url.go#L587

See also https://url.spec.whatwg.org/#host-parsing

If input starts with U+005B ([), then:

If input does not end with U+005D (]), validation error, return failure.

Return the result of IPv6 parsing input with its leading U+005B ([) and 
trailing U+005D (]) removed.

--
nosy: +xtreak
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



[issue36338] urlparse of urllib returns wrong hostname

2019-03-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I found this page to be uesful : https://url.spec.whatwg.org/#host-parsing and 
following the steps it seems that this should raise an error since at the 7th 
step it denotes that asciiDomain shouldn't contain forbidden host code point 
including "[]" . As another data point using 'new 
URL("http://benign.com[attacker.com];)' in browser's Javascript console also 
raises exception that this is a bad URL. Even if attacker.com is assumed to be 
the correct host by Python it's not validated to be an IPV6 address where it 
should fail.

Ruby seems to use a regex : 
https://github.com/ruby/ruby/blob/trunk/lib/uri/rfc3986_parser.rb#L6
Java parseurl : 
http://hg.openjdk.java.net/jdk/jdk/file/c4c225b49c5f/src/java.base/share/classes/java/net/URLStreamHandler.java#l124
golang : 
https://github.com/golang/go/blob/50bd1c4d4eb4fac8ddeb5f063c099daccfb71b26/src/net/url/url.go#L587

--

___
Python tracker 

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



[issue33356] Windows 10 buildbot: test__xxsubinterpreters.test_already_running() fails randomly

2019-03-27 Thread STINNER Victor


STINNER Victor  added the comment:

The bug is still here. It looks like a race condition triggered on very slow 
buildbot like AMD64 FreeBSD 10-STABLE Non-Debug 3.x:

https://buildbot.python.org/all/#/builders/167/builds/728

0:18:13 load avg: 4.84 [405/420/1] test__xxsubinterpreters failed -- running: 
test_tools (6 min 1 sec)
spam
test_bad_id (test.test__xxsubinterpreters.ChannelIDTests) ... ok
(...)
test_initial (test.test__xxsubinterpreters.ListAllTests) ... ok
test_SystemExit (test.test__xxsubinterpreters.RunStringTests) ... ok
test_already_running (test.test__xxsubinterpreters.RunStringTests) ... FAIL
test_bad_id (test.test__xxsubinterpreters.RunStringTests) ... Exception in 
thread Thread-9:
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/threading.py",
 line 917, in _bootstrap_inner
self.run()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/threading.py",
 line 865, in run
self._target(*self._args, **self._kwargs)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test__xxsubinterpreters.py",
 line 51, in run
interpreters.run_string(interp, dedent(f"""
RuntimeError: interpreter already running

ok
test_bad_script (test.test__xxsubinterpreters.RunStringTests) ... ok
test_bytes_for_script (test.test__xxsubinterpreters.RunStringTests) ... ok
(...)

==
FAIL: test_already_running (test.test__xxsubinterpreters.RunStringTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test__xxsubinterpreters.py",
 line 855, in test_already_running
interpreters.run_string(self.id, 'print("spam")')
AssertionError: RuntimeError not raised

--

Ran 112 tests in 12.936s

FAILED (failures=1, skipped=5)
test test__xxsubinterpreters failed
(...)
Re-running test 'test__xxsubinterpreters' in verbose mode
(...)
Ran 112 tests in 3.058s
OK (skipped=5)

--
nosy: +pablogsal
resolution: out of date -> 
status: closed -> open

___
Python tracker 

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



[issue36441] Cannot create venv with debug binaries installed

2019-03-27 Thread miss-islington


miss-islington  added the comment:


New changeset 65445f65e6080310d612f73083ba172eb2c6e326 by Miss Islington (bot) 
in branch '3.7':
bpo-36441: Fixes creating a venv when debug binaries are installed. (GH-12566)
https://github.com/python/cpython/commit/65445f65e6080310d612f73083ba172eb2c6e326


--
nosy: +miss-islington

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-27 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +12535

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-27 Thread Steve Dower


Steve Dower  added the comment:

I did the 2.7 backport, and also fixed two more instances in that file.

Pretty sure my automerges won't work without a core dev review, so if someone 
wants to hit Approve and/or Merge for me, feel free.

--

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-27 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +12534
stage: backport needed -> patch review

___
Python tracker 

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



Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Antoon Pardon
On 27/03/19 09:21, Alexey Muranov wrote:
> Whey you need a simple function in Python, there is a choice between a
> normal function declaration and an assignment of a anonymous function
> (defined by a lambda-expression) to a variable:
>
>    def f(x): return x*x
>
> or
>
>    f = lambda x: x*x
>
> It would be however more convenient to be able to write instead just
>
>    f(x) = x*x
>
> (like in Haskell and such).
>
> Have this idea been discussed before?
>
> I do not see any conflicts with the existing syntax.   The following
> would also work:

I don't know. Something like the following is already legal:

f(x)[n] = x * n

And it does something completly different.

-- 
Antoon Pardon.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36450] 3D Array Assignment to all 2D sub-arrays

2019-03-27 Thread Eric Snow


Eric Snow  added the comment:

In Python, multiplication on a list does not make copies of the values in the 
original list.  So what you have done is equivalent to the following:

  a = [0, 0]
  b = [a, a]
  M = [b, b]

Hence:

  >>> M[0] is M[1]
  True
  >>> M[0][0] is M[0][1]
  True
  >>> M[1][0] is M[1][1]
  True
  >>> M[0][0] is M[1][0]
  True

So the following *all* modify the first value in "a":

  M[0][0][0] = 1
  M[1][0][0] = 1
  M[0][1][0] = 1
  M[1][1][0] = 1

That is why you are seeing the result you reported.  Depending on your needs, 
better solutions include using a list comprehension, spelling out the for loops 
(for readability), a helper function (for complex problems), or simply spelling 
out the full list literal instead of composing it.  Regardless, I highly 
recommend using a solution that is easy for a new reader to understand.  Even 
if no one else will read this code, your six-months-from-now self will thank 
you. :)

--
nosy: +eric.snow
resolution:  -> not a bug
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



[issue33261] inspect.isgeneratorfunction fails on hand-created methods

2019-03-27 Thread Petr Viktorin


Petr Viktorin  added the comment:

I just reviewed, and I plan to merge it if I don't see any pushback from the 
others.
Sorry for the extreme delay.

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue32312] Create Py_AtExitRegister C API

2019-03-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This may be especially useful to make sure that extension modules that have 
threads that were not created by Python calling into Python (registering with 
the interpreter and picking up the GIL) are stopped before the interpreter 
starts shutting down to avoid callbacks in the middle of the tear-down 
procedure.

--

___
Python tracker 

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



[issue36441] Cannot create venv with debug binaries installed

2019-03-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12533

___
Python tracker 

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



[issue36441] Cannot create venv with debug binaries installed

2019-03-27 Thread Steve Dower


Steve Dower  added the comment:


New changeset 4a9a505d6f2474a570422dad89f8d1b344d6cd36 by Steve Dower in branch 
'master':
bpo-36441: Fixes creating a venv when debug binaries are installed. (#12566)
https://github.com/python/cpython/commit/4a9a505d6f2474a570422dad89f8d1b344d6cd36


--

___
Python tracker 

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



[issue32312] Create Py_AtExitRegister C API

2019-03-27 Thread Eric Snow


Eric Snow  added the comment:

> Neil Schemenauer  added the comment:
> Regarding m_traverse, maybe the list of finalizers should be stored somewhere 
> in the interpreter
> state, not in the atexit module state.  That would make more sense to me.  
> atexit could merely be
> a way to manage it rather than actually holding it.

+1

--
nosy: +eric.snow

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2019-03-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f4333d0479d6974d142e858522e95cbf8381f016 by Victor Stinner 
(hliu0) in branch 'master':
bpo-31904: Fix test_utf8_mode on VxWorks (GH-12428)
https://github.com/python/cpython/commit/f4333d0479d6974d142e858522e95cbf8381f016


--

___
Python tracker 

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



[issue36450] 3D Array Assignment to all 2D sub-arrays

2019-03-27 Thread John Bachman


Change by John Bachman :


--
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



[issue36444] Python initialization: remove _PyMainInterpreterConfig

2019-03-27 Thread STINNER Victor


Change by STINNER Victor :


--
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



[issue36450] 3D Array Assignment to all 2D sub-arrays

2019-03-27 Thread John Bachman


New submission from John Bachman :

Tested on Python3.6 on Ubuntu 18.04
The following code snippet produces the wrong results.

Snippet:

M = [[[0] * 2] * 2] * 2 
   
M[0][0][0] = 1  

   
print(M[0][0][0]) # Should be one   
   
print(M[1][0][0]) # Should still be zero 

My output:
1
1

For some reason when you assign to any list inside the 3D matrix, all lists in 
the array are changed, 2D Matrix works but 3D modifies every 2D matrix.

--
components: Interpreter Core
messages: 338963
nosy: John Bachman
priority: normal
severity: normal
status: open
title: 3D Array Assignment to all 2D sub-arrays
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue36443] Disable coerce_c_locale and utf8_mode by default in _PyPreConfig?

2019-03-27 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue36202] Calling Py_DecodeLocale() before _PyPreConfig_Write() can produce mojibake

2019-03-27 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Paul Moore
On Wed, 27 Mar 2019 at 12:27, Alexey Muranov  wrote:
>
> On mer., mars 27, 2019 at 10:10 AM, Paul Moore 
> wrote:
> > On Wed, 27 Mar 2019 at 08:25, Alexey Muranov
> >  wrote:
> >>
> >>  Whey you need a simple function in Python, there is a choice
> >> between a
> >>  normal function declaration and an assignment of a anonymous
> >> function
> >>  (defined by a lambda-expression) to a variable:
> >>
> >>  def f(x): return x*x
> >>
> >>  or
> >>
> >>  f = lambda x: x*x
> >>
> >>  It would be however more convenient to be able to write instead just
> >>
> >>  f(x) = x*x
> >
> > Why? Is saving a few characters really that helpful? So much so that
> > it's worth adding a *third* method of defining functions, which would
> > need documenting, adding to training materials, etc, etc?
>
> Because i think i would prefer to write it this way.

That's not likely to be sufficient reason for changing a language
that's used by literally millions of people.

> (Almost no new documentation or tutorials would be needed IMHO.)

Documentation would be needed to explain how the new construct worked,
for people who either wanted to use it or encountered it in other
people's code. While it may be obvious to you how it works, it likely
won't be to others, and there will probably be edge cases you haven't
considered that others will find and ask about.

Your interest in improving the language is great, but there are a
great many practical considerations in any change, and if you actually
want your idea to progress, you'll need to be prepared to address
those.

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-03-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35900] Add pickler hook for the user to customize the serialization of user defined functions and types.

2019-03-27 Thread Pierre Glaser


Change by Pierre Glaser :


--
pull_requests: +12530

___
Python tracker 

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



[issue31341] remove IRIX support code

2019-03-27 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
pull_requests: +12529

___
Python tracker 

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



[issue16995] Add Base32 support for RFC4648 "Extended Hex" alphabet (patch attached)

2019-03-27 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Is there interest in having this patch converted to a pull request?

--
nosy: +cheryl.sabella
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



Re: Your IDE's?

2019-03-27 Thread Grant Edwards
On 2019-03-25, John Doe  wrote:

> What is your favorite Python IDE?

Unix+Emacs

I sometimes wish that Emacs had a better code folding mode when
browsing other people's code, but the editors I've tried that do have
nice code-folding fall down at too many other tasks.

-- 
Grant Edwards   grant.b.edwardsYow! Was my SOY LOAF left
  at   out in th'RAIN?  It tastes
  gmail.comREAL GOOD!!

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36446] Need Windows x86-64 MSI installer for Python >= 3.x.x

2019-03-27 Thread Zachary Ware


Zachary Ware  added the comment:

Our installer scheme was modernized for Python 3.5, and a description of its 
use can be found here: https://docs.python.org/3/using/windows.html

The new scheme is significantly more flexible, though it is somewhat more 
complex to enable that flexibility.  If you have a case that can't be handled 
by the current installer, please open an issue detailing what you want to do 
and how the installer falls short.

--
resolution:  -> wont fix
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



[issue36338] urlparse of urllib returns wrong hostname

2019-03-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests:  -12526

___
Python tracker 

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



  1   2   >