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
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
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
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
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.
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
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
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.
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
|
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
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
> 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
], 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
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
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
__
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
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-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
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
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 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
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
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
>
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
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
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)
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
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.
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
>>
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
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
/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
___
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
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
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
___
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
> 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
`@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
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
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
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
> 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 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
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.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/
>
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)
; 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
__
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
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
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
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
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
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(&
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
54 matches
Mail list logo