On Mon, Mar 28, 2022 at 16:06 Patrick Reader
wrote:
> I would like to be able to use a `yield from` expression in a `return`
> statement without parentheses, as a small quality of life tweak, i.e.:
>
> return yield from gen
>
> instead of
>
> return (yield from gen)
What does this do? `return (
Hmm, I think the idea of the mathematical symbol is interesting, but I
think users are more interested in constructing a new, eventually-not-empty
set, than referencing the empty set.
Semantically, I don't know if ∅() is satisfying.
On Thu, Mar 17, 2022 at 08:19 Stéfane Fermigier wrote:
> The “
+1
This is just a small improvement, but worthwhile. It's intuitive IMO to be
able to use similar filtering expressions to comprehensions at the top of a
for loop.
Here's an example:
# get the Hadoop version by scanning pyspark jars.
# Vague attribution:
https://stackoverflow.com/a/50242383
for
Perhaps another approach would be to make a more general purpose warning
decorator, that would give a warning when invoking a function or
instantiating a class. It could be used for deprecation notices, of course,
but has the potential for tooling to give other types of warnings, such as
using a th
Jonathan Fine said
> But here there is a cost. Arbitrary precision arithmetic (and roots) uses
more memory and takes longer.
I think a wider (perhaps naive) interpretation of the idea could be, "can
we defer certain lossy calculations until they have to be done?"
Fraction may do eager arbitrary p
On Thu, Dec 24, 2020 at 6:18 PM Cameron Simpson wrote:
>
> On 25Dec2020 09:29, Steven D'Aprano wrote:
> >On Thu, Dec 24, 2020 at 12:15:08PM -0500, Michael A. Smith wrote:
> >
> >> With all the buffering that modern disks and filesystems do, a
> >> specific question has come up a few times with re
Also sorry for the duplicate, Steven.
On Thu, Dec 24, 2020 at 5:31 PM Steven D'Aprano wrote:
> On Thu, Dec 24, 2020 at 12:15:08PM -0500, Michael A. Smith wrote:
>
> > With all the buffering that modern disks and filesystems do, a
> > specific question has come up a few times with respect to whet
Sorry for the duplicate, Barry. I got bit by the "I don't reply-all by
default" spider.
On Sat, Dec 26, 2020 at 12:30 PM Barry Scott wrote:
>
>
> > On 24 Dec 2020, at 17:15, Michael A. Smith wrote:
> >
> > With all the buffering that modern disks and filesystems do, a
> > specific question has
On Thu, Dec 10, 2020 at 17:12 wrote:
> No, it is not good design choose, because then all type-checker will have
> different optional and it will be a mess ...
> It should be done in one place like python
I think the nature of open source is that all the tools have different
options and it is a
nd here it
> is on python-ideas -- quite a coincidence!
>
> -CHB
>
>
>
>
>
> On Tue, Oct 20, 2020 at 11:16 PM Paul Sokolovsky
> wrote:
>
>> Hello,
>>
>> On Wed, 21 Oct 2020 00:24:47 -0400
>> Michael Smith wrote:
>>
>> > O
xt of the function, in this case.
On Tue, Oct 20, 2020 at 20:32 Michael Smith wrote:
>
>>
>>
>> On Tue, Oct 20, 2020 at 23:12 Guido van Rossum wrote:
>>
>>> On Tue, Oct 20, 2020 at 8:06 PM Michael Smith
>>> wrote:
>>>
>>>> On Tue, O
On Tue, Oct 20, 2020 at 23:12 Guido van Rossum wrote:
> On Tue, Oct 20, 2020 at 8:06 PM Michael Smith
> wrote:
>
>> On Tue, Oct 20, 2020 at 10:19 PM Guido van Rossum
>> wrote:
>> >
>> > I think it would be a tad more convincing if there was a way to pas
e function only needs not require any formal parameters. It doesn't
need to be special-er than that. It can handle args via sys.argv, as
you suggested. Most of the `main` functions I write today are just
like that.
> On Tue, Oct 20, 2020 at 7:10 PM Michael Smith wrote:
>>
>> Th
There are many ways to invoke a function from the commandline. You can
use setuptools' console_scripts entrypoint. You can use a decorator
from click. And of course you can always do the classic
if __name__ == "__main__":
main()
to call whatever main() is. But there are inconveniences with thes
On Tue, Oct 20, 2020 at 06:02 J. Pic wrote:
> Well personally I don't need print at all, I just read code and
> imagine the output in my head and that's perfectly fine for me (I
> don't even need a tty).
>
> Nonetheless, I believe the majority of Python users are not
> necessarily familiar with P
On Mon, Oct 19, 2020 at 19:28 J. Pic wrote:
> +1 because print is a debugging tool mostly used in short lived
> temporary code as such the parenthesis do not matter and do not
> provide any value.
A lot of debugger use print to instrumentalize their code during
> development or debugging, as in
On Fri, Oct 16, 2020 at 22:42 Steven D'Aprano wrote:
> On Fri, Oct 16, 2020 at 10:28:20PM -0400, David Mertz wrote:
> > On Fri, Oct 16, 2020, 10:16 PM Steven D'Aprano
> >
> > > I think that if we go ahead with this, we shouldn't allow lack
> > > of support for screen and/or tmux to stand in the w
I occasionally find it useful to clear the screen when doing
demos/presentations. I think the case for it is clear (hah) enough based on
its long history and presence in many terminal emulators. But then again,
the terminals I use and readline support it already, so I don't need python
repl to do
On Tue, Oct 6, 2020 at 00:37 Kevin Mills wrote:
> str_iterator, bytes_iterator, range_iterator, list_iterator, and
> tuple_iterator (and probably others) should have a method that is capable
> of efficiently advancing the iterator, instead of having to call next
> repeatedly.
>
> I suggest adding
Pillow for one example).
Installers downloading stuff is a whole security domain. But software I
want to run implicitly invoking the installer adds a layer of complexity to
that domain that I think outweighs the gain.
- Michael Smith
___
Pytho
On Sat, Aug 8, 2020 at 16:41 Dominik Vilsmeier
wrote:
> On 08.08.20 05:48, David Mertz wrote:
>
> On Fri, Aug 7, 2020, 6:03 PM Paul Moore wrote:
>
>> > x: int[0:] # any ints greater than or equal to zero would match,
>> others would fail
>> > x: int[:101] # any ints less than 101 match
>> > x:
Hi, Robert,
I learned about an existing RestrictedPython implementation through
Zope/Plone. I can see that it differs from your ideas in some ways, but I
think at heart it gets to what you're trying to solve for. Have you read
about it?
https://restrictedpython.readthedocs.io/en/latest/idea.html
22 matches
Mail list logo