> 严懿宸(文极) via Python-ideas writes:
> > Currently, we’ve made it a third-party library and have been
> > working on open-sourcing.
Stephen J. Turnbull wrote:
> Thank you! I guess "working on" means "the lawyers have it" so we'll
> be patient. :-)
> I'm not sure whether your purpose is to get
Good catch! You can submit a PR or issue to the peps project in the Python
organization on GitHub.
On Fri, Dec 3, 2021 at 00:24 wrote:
> Hi!
> When I read PEP7 and check Cpython source code, I found a deficiency that
> in https://www.python.org/dev/peps/pep-0007/#code-lay-out.
> In this
+1
On Thu, Nov 18, 2021 at 09:31 Michael Foord wrote:
>
>
> On Thu, 18 Nov 2021 at 04:38, Steven D'Aprano wrote:
>
>> On Wed, Nov 17, 2021 at 02:26:16PM -, tmkehrenb...@gmail.com wrote:
>>
>> > @dataclass
>> > class A:
>> > """Docstring for class A."""
>> > x: int
>> >
One thought: No.
On Thu, Nov 11, 2021 at 05:41 Matt del Valle wrote:
> So I was reading the docs for the `threading` module and I stumbled upon
> this little note:
>
> Note:
>
> In the Python 2.x series, this module contained camelCase names for some
> methods and functions. These are
Agreed, class namespaces are weird. :-)
On Sun, Oct 31, 2021 at 23:38 Chris Angelico wrote:
> On Mon, Nov 1, 2021 at 5:15 PM Greg Ewing
> wrote:
> >
> > On 1/11/21 4:59 am, David Mertz, Ph.D. wrote:
> > > b = b
> >
> > I don't want to live in a universe where this could be anything
> >
I’m with Steven.
On Fri, Oct 29, 2021 at 06:22 Chris Angelico wrote:
> On Fri, Oct 29, 2021 at 11:52 PM Steven D'Aprano
> wrote:
> > > Except that that's still backward-incompatible, since None is a very
> > > common value.
> >
> > How is it backwards incompatible? Any tool that looks at
ssage archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/4OHZ6QZWDI3U2ADI5A36UU73OOXFOGJE/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing
t 25, 2021 at 10:49 AM Chris Angelico wrote:
> On Tue, Oct 26, 2021 at 4:36 AM Guido van Rossum wrote:
> >
> > On Mon, Oct 25, 2021 at 10:28 AM Chris Angelico
> wrote:
> >>
> >> [...] The two options on the table are:
> >>
> >> 1) Allow referen
und. Everywhere else in Python, undefined names are runtime errors
(NameError or UnboundLocalError).
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-sing
lt arguments.
(You could make something up that uses dynamic scoping, but that's a whole
different can of worms.)
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-
> fn2(defer: x) # look for local a, b within fn2() if needed
> > # ... other stuff
> > return x # return 8 here
> >
>
> How would it know to look for a and b inside fn2's scope, instead of
> looking for x inside fn2's scope?
>
I am worried that this si
I like that you're trying to fix this wart! I think that using a different
syntax may be the only way out. My own bikeshed color to try would be `=>`,
assuming we'll introduce `(x) => x+1` as the new lambda syntax, but I can
see problems with both as well :-).
--
--Guido van Rossum (pyth
as you seemed to imply).
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
___
Python-ideas mailing list -- python-ideas@py
ause unlike lists the over-allocation isn't permanent."
Finally, the bytecode generated for (*a, *b) creates a list first and then
turns that into a tuple (which will be allocated with the right size since
it's known at that point).
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(
Seems sensible to me. I’d write the equivalency as
for x in y: answer.extend([…x…])
On Sat, Oct 16, 2021 at 07:11 Erik Demaine wrote:
> Extended unpacking notation (* and **) from PEP 448 gives us great ways to
> concatenate a few iterables or dicts:
>
> ```
> (*it1, *it2, *it3) # tuple with
I suspect there won’t be enough support for this proposal to ever make it
happen, but at the very least could you think of a different token? The
three left arrows just look too weird (esp. in the REPL examples, where
they strongly seem to suggest a false symmetry with the ‘>>>’ prompt. How
did
ython.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/UGRD4QCDGRPOOCDMLPZ7EXWJFKM22AGO/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
ke to remind various other posters that sarcasm is *not* a
good way to welcome newbies. The name of the list is python-ideas, not
python-ideas-to-shoot-down-sarcastically.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/
You have to check the C code to be sure, but IIRC the latest dict
implementation has a dense array of the values in insert order, and the
hash table (which has gaps) contains indexes into the values array. So you
could easily index into the values array (which I believe also has the
keys) in O(1)
ich
operation is implemented most efficiently. Though you should just measure
it for various N.
Are you actually observing that people are doing this with regular lists?
Don't people working with Big Data usually use Pandas, which is built on
NumPy arrays and custom data structures?
--
--Guido va
ython.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/K6ZOKOHBJQLCRDDWARTIPYGZB3IN25SG/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum
he Groovy community, also used by
> projects such as `Spock`_.
>
> On top of that, it is very much needed in the Python community as well:
>
> * `Power Assertion was explicitly requested`_ as a feature in the
> `Nimoy`_ testing framework
> * There's a `similar feature
On Sat, Sep 25, 2021 at 00:56 Steven D'Aprano wrote:
> On Fri, Sep 24, 2021 at 11:23:00PM -0700, Guido van Rossum wrote:
>
> > > Is there no room for making it easier to do this with less invasive
> > > changes to the stdlib, or are Steven d'A's "heroic mea
On Fri, Sep 24, 2021 at 22:07 Stephen J. Turnbull <
stephenjturnb...@gmail.com> wrote:
> Guido van Rossum writes:
>
> > I think this is by far the best option. Pytest can evolve much faster
> than
> > the stdlib.
>
> Is there no room for making it easier to do
On Fri, Sep 24, 2021 at 19:49 Christopher Barker
wrote:
> Alternatively, take the approach taken with distutils and setuptools—
> officially accept that a full featured test framework will be left to third
> parties.
>
I think this is by far the best option. Pytest can evolve much faster than
hon.org/archives/list/python-ideas@python.org/message/L6BTMIIMNSXX37YQA7J5VCOI7TOKOX5O/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how
s@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/U5UQFDAJ4KWG2OQ3YMP2THMSJ72JRV6Y/
> Code of Cond
-unsafe. It's not because of the new context manager. All
>> `os.workdir()` does is make things easier.
>> However, if it's implemented (which I personally support), there should
>> still of course be a warning in the documentation. But I'd like to
>> emphasize that *it is no
et" is an extremely subjective pejorative term. When the *better*
way to do things (os.workdir()) is harder than the *easy* way to do
(os.chdir()), which is the real bug magnet?
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is
eek for umask().
>
> Cheers,
> Cameron Simpson
> ___
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.
Maybe you all could collaborate on a PEP? This sounds a worthy topic.
On Sun, Sep 12, 2021 at 08:37 Serhiy Storchaka wrote:
> 12.09.21 17:28, Guido van Rossum пише:
> > This is cool.
> >
> > AFAIK pytest does something like this. How does your implementation
> diff
This is cool.
AFAIK pytest does something like this. How does your implementation differ?
What is your argument for making this part of the language? Why not a 3rd
party library?
What about asserts that are not used for testing, but as classic “unless
there’s a bug, this should hold”? Those may
Ooh, that’s a nice idea. If the message is an exception instance, raise it
instead of AssertionError. Unfortunately it’s not 100% backwards
compatible. We could address that with the syntax
assert cond, raise=ExcType(args)
Maybe we could deprecate the case
assert cond, ExcType(args)
So
> ___
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python
On Mon, Sep 6, 2021 at 21:45 Christopher Barker wrote:
> Just use pytest.
>
For third party code I agree, it’s the way to go.
—Guido
--
--Guido (mobile)
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to
On Fri, Sep 3, 2021 at 5:37 PM Christopher Barker
wrote:
> On Fri, Sep 3, 2021 at 1:13 PM Guido van Rossum wrote:
>
>> But the text of the error message will explain all you need for debugging
>> and testing.
>>
>
> debugging, probably yes.
>
> But it's a l
But the text of the error message will explain all you need for debugging
and testing.
On Fri, Sep 3, 2021 at 10:08 AM Christopher Barker
wrote:
>
>
> On Fri, Sep 3, 2021 at 9:35 AM Guido van Rossum wrote:
>
>> The question is, would anyone ever want to make a distinction
mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/3CLXFC52JIBCFXMXR
My conclusion is that you should ignore PEP 8 for your use case and write
“if len(a) == 0”.
On Wed, Aug 25, 2021 at 06:13 Tim Hoffmann via Python-ideas <
python-ideas@python.org> wrote:
> Guido van Rossum wrote:
> > So then the next question is, what's the use case? What
What sort of code would be able to do anything useful with either a
sequence or a queue? Queues aren’t iterable. This seems a case of
hyper-generalization.
On Tue, Aug 24, 2021 at 22:19 Christopher Barker
wrote:
> Bringing this back on list:
>
> On Tue, Aug 24, 2021 at 9:58 PM David Mertz,
“Container” is a kind of pun, it’s something with a __contains__ method.
The thing you’re looking for is “Collection”, which is the base for
sequences, mappings and sets.
I also note that the discussion seems quite stuck.
—Guido
On Tue, Aug 24, 2021 at 21:55 Christopher Barker
wrote:
> It
On Tue, Aug 24, 2021 at 7:23 PM MRAB wrote:
> On 2021-08-25 00:48, Guido van Rossum wrote:
> > Hi Tim,
> >
> > I'm sorry if this has been brought up before, but *aside from PEP 8* is
> > there anything wrong with using "if len(a)" for nonempty, or &quo
> https://mail.python.org/archives/list/python-ideas@python.org/message/LRK6HHQKBH2Y4USB7DAJNOUF5NE62ZYD/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how
__
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/py
, 2021 at 14:28 Paul Prescod wrote:
> On Thu, Aug 19, 2021 at 8:43 AM Guido van Rossum wrote:
>
>> Perhaps we need a library for creating/managing threads that inherits all
>> current context values?
>>
>
> Or is it a "kind of context variable that is sha
Z6WDWVJI7QEJKICJZN72B5FYOEV/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_
ribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/VYZOMTCNSSAJNAYHRE5A5BJUMACY57SF/
> Code of Conduct: http://python.org/p
on-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/V2WFMNVJLUBXVQFPNHH4TJNRYNPK2
/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/2SYIBL275IIHMSPAT6J4K3TIA7HXEKV5/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/
expensive and may never be
needed, e.g. for logging at a level that is off in production. We can
debate whether it's better to mark individual substitutions with something
like {:...} or whether we should mark the template as a whole (obviously
the marking must be understandable by the parser).
--
for backticks.
Separately, should there be a way to *delay* evaluation of the templated
expressions (like we explored in our private little prototype last year)?
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-us
On Fri, Jun 25, 2021 at 12:17 PM Christian Heimes
wrote:
> On 25/06/2021 20.17, Guido van Rossum wrote:
> > On Fri, Jun 25, 2021 at 8:22 AM Bluenix > <mailto:bluenix...@gmail.com>> wrote:
> >
> > I am not fully aware of how ssl.SSLContext is used, but addin
On Fri, Jun 25, 2021 at 11:42 AM Chris Angelico wrote:
> On Sat, Jun 26, 2021 at 4:20 AM Guido van Rossum wrote:
> >
> > On Fri, Jun 25, 2021 at 8:22 AM Bluenix wrote:
> >>
> >> I am not fully aware of how ssl.SSLContext is used, but adding
> __slots
ivial change to their code,
depending on where they get their SSLContext instances.)
So unless there's evidence that nobody does that, we're stuck with the
status quo. I'm adding Christian Heimes to the thread in case he has a
hunch either way.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: h
Would a static type checker have found this?
On Fri, Jun 25, 2021 at 02:07 Thomas Grainger wrote:
> I was debugging some code that was using TLSv1.2 when I expected it to
> only support TLSv1.3, I tracked it down to a call to:
>
> context.miunimum_version = ssl.TLSVersion.TLSv1_3
>
> it should
On Fri, Jun 18, 2021 at 10:15 PM Steven D'Aprano
wrote:
> On Fri, Jun 18, 2021 at 09:33:49PM -0700, Guido van Rossum wrote:
>
> > Now, this shouldn't be considered an airtight argument against [*chunk
> for
> > ...], but it does show that there's no straightforward explanati
On Fri, Jun 18, 2021 at 8:40 PM Steven D'Aprano wrote:
> On Fri, Jun 18, 2021 at 07:38:49AM -0700, Guido van Rossum wrote:
>
> > Note the ambiguity around whether the user might have meant
> >
> > [x,(y for y in a)]
> >
> > or
> >
> >
On Fri, Jun 18, 2021 at 00:43 Serhiy Storchaka wrote:
> 18.06.21 00:22, Ben Rudiak-Gould пише:
> > Okay, slightly off-topic, but can we *please* allow
> >
> > [*chunk for chunk in list_of_lists]
> >
> > some day. I think it was left out because some discussion concluded it
> > would be too
Wow, strong language. Not really helping people see it your way.
On Thu, Jun 17, 2021 at 14:26 Ben Rudiak-Gould wrote:
> On Thu, Jun 17, 2021 at 12:37 AM Serhiy Storchaka
> wrote:
>
>> And it is equivalent to pure Python code
>>
>> [x for chunk in list_of_lists for x in chunk]
>>
>
> Okay,
Just trolling along, flattening a list could be written as
functools.reduce(list.__iadd__, xs, [])
Right?
On Wed, Jun 16, 2021 at 22:53 David Mertz wrote:
> On Thu, Jun 17, 2021, 1:38 AM Chris Angelico
>
>> >>> list(chain.from_iterable(list_of_lists))
>>
>> > More-itertools has flatten():
>>
jngaarden told us, somewhat ruefully, that, had the design
committee known that programmers would be happy to write that empty pair of
parentheses, they would have been able to simplify a significant corner of
Algol-68's type system.
This was one of the seminal ideas that went into Python's design.
On Fri, Jun 4, 2021 at 3:08 PM Thomas Güttler
wrote:
>
>
> Am Fr., 4. Juni 2021 um 19:20 Uhr schrieb Guido van Rossum <
> gu...@python.org>:
>
>> PEP 501 is unlikely to be accepted *as is*. But it’s still a good
>> starting point.
>>
>>
> OK, bef
PEP 501 is unlikely to be accepted *as is*. But it’s still a good starting
point.
Personally I would look for inspiration towards JavaScript template
literals (
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals),
combined with f-string-like interpolation.
On
Andre, did you have an experience where something related to Ellipsis/...
confused you? It is not clear to me what exactly prompted you to single out
Ellipsis (or it’s repr()?)
On Mon, May 31, 2021 at 08:37 André Roberge wrote:
>
>
> On Mon, May 31, 2021 at 12:20 PM MRAB wrote:
>
>> On
-Str.48
>> > D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
>> >Registered at Amtsgericht Duesseldorf: HRB 46611
>> >https://www.egenix.com/company/contact/
>> > https://www.m
Oh no, not the vertical bar hack. :-(
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
t;> (two/five)
> 0.4
> >>> (two/five).numerator
> Traceback (most recent call last):
> File "", line 1, in
> AttributeError: 'float' object has no attribute 'numerator'
>
This violates a basic property of Python. If 1/2 has a certain property,
th
precision upon printing. This could be easily fixed by starting
an addition with an inexact zero, but this was often non-intuitive and hard
to debug for beginners.
"""
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://fem
rfoo
is parsed as
import (foo.bar as foobar), (bar.foo as barfoo)
Similarly,
with something as foo, something_else as bar:
...
is parsed as
with (something as foo), (something_else as bar):
...
And similar in pattern matching.
It's true that adding "as e" makes it rea
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@pyth
mbols is just one avenue to prevent disappointment in the future.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
__
Please. Use. set().
On Sat, Apr 10, 2021 at 02:03 Serhiy Storchaka wrote:
> 09.04.21 19:08, micro codery пише:
> >
> > You can now use `{*()}` as a syntax for empty set.
> >
> > I saw that in the ast module and think it's clever, mainly in a good
> > way. I don't think it is the same as
But if there are two proposals with conflicting semantics for the same
syntax that kills both ideas, doesn’t it? Because apparently it’s not clear
what the syntax should mean.
On Fri, Apr 9, 2021 at 00:28 Serhiy Storchaka wrote:
> 08.04.21 17:59, anthony.flury via Python-ideas пише:
> > I was
o evaluate o.m (which may have a side
effect if o overrides __getattr__) before it calls f().
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pron
As I wrote, Skip’s Porto+PEP is not proposing to delete locals that are not
used in the rest of the function, only registers. So the voiced concerns
don’t apply.
On Sun, Mar 21, 2021 at 23:59 Chris Angelico wrote:
> On Mon, Mar 22, 2021 at 5:37 PM Ben Rudiak-Gould
> wrote:
> >
> > On Sun, Mar
). A version of the
example that exhibits the same questionable behavior would be this:
return create_pipeline()[-1].wait()
Presumably this would not work correctly with the PyQt5 process class.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://f
Can you file a bug for this on bpo and add Steve Dower to the nosy list?
On Fri, Mar 19, 2021 at 17:04 Dany Lisiansky wrote:
> An odd suggestion/request here, hope it's the right place to discuss it.
>
> So I was trying to install python on the Xbox series S (yup..), so far I
> got the embedded
>
> Which generates:
>
> def __init__(self, a, c, *, b, d):
> Would have __match_args__ equal to ('a', 'c', 'b', 'd'), right? Even
> though the repr would have fields in order a, b, c, d.
>
> Eric
> On 3/15/2021 7:45 PM, Guido van Rossum wrote:
>
> Good proposal
lists/python-ideas.python.org/),
> then. Thanks.
> ___
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.o
`None`, as we desire. And instead
> of being a `__contains__` with unusual semantics coupled with a constructor
> with unusual semantics, it's a pair of class methods that each have fairly
> unsurprising semantics.
>
> ~Matt
>
> On Mon, Mar 15, 2021 at 3:55 PM Guido van Rossum wrote
all have
> the same result: setting the kw_only flag on one or more fields.
>
> The value of that flag, on a per-field basis, is used to re-order
> __init__ arguments, and is used in generating the __init__ signature.
> It's not used anywhere else.
>
> I expect the two most
+1
On Mon, Mar 15, 2021 at 12:48 PM Ethan Furman wrote:
> On 3/15/21 11:27 AM, Guido van Rossum wrote:
> > On Mon, Mar 15, 2021 at 10:53 AM Ethan Furman wrote:
>
> >> Part of the reason is that there are really two ways to identify an
> >> enum -- by name
On Mon, Mar 15, 2021 at 10:53 AM Ethan Furman wrote:
> On 3/12/21 5:28 PM, Guido van Rossum wrote:
> > On Fri, Mar 12, 2021 at 1:52 PM Ethan Furman wrote:
>
> >> A question that comes up quite a bit on Stackoverflow is how to test
> >> to see if a value will result
:22 PM Guido van Rossum wrote:
>
>> If you feel so strongly about it maybe we need to see some credentials.
>> What's your background? (This may sound like an odd request, but reputation
>> matters, and right now I have no idea who you are or why I should take your
>> op
ss controls (without resorting to writing C code).
On Sun, Mar 14, 2021 at 12:42 PM Stestagg wrote:
> On Sun, 14 Mar 2021 at 18:58, Guido van Rossum wrote:
>
>> On Sun, Mar 14, 2021 at 7:11 AM Theia Vogel wrote:
>>
>>> > import the_module
>>>
>>>
. if `Y` is supposed
to represent a simple number or string -- we don't want any other part of
the language or stdlib to need to become aware of such proxies.)
Long answer short, yes, we can make it so that `the_module.sys` in your
example above is forbidden -- if we want to.
--
--Guido van Ros
On Fri, Mar 12, 2021 at 6:23 PM Peter Ludemann
wrote:
> [I wonder why C didn't adopt BCPL's convention for eliding semi-colons?
> ...]
>
[Presumably because it caused too many surprising behaviors...]
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pro
ig Caveat
>
> For this scheme to work, __all__ needs to not be auto-populated with names.
> While the behavior is possibly suprising, I think the best way to handle
> this is
> to have __all__ not auto-populate if an "export" keyword appears in the
> file.
add a recipe to the docs
>
But what would the recipe say? Apparently you're looking for a one-liner,
since you reject the try/except solution.
> 3) do nothing
>
Always a good option. :-) Where's that StackOverflow item? How many upvotes
does it have?
--
--Guido van Rossum (pytho
t
> https://mail.python.org/archives/list/python-ideas@python.org/message/LWB3U5BTGC4CT26U4AB676SKGED3ZOEX/
> > Code of Conduct: http://python.org/psf/codeofconduct/
>
> ___
> Python-ideas mailing list -- python-ideas@python.org
> To
Can we skip ahead to considering how to implement this? I can think of two
approaches: either hack the lexer to special-case a newline followed by a
period (which currently can never start a line), or redesign the syntax to
allow NEWLINE INDENT ‘.’ . NEWLINE ‘.’ DEDENT at the
as@python.org/message/KPVB2G64BHFGGOTXZQXT3AU7SIO5ABJE/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/
ew it though.
:-)
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
___
Python-ideas mailing list -- python-ideas@python.org
T
Also, code that is expecting an int should not behave differently when it
receives a bool.
On Mon, Feb 22, 2021 at 17:47 Chris Angelico wrote:
> On Tue, Feb 23, 2021 at 12:14 PM Soni L. wrote:
> >
> > Currently ~False is -1 and ~True is -2. Would be nicer if ~bool was the
> > same as not bool.
rpreted at runtime, and I don't
expect this to change in the near to middle future.
Plus, that syntax really has nothing to recommend it.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular
Okay, here’s my dilemma. It looks like this thread wants to devise a new
syntax for lambda, using e.g. (x, y) -> x+y, or the same with =>. That’s
great, but doesn’t open new vistas.
OTOH, for people using type annotations, a much more pressing issue is an
alternative for typing.Callable that is
I should add that I accidentally left out a word. It should be “... liable
to *overwrite* any or all names ...”
On Sun, Feb 14, 2021 at 12:10 Abdulla Al Kathiri <
alkathiri.abdu...@gmail.com> wrote:
> That makes sense. As Guido mentioned, this is similar to reusing a
> variable in a for-loop.
> happening? Any previous discussions on this?
>
> Thanks,
>
> Abdulla
> ___
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/
it would take to allow asynchronous
> lambdas. Syntactically, while "any lambda containing await" is tempting,
> the lack of static typing means that we need a way to specify async lambdas
> that do not contain await. Javascript prefixes the argument list with async
> [i.e. "a
mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/XZVZT3U237UCEI4FT6MZVU5MBZICV6ST/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him *
1 - 100 of 827 matches
Mail list logo