[Python-Dev] Re: Adding a "call_once" decorator to functools

2020-05-01 Thread Serhiy Storchaka

01.05.20 01:23, Paul Ganssle пише:

class LazyList:
     def __init__(self, some_iterator):
     self._iter = some_iterator
     self._list = None

     @call_once
     def as_list(self):
     self._list = list(self._iter)
     return self._list


call_once is not applicable here, because it is only for functions which 
do not have arguments, but as_list() takes the self argument.

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/IQJJOO47QCZC5RFG42BPNGO43Z6VNHVR/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] For-If syntax

2020-05-01 Thread Emily Bowman
I hope this isn't too noobish, nothing on the list comes up in Google, but
I'm curious why the construct

for x in y if x.is_some_thing:
  # do a thing

isn't legal. That seems a very Pythonic symmetry with lambdas. The
equivalent syntax required right now is,

for x in [x for x in y if x.is_some_thing]:
  # do a thing

Of course there's more flexibility in the full syntax, but is there any
interest in the simpler, more performant one-line syntax?

Em
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/VHFUQFEF3TCI6LHLBAUEKMFM2A6V3CQO/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: For-If syntax

2020-05-01 Thread Brett Cannon
Questions like this are best asked on python-ideas.

Specifically, though, you can get the same result with:

  for x in (n for n in y if n.is_some_thing):

without requiring new syntax.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/LBI4JNJ6CIG5VDRVJ6EYV52IIWV5AXUG/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Python Language Summit 2020 blog posts

2020-05-01 Thread Mariatta
(x-posting to python-dev and python-committters)

Just wanted to share that the first 7 of 11 blog posts about presentations
and discussions from Python Language Summit are now up for your enjoyment.

Main article:
https://pyfound.blogspot.com/2020/04/the-2020-python-language-summit.html

Day 1:

All strings become f-strings, Eric V Smith:
https://pyfound.blogspot.com/2020/04/all-strings-become-f-strings-python.html

Replacing CPython’s Parser with a PEG-based parser, Pablo Galindo,
Lysandros Nikolaou, Guido van Rossum:
https://pyfound.blogspot.com/2020/04/replacing-cpythons-parser-python.html

A Formal Specification for the (C)Python Virtual Machine, Mark Shannon:
https://pyfound.blogspot.com/2020/04/a-formal-specification-for-cpython.html

HPy: a Future-Proof Way of Extending Python?, Antonio Cuni:
https://pyfound.blogspot.com/2020/04/hpy-future-proof-way-of-extending.html

CPython Documentation: The Next 5 Years, Carol Willing, Ned Batchelder:
https://pyfound.blogspot.com/2020/04/cpython-documentation-next-5-years.html


Day 2:

Lightning talks: (
https://pyfound.blogspot.com/2020/04/lightning-talks-part-1.html)
- What do you need from pip, PyPI, and packaging?, Sumana Harihareswara
- A Retrospective on My "Multi-Core Python" Project, Eric Snow

The Path Forward for Typing, Guido van Rossum:
https://pyfound.blogspot.com/2020/04/the-path-forward-for-typing-python.html

Stay tuned for more posts!

Property-Based Testing for Python Builtins and the Standard Library, Zac
Hatfield-Dodds

Core Workflow Updates, Mariatta Wijaya

CPython on Mobile Platforms, Russell Keith-Magee

Few more lightning talks from Eric Holscher and Zac Hatfield-Dodds

Enjoy!
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/5DJJ7NBAWRJROGQLGMXVMC5P5OFO2EUX/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Python Language Summit 2020 blog posts

2020-05-01 Thread Mariatta
>
> Few more lightning talks from Eric Holscher and Zac Hatfield-Dodds
>
>
... and Jim Baker


___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/UOYUCHETJOF3ZJYGKLJ72JVO5FWT27DM/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Summary of Python tracker Issues

2020-05-01 Thread Python tracker

ACTIVITY SUMMARY (2020-04-24 - 2020-05-01)
Python tracker at https://bugs.python.org/

To view or respond to any of the issues listed below, click on the issue.
Do NOT respond to this message.

Issues counts and deltas:
  open7427 (-25)
  closed 44793 (+118)
  total  52220 (+93)

Open issues with patches: 2954 


Issues opened (74)
==

#25597: unittest.mock does not wrap dunder methods (__getitem__ etc)
https://bugs.python.org/issue25597  reopened by xtreak

#29587: Generator/coroutine 'throw' discards exc_info state, which is 
https://bugs.python.org/issue29587  reopened by gvanrossum

#37340: remove free_list for bound method objects
https://bugs.python.org/issue37340  reopened by rhettinger

#40246: Different error messages for same error - invalid string prefi
https://bugs.python.org/issue40246  reopened by vstinner

#40335: [PEP 617 new parser] Regression in multiline SyntaxError offse
https://bugs.python.org/issue40335  reopened by Anthony Sottile

#40379: multiprocessing's default start method of fork()-without-exec(
https://bugs.python.org/issue40379  opened by itamarst

#40380: OS-related test failures on Linux in Python 3.8.2
https://bugs.python.org/issue40380  opened by Steven Fleck

#40381: plistlib doesn't handle poorly-formatted plists
https://bugs.python.org/issue40381  opened by Clay Caviness

#40382: Make 'rt' the default for open in docs
https://bugs.python.org/issue40382  opened by facundobatista

#40383: weakref class name are hardcoded in reprs
https://bugs.python.org/issue40383  opened by OhBonsai

#40384: IDLE: Wrong highlighting when \n follows def/class
https://bugs.python.org/issue40384  opened by Alex-Python-Programmer

#40390: Implement _xxsubinterpreters.channel_send_wait().
https://bugs.python.org/issue40390  opened by benedwards14

#40391: io.FileIO.mode doesn't comply with the docs
https://bugs.python.org/issue40391  opened by mike.parker

#40393: Auto-response from Python Help points to Python 2 reference
https://bugs.python.org/issue40393  opened by J Arun Mani

#40395: Scripts folder is Empty in python 3.8.2 for Windows 7.
https://bugs.python.org/issue40395  opened by BenTen Jan

#40397: Refactor typing._GenericAlias
https://bugs.python.org/issue40397  opened by serhiy.storchaka

#40398: get_args(Callable) fails
https://bugs.python.org/issue40398  opened by serhiy.storchaka

#40399: IO streams locking can be broken after fork() with threads
https://bugs.python.org/issue40399  opened by Delgan

#40400: Mac build-installer.py doesn't support new plist format
https://bugs.python.org/issue40400  opened by h2a10

#40402: Race condition in multiprocessing/connection.py: broken handle
https://bugs.python.org/issue40402  opened by maxicooper

#40403: pdb does not drop into debugger upon SyntaxError caused by ast
https://bugs.python.org/issue40403  opened by Kerrick Staley

#40404: Python quit unexpectedly
https://bugs.python.org/issue40404  opened by drliu

#40405: asyncio.as_completed documentation misleading
https://bugs.python.org/issue40405  opened by bar.harel

#40406: MagicMock __aenter__ should be AsyncMock(return_value=MagicMoc
https://bugs.python.org/issue40406  opened by graingert

#40407: Zipfile couldn`t recognized character set rightly.
https://bugs.python.org/issue40407  opened by 김지훈

#40408: GenericAlias does not support nested type variables
https://bugs.python.org/issue40408  opened by serhiy.storchaka

#40409: urllib.parse.urlsplit parses schemes that do not begin with le
https://bugs.python.org/issue40409  opened by sgg

#40410: test_multiprocessing_forktest_terminate() timed out after 15 m
https://bugs.python.org/issue40410  opened by vstinner

#40412: inittab_copy not set to NULL after free, can lead to crashes w
https://bugs.python.org/issue40412  opened by indygreg

#40413: Py_RunMain() crashes on subsequence call
https://bugs.python.org/issue40413  opened by indygreg

#40414: Incorrect mouse and keyboard mapping
https://bugs.python.org/issue40414  opened by Jah-On

#40416: Calling TextIOWrapper.tell() in the middle of reading a gb2312
https://bugs.python.org/issue40416  opened by rmalouf

#40417: PyImport_ReloadModule emits deprecation warning
https://bugs.python.org/issue40417  opened by Robert Rouhani

#40418: Small Refactoring: Use bytes.hex() in secrets.token_hex()
https://bugs.python.org/issue40418  opened by Dennis Sweeney

#40419: timeit CLI docs still mention old power sequence
https://bugs.python.org/issue40419  opened by Energya

#40420: argparse choices formatter
https://bugs.python.org/issue40420  opened by Leonid Ilyevsky

#40421: [C API] Add getter functions for PyFrameObject and maybe move 
https://bugs.python.org/issue40421  opened by vstinner

#40422: Light refactor: create a common _Py_closerange API
https://bugs.python.org/issue40422  opened by kevans91

#40423: Optimization: use close_range(2) if available
https://bugs.python.org/issue40423  opened by kevans91

#40424: AIX: parallel build and ld WARNINGS
http

[Python-Dev] Re: For-If syntax

2020-05-01 Thread Gary Herron


On 5/1/20 9:19 AM, silverback...@gmail.com wrote:
I hope this isn't too noobish, nothing on the list comes up in Google, 
but I'm curious why the construct


for x in y if x.is_some_thing:
  # do a thing


But this is probably clearer (and has the same syntax):

for x in y:
  if x.is_some_thing:
    # do a thing


Cramming two separate thoughts onto a single line is probably *not* clearer.




isn't legal. That seems a very Pythonic symmetry with lambdas. The 
equivalent syntax required right now is,


for x in [x for x in y if x.is_some_thing]:
  # do a thing

Of course there's more flexibility in the full syntax, but is there 
any interest in the simpler, more performant one-line syntax?


Em

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/VHFUQFEF3TCI6LHLBAUEKMFM2A6V3CQO/
Code of Conduct: http://python.org/psf/codeofconduct/


--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/T3VQGGAHYR4AOKMVPL5NDTAV2GB6BIAH/
Code of Conduct: http://python.org/psf/codeofconduct/