[Python-Dev] Re: fail keyword like there is pass keyword

2020-10-28 Thread Luciano Ramalho
..@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/QPOVO34K63CLEY66GSY5JOLWBRG5QRUM/ > Code of Conduct: http://python.org/psf/codeofconduct/ >

[Python-Dev] Re: Words rather than sigils in Structural Pattern Matching

2020-11-13 Thread Luciano Ramalho
century what the slave trade was to the 16th. > ___ > 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/ > Messag

[Python-Dev] Re: Concerns about PEP 634

2021-02-06 Thread Luciano Ramalho
_ >> > 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/archiv

[Python-Dev] Re: Concerns about PEP 634

2021-02-06 Thread Luciano Ramalho
> https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/VC3IV5XDTMKYZME75WQAHAEAWGOYTOBI/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Luciano Ramalho | Author of

[Python-Dev] Re: Concerns about PEP 634

2021-02-06 Thread Luciano Ramalho
o 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/T3CJQWO7DQEJPECHUYJH655D75LMVOVM/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Luciano R

[Python-Dev] Re: Python standardization

2021-02-13 Thread Luciano Ramalho
ived at > https://mail.python.org/archives/list/python-dev@python.org/message/JZYW4JOTANYIOLYDQ6YHRUP2TWO52OAE/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636920032519.do | T

[Python-Dev] Clarification on the removal of generator-based coroutines in 3.10

2021-02-18 Thread Luciano Ramalho
enerator-based coroutine"—those marked with @types.coroutine. [2] https://docs.python.org/3/glossary.html Thank you for your time and help! Cheers, Luciano -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636

[Python-Dev] Re: Clarification on the removal of generator-based coroutines in 3.10

2021-02-18 Thread Luciano Ramalho
`@types.coroutine` and using a `yield` expression in its body? 2) Given that the sole purpose of `@types.coroutine` is to decorate generator-based coroutines to become awaitable, will that decorator also be removed, along with "support for generator-based coroutines"? Best, Luciano -- L

[Python-Dev] Re: Clarification on the removal of generator-based coroutines in 3.10

2021-02-18 Thread Luciano Ramalho
> with a value indicating the ultimate result (the return value of the > top-level async def). All right, that made sense to me. Thank you so much, Guido. Thanks for the clarification about `@types.coroutine` as well. Take care, Luciano -- Luciano Ramalho | Author of Fluen

[Python-Dev] Re: Clarification on the removal of generator-based coroutines in 3.10

2021-02-18 Thread Luciano Ramalho
neral is > > used to provide an awaited result. Eventually this will raise StopIteration > > with a value indicating the ultimate result (the return value of the > > top-level async def). > > All right, that made sense to me. Thank you so much, Guido. > > Thanks for t

[Python-Dev] Re: Clarification on the removal of generator-based coroutines in 3.10

2021-02-19 Thread Luciano Ramalho
wait' expression". Maybe I misunderstood your suggestion? -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636920032519.do | Technical Principal at ThoughtWorks | Twitter: @ramalhoorg ___

[Python-Dev] Re: Clarification on the removal of generator-based coroutines in 3.10

2021-02-19 Thread Luciano Ramalho
ait' expression > > On Thu, Feb 18, 2021 at 22:31 Luciano Ramalho wrote: >> >> Follow up question: what's the plan to replace this use of >> `@types.coroutine` in `asyncio/tasks.py`? [1] >> >> @types.coroutine >> def __sleep0(): >> &qu

[Python-Dev] Re: Clarification on the removal of generator-based coroutines in 3.10

2021-02-19 Thread Luciano Ramalho
On Fri, Feb 19, 2021 at 6:29 AM Luciano Ramalho wrote: > async def __sleep(): > return None Sorry, I meant to write: async def __sleep0(): return None Since the idea is to replace the generator-based coroutine `__sleep0` in tasks.py [1] with a native coroutine. [1] https://gith

[Python-Dev] Re: aiter/anext review request

2021-03-19 Thread Luciano Ramalho
/5XUVPB5H4PFUGTC5F7KAN4STKAEOFBQM/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636920032519.do | Technical Principal at ThoughtWorks | Twitter: @ramalhoorg ___

[Python-Dev] Re: aiter/anext review request

2021-03-19 Thread Luciano Ramalho
years have > passed, but all the latest signals we've gotten up to now have indicated a > preference for adding these to builtins. > > In any case, as of my latest PR > <https://github.com/python/cpython/pull/23847>, the Python core > developers now have both options

[Python-Dev] Re: aiter/anext review request

2021-03-19 Thread Luciano Ramalho
Now is a good time to ask: what are the criteria for adding functions to the builtins module? Is there a written record of those criteria? Thanks! On Fri, Mar 19, 2021 at 1:55 PM Luciano Ramalho wrote: > OK, but it seems clear to me that if there are any lingering doubts it > would be

[Python-Dev] Re: aiter/anext review request

2021-03-19 Thread Luciano Ramalho
the work itself is impeccable. While you’re waiting for a > resolution you may want to try working on other contributions! > > —Guido > > On Fri, Mar 19, 2021 at 09:59 Luciano Ramalho wrote: > >> OK, but it seems clear to me that if there are any lingering doubts it >>

[Python-Dev] Re: Typing syntax and ecosystem

2021-04-13 Thread Luciano Ramalho
from > an environmental viewpoint it isn't a great use of resources. > > -- > > cheers, > Hugh Fisher > ___ > Python-Dev mailing list -- python-dev@python.org > To unsubscribe send an email to python-dev-le.

[Python-Dev] Re: Typing syntax and ecosystem

2021-04-15 Thread Luciano Ramalho
etc without declaring any kind of type for x. >> >> -- >> >> cheers, >> Hugh Fisher >> ___ >> Python-Dev mailing list -- python-dev@python.org >> To unsubscribe send an email to python-dev-le

[Python-Dev] Should Python typing leverage PEP 263 as a pre-processor step?

2021-04-19 Thread Luciano Ramalho
sions to Python. Just for fun, years ago I wrote a POC for Sucuri—a Python dialect with the keywords in Portuguese. The pre-processor simply replaced the Portuguese keywords with the English ones. Cheers, Luciano -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015)

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-20 Thread Luciano Ramalho
thon-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/R3VP4KORAWI6KK4CNFL6JNYCATWR47EV/ > Code of

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-20 Thread Luciano Ramalho
able they are. And in the future, if people come up with some new way of handling types, every new addition must be considered in light of existing typing styles—after a good, broad conversation involving different user bases. Cheers, Luciano On Tue, Apr 20, 2021 at 7:35 PM Luciano Ramalho

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-22 Thread Luciano Ramalho
ire that, nor does > the first because it's equivalent. > > Honestly, this conversation is just reinforcing my suspicion that > people invested in type annotations have a blind spot when it comes to > dealing with people and use cases that don't need to go "all in" with >

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-22 Thread Luciano Ramalho
ecause of the subclass hook. > I'm not sure of the definition of "nominal" typing -- but it absolutely is > NOT duck typing (As Luciano pointed out, Alex Martelli coined the term Goose > Typing for this). Yes. I wish Alex joined this conversation. Cheers, Luciano On W

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-22 Thread Luciano Ramalho
__ > 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/ZXI3

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-22 Thread Luciano Ramalho
ide to introduce typing in more > places, I don't know at the moment. I've also not really used typing > for public APIs, where an over-restrictive type would be more of an > issue. > > Paul > ___ > Python-De

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-22 Thread Luciano Ramalho
sage and > context. > > ChrisA > ___ > 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 arc

[Python-Dev] Re: Existing asyncio features scheduled for removal in Python 3.9 and 3.10

2021-04-26 Thread Luciano Ramalho
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/PLSLFTJXY2JUIRGJARBER4SRUWDXX2AQ/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Lucian

[Python-Dev] Re: Existing asyncio features scheduled for removal in Python 3.9 and 3.10

2021-04-26 Thread Luciano Ramalho
and Trio. Sorry for the noise. Cheers, Luciano On Mon, Apr 26, 2021 at 7:04 PM Nathaniel Smith wrote: > > @asyncio.coroutine and @types.coroutine are different beasts. > @asyncio.coroutine is the deprecated one; @types.coroutine is > lower-level and not deprecated. > > On Mon

[Python-Dev] Re: Documenting collections.abc __class_getitem__ type hints

2021-05-06 Thread Luciano Ramalho
hon-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/U3QIWBXHKRSWNVE6F4QKOT2OJULNZBWY/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com

[Python-Dev] Re: The repr of a sentinel

2021-05-20 Thread Luciano Ramalho
5JK42GR6ZM2VQ7VL2/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636920032519.do | Technical Principal at ThoughtWorks | Twitter: @ramalhoorg __

[Python-Dev] Re: The repr of a sentinel

2021-05-21 Thread Luciano Ramalho
will read the upcoming 46-page "PEP 973: Parameterized Sentinel Factory Factory API" ;-) Cheers, Luciano -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636920032519.do | Technical Principal at ThoughtWorks | Twitt

[Python-Dev] Re: The repr of a sentinel

2021-05-23 Thread Luciano Ramalho
], so the cat is > out of the proverbial bag now… > > Luciano, your wish is granted! ;) > - Tal Einat > > [1] https://discuss.python.org/t/sentinel-values-in-the-stdlib/8810/ -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/pro

[Python-Dev] Re: The repr of a sentinel

2021-05-23 Thread Luciano Ramalho
> Luciano, your wish is granted! ;) > > - Tal Einat > > > > [1] https://discuss.python.org/t/sentinel-values-in-the-stdlib/8810/ > > > > -- > Luciano Ramalho > | Author of Fluent Python (O'Reilly, 2015) > | http://shop.oreilly.com/product/063692

[Python-Dev] Re: The repr of a sentinel

2021-05-23 Thread Luciano Ramalho
heers, Luciano On Sun, May 23, 2021 at 9:37 PM Luciano Ramalho wrote: > > Sorry about my detour into the rejected idea of a factory function. > > But how about this class-based API? > > class NotGiven(Sentinel): > pass > > > Now I can use NotGiven as the sentinel, a

[Python-Dev] Re: The repr of a sentinel

2021-05-24 Thread Luciano Ramalho
ince having a Sentinel base class is desirable for ease of use, I think it is simpler to code the __new__ method in it, instead of coding metaclass logic to inject __new__ in the class namespace. Best, Luciano -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://sho

[Python-Dev] Re: The repr of a sentinel

2021-05-25 Thread Luciano Ramalho
tps://github.com/fluentpython/example-code-2e/blob/master/25-class-metaprog/sentinel/sentinel.py Cheers, Luciano -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636920032519.do | Technical Principal at ThoughtWorks |

[Python-Dev] Re: name for new Enum decorator

2021-05-31 Thread Luciano Ramalho
uct/ > > _______ > 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.

[Python-Dev] Re: Delayed evaluation of f-strings?

2021-06-24 Thread Luciano Ramalho
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/GT5DNA7RKRLFWE3V42OTWB7X5ER7KNSL/ > Code of Conduct: http://python.org/psf/codeofconduc

[Python-Dev] Re: types.Union or types.UnionType?

2021-07-26 Thread Luciano Ramalho
n-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/RHRF7Q25GQ3EIEUJHW72YLQNMCUDLWRW/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Luciano Ramalh

[Python-Dev] Re: PEP 467 feedback from the Steering Council

2021-08-06 Thread Luciano Ramalho
dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/VBZBMCPQ6IR3SZIEALQQFXGLUMXY7RUT/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.

[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations

2021-08-11 Thread Luciano Ramalho
costs of being a dynamic language. Cheers, Luciano -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636920032519.do | Technical Principal at ThoughtWorks | Twitter: @ramalhoorg ___ Pyt

[Python-Dev] Dropping out of this list

2021-08-18 Thread Luciano Ramalho
I bet I am not alone. Instead of going silently, I wanted to call on the adult supervision to do something about the adult. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.pyth

[Python-Dev] Enhancing generic type documentation in the standard library

2022-03-23 Thread Luciano Ramalho
ccept as generics are either undocumented, or documented in parts of the `typing` module that are already deprecated. Thoughts? -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636920032519.do | Technical

[Python-Dev] Re: Enhancing generic type documentation in the standard library

2022-03-28 Thread Luciano Ramalho
much less their semantics. >> >> Fortunately, the text of the `typing.Generator` entry says: "A >> generator can be annotated by the generic type `Generator[YieldType, >> SendType, ReturnType]". >> >> Unfortunately, `typing.Generator` is deprecated and

[Python-Dev] Re: PEP 554 for 3.9 or 3.10?

2020-04-18 Thread Luciano Ramalho
ion, as it gives us the option to refine the Python API while > people are still learning how to use the new model. > > Paul > ___ > Python-Dev mailing list -- python-dev@python.org > To unsubscribe send an email to python-dev

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-24 Thread Luciano Ramalho
a > single name can be made into a constant value by prefixing it with a > dot to prevent it from being interpreted as a variable extraction: > > ```py > RED, GREEN, BLUE = 0, 1, 2 > > match color: > case .RED: > print(&

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-08 Thread Luciano Ramalho
d I see an `else` clause, I know for sure that *something* will happen. If no `else` clause is present, I know it's possible nothing will happen. It's the same thing with `else` in `if`, `while`, `for`, `try` statements, where the `else` is aligned with the opening keyword. Cheers, Luc

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-08-05 Thread Luciano Ramalho
t; > > ___ > 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.pyt

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-08-05 Thread Luciano Ramalho
tps://docs.microsoft.com/en-us/archive/msdn-magazine/2019/may/csharp-8-0-pattern-matching-in-csharp-8-0 > > On Wed, Aug 5, 2020 at 3:33 PM Luciano Ramalho wrote: >> >> On Tue, Aug 4, 2020 at 1:37 PM Tobias Kohn wrote: >> > And experience from other programming languages wh

[Python-Dev] Re: Python Documentation, Python language improvement, and productive discussion

2020-08-09 Thread Luciano Ramalho
ython.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/MRV5SQCC2GC6MLIUCSPJZL3AQCXVDUEG/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreil

[Python-Dev] How about copying the typing module docs from 3.10 to 3.9?

2020-08-11 Thread Luciano Ramalho
more people would benefit from it sooner? Cheers, Luciano -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636920032519.do | Technical Principal at ThoughtWorks | Twitter: @ramalhoorg ___ P

[Python-Dev] Re: PEP 622: Arrow for capture patterns

2020-09-08 Thread Luciano Ramalho
; the > variable. What do you think? I like this syntax. -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636920032519.do | Technical Principal at ThoughtWorks | Twitter: @ramalhoorg __

[Python-Dev] Re: Enum and the Standard Library

2020-09-21 Thread Luciano Ramalho
ess qualified name", but still qualified with at least one dot in it—eg. Color.RED and not RED). In the rare cases where someone cares about the underlying integer, let them get the value. Cheers, Luciano -- Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015)