What if we used ? after the statement beginning?
name ?= person.name
custom_query ?= entity.get_query(context)
# Becomes None if entity is None. Raise an exception if entity is not None and
get_query is None or undefined.
custom_query ??= entity.get_query(context)
# If entity, entity.get_query, e
> 4 - introducing a new keyword is the hardest thing you can ever ask on
> this list.
As is already a keyword from with-as and except-as. Perhaps for compatibility
“as” is allowed but discouraged as a variable name, and it’s only interpreted
as a keyword when followed by an expression and a colo
> You mean lambda x: lumberjack(15, x) ?
Yes, that was my mistake.
> However this syntax you allow to write lumberjack(%, 15) which is only
> possible with partial using keyword arguments, like lumberjack (y=15)
> (given that the second argument is called "y") and in that case I know at
> least o
> I several times wished I could have had a reference to the block of code in a
> `with` clause.
Could you abstractly describe a real-world example of this? I’d like to hear
your use case.
> The example for sorted is also kinda twisted.
It is, it’s probably a counterexample on how to use it.
By passing a function to another function I meant passing a code block as an
inline function to a function call.
The do statement is simply the arguments the function is called with
Brackets = optional
as expr [do comma-separated-expressions]:
block
means evaluate expr, then call the result
I propose we apply PEP 3132 to PEP 203. That is, for every statement where
" = " is valid I propose "lhs += rhs" should also be valid.
Simple example:
a = 0
b = 0
a, b += 1, 2
# a is now 1
# b is now 2
___
Python-ideas mailing list
Python-ideas@python.or
Steve and Johnathan, it seems like we're on the same page.
Currently, is = = = always equivalent
to = ; = ; = ?
When there are a tuple or list of names on the left hand side (ex.
`a, b` or `(a, b)` or `[a, b]`), unpack the right hand side into
values and perform the augmented assignment on
simulation in python that required incrementing a tallying counter
from a subroutine.
Not sure where the rest of your message was going; it mostly just
> seemed to repeat examples from earlier posts?
>
Yes, I just wanted to summarize the existing discussion.
On S
[Kirill Balunov]
It may be worth taking a look at + and +=. However, the semantic
difference is due to the dunder add and dunder iadd methods-
necessary for supporting both mutable and immutable sequences. See my
earlier mail for discussion on this topic.
By the way,
> the absence of literals fo
-
>
> Message: 1
> Date: Mon, 27 Aug 2018 01:29:14 -0400
> From: Matthew Einhorn
> To: python-ideas@python.org
> Subject: Re: [Python-ideas] Unpacking iterables for augmented
> assignment
> Message-ID:
> ym
riteria that are used in evaluating a proposed
> feature on python-ideas and python-dev.
>
> Apologies for breaking the thread, but per Subject it's not really part
> of the thread.
>
> James Lu writes:
>
> > I could, but I don't think that justifies not havin
Why shouldn't Python be better at implementing Domain Specific Languages?
>From Johnathan Fine:
> I really do wish we could have language that had all of Ruby's
> strengths, and also all of Python's. That would be really nice. Quite
> something indeed.
> Languages do influence each other. Ruby is
We should all take a look at Ruby Blocks and think about how Python could
benefit from something similar.
> On Aug 31, 2018, at 3:14 AM, Abdur-Rahmaan Janhangeer
> wrote:
>
> i believe a DSL is simple enough for an enthusiastic py programmer to write
> if you really wanted one
>
> just write
What if * and ** forwarded all unnamed arguments to a function? Example:
import traceback
def print_http_response(request, color=True):
...
def print_invalid_api_response(error, *, show_traceback=False, **):
print_http_response(*, **)
if show_traceback:
traceback.print_last()
I wholly support this proposal.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
Have y’all seen ptpython’s autocomplete and syntax highlighting features?
Ptpython, usually used as a cli application, might be worth integrating into
IDLE.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/p
In response to your Sat, 15 Sep 2018 22:14:43:
A good and thoughtful read. I agree with all your points. +1.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org
It’s been almost a week since this “discussion” first started. Can we please
stop this in the name of productive work on python-ideas? Frankly, you don’t
need to reply just because you can point out something wrong with someone
else’s argument. Post because it’s worthwhile to hear, not because y
I agree completely.
I propose Python register a trial of Stack Overflow Teams. Stack Overflow Teams
is essentially your own private Stack Overflow. (I will address the private
part later.) Proposals would be questions and additions or criticism would be
answers. You can express your support or
> It was decided to try https://www.discourse.org at the core dev
> sprints. We'll likely try it for the upcoming governance model/vote
> discussions. If it works well we'll consider using it for other
> discussions in the future.
>
> Let's table this topic for now as we're unlikely to
So... we
How can the Zulip chat be joined? Im interested in consolidating all the
discussion into one centralized forum.
Sent from my iPhone
> On Sep 17, 2018, at 3:35 PM, Philippe Godbout wrote:
>
> Also, by restricting to python.org email address, do we not run the risk of
> cutting off a lot of wo
> Is that really an issue here? I personally haven't seen threads where
> Brett tried to stop an active discussion, but people ignored him and
> kept fighting.
Not personally with Brett, but I have seen multiple people try to stop the
“reword or remove beautiful is better than ugly in Zen of Pytho
It would be nice if there was a guide on using Python-ideas and writing PEPs.
It would make it less obscure.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/p
? Lee <
leewangzhong+pyt...@gmail.com> wrote:
> On Tue, Sep 18, 2018 at 8:21 PM James Lu wrote:
> >
> > > Is that really an issue here? I personally haven't seen threads where
> > > Brett tried to stop an active discussion, but people ignored him and
> > >
ake that happen,
the forum experience must be better for both
On Tuesday, September 18, 2018 at 8:21:46 PM UTC-4, James Lu wrote:
>
> > Is that really an issue here? I personally haven't seen threads where
> > Brett tried to stop an active discussion, but people ignored him and
> Frankly, I think the bigger issue is all too human -- we get sucked in and
> participate when we really know we shouldn't (or maybe that's just me).
>
That may be why some people misbehave, but we have no way of discouraging that
misbehavior.
> And I'm having a hard time figuring out how moder
> Frankly, I think the bigger issue is all too human -- we get sucked in and
> participate when we really know we shouldn't (or maybe that's just me).
>
That may be why some people misbehave, but we have no way of discouraging that
misbehavior.
> And I'm having a hard time figuring out how moder
Were there any productive parts to that conversation?
Sent from my iPhone
> On Sep 20, 2018, at 9:47 AM, Chris Barker wrote:
>
>> On Thu, Sep 20, 2018 at 1:39 PM, James Lu wrote:
>> In a forum, the beautiful is better than ugly issue would be locked. No more
>
> It's absence is a big advantage. We're not a social network with
> "likes". We don't need a bunch of argumentless "voting".
Up/ down voting indicates how much consensus we have among the entire
community- an expert might agree with another expert’s arguments but not have
anything else to add,
One of the reasons Guido left was the insane volume of emails he had to read on
Python-ideas.
> A tiny bit of discussion is still better than none at all.
> And even if there's no discussion, there's a name attached
> to the message, which makes it more personal and meaningful
> than a "+1" coun
JS’ decisions are made by a body known as TC39, a fairly/very small group of JS
implementers.
First, JS has an easy and widely supported way to modify the language for
yourself: Babel. Babel transpires your JS to older JS, which is then run.
You can publish your language modification on the JS
> Babel's primary purpose is transpiling to run on older browsers, which isn't
> that much of an issue with Python. It's also complicated a bit by the large
> number of implementations that *must* be developed in sync, again due to
> running in user's browsers.
It’s true that one of Babel’s pur
> To my mind, there is one very big reason we should be cautious about
> adopting JS language-design policies, namely, that they have led to a
> very, very poorly designed language. No doubt a good deal of that is
> baggage from early stages in which JS had a poor to nonexistent language
> des
You could disassemble (import dis) the lambda to biew the names of the lambdas.
@before(lambda self, key, _, length, get: self.length(), self.get(key))
Perhaps you could disassemble the function code and look at all operations or
accesses that are done to “old.” and evaluate those expressions be
Perhaps it’s because fewer Python functions involve transitioning between
states. Web development and statistics don’t involve many state transition.
State transitions are where I think I would find it useful to write contracts
out explicitly.
___
Pyth
> Which features of the TC39 committee's ECMAscript (ES) language governance
> model would be helpful to incorporate into the Python language governance
> model?
Having “beta” or “alpha” editions of features, special versions of the
interpreter people can test out to see if they prefer the versio
> There is macropy (https://github.com/lihaoyi/macropy) which was suggested on
> the other thread
> (https://groups.google.com/forum/#!topic/python-ideas/dmXz_7LH4GI) that I'm
> currently looking at.
>
> Cheers,
> Marko
>
>
>> On Tue, 25 Sep 2018 at 00:35, J
ly looking at.
>
> Cheers,
> Marko
>
>
>> On Tue, 25 Sep 2018 at 00:35, James Lu wrote:
>> You could disassemble (import dis) the lambda to biew the names of the
>> lambdas.
>>
>> @before(lambda self, key, _, length, get: self.length(), self.get(key
> I'm surprised you haven't found
>inspect.getsource(func)
I did. That’s exactly what I was describing in the paragraph. It wouldn’t work
in interactive mode and it includes everything on the same line of the lambda
definition.
___
Python-ideas mai
I still prefer snapshot, though capture is a good name too. We could use
generator syntax and inspect the argument names.
Instead of “a”, perhaps use “_”. Or maybe use “A.”, for arguments. Some people
might prefer “P” for parameters, since parameters sometimes means the value
received while the
repeat could be only considered a keyword when it’s used as a loop
Sent from my iPhone
> On Sep 26, 2018, at 8:46 AM, Brice Parent wrote:
>
>> Le 26/09/2018 à 14:33, James Lu a écrit :
>> what about “repeat:”?
>>
>> Sent from my iPhone
> I'm not sure it
> It's easy to say that they're boolean expressions. But that's like
> saying that unit tests are just a bunch of boolean expressions too.
> Why do we have lots of different forms of test, rather than just a big
> fat "assert this and this and this and this and this and this"?
> Because the key to
; for "old" and "P" for parameters in a condition:
> @post(lambda O, P: ...)
> ?
>
> It also has the nice property that it follows both the temporal and the
> alphabet order :)
>
>> On Wed, 26 Sep 2018 at 14:30, James Lu wrote:
>> I still prefe
full power of a lambda. It’s arguably more succinct and readable, though YMMV.
I look forward to reading your opinion on this and any ideas you might have.
> On Sep 26, 2018, at 3:56 PM, James Lu wrote:
>
> Hi Marko,
>
>> Actually, following on #A4, you could a
> items = ["foo", "bar", "quux"]
> items[randrange(3)] .= upper()
>
> Is this equivalent to:
>
> items[randrange(3)] = items[randrange(3)].upper()
>
> ? That would call randrange twice, potentially grabbing one element
> and dropping it into another slot. If it isn't equivalent to that, how
> is it
> As I see it, you are mixing very different things. Augmented operators in
Python work on objects, generally trying to mutate them in-place. So
usually after these operations you have the same object (with the same
type, with the same name and etc.) as before these operations. Of course
there are
> I agree that this adds ambiguity where we can't be sure whether text .=
> encode('utf-8') is referring to the function or the method. We can infer
> that it *ought* to be the method, and maybe even add a rule to force
> that, but this works only for the simple cases. It is risky and error
> p
rts.
>
> I performed a small experiment to test how this solution plays with pylint
> and it seems OK that arguments are not used in lambdas.
>
> Cheers,
> Marko
>
>
>> On Thu, 27 Sep 2018 at 12:27, James Lu wrote:
>> Why couldn’t we record the operations done to
Hi Marko,
I honestly don’t know how many people are using coconut. Though with a little
bit of configuring Python’s import functionality, it should have decent inter
compatibility. Even without Coconut, I still find icontract’s plain Python
lambda syntax readable and useful.
James Lu
>
;> It's not too verbose for me and you can still explain in three-four
>> sentences what happens below the hub in the library's docs. A
>> pycharm/pydev/vim/emacs plugins could hide the verbose parts.
>>
>> I performed a small experiment to test how this sol
Let’s get some ideas for how icontract can say “it should throw an exception if
this happens.”
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduc
Many editors highlight decorators in a different color that makes it easier to
ignore and can also fold decorators.
Contracts can also sometimes actively improve the flow of code.
I personally find a formal contract easier to read than informal documentation.
It also reduces the times where y
ing an editable document like HackMD where we can label all
the different ideas to keep them straight in our head.
James Lu
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://pyth
Hi Marko,
> If the documentation is clear, I'd expect the user to be able to distinguish
> the two. The first approach is shorter, and uses magic, but fails in some
> rare situations. The other method is more verbose, but always works.
I like this idea.
James Lu
> On Sep 29,
syntax should be supported?
Would
with requiring: assert arg1 < arg2, “message”
Be the code you type or the code that’s actually run?
James Lu
> On Sep 29, 2018, at 2:56 PM, Marko Ristin-Kaufmann
> wrote:
>
> Just
___
Python-ideas mail
, so the point may be moot
if the natural indentation also gives the same visual alignment.
Though both should be supported so the best syntax may win.
James Lu
> On Sep 29, 2018, at 3:22 PM, Marko Ristin-Kaufmann
> wrote:
>
> I reread the proposal with MockP. I still don&
It has a nice GUI for people who spectate a discussion to read emails
without having to subscribe to the list.
http://docs.mailman3.org/en/latest/migration.html
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinf
ub issues would be a suitable place for that:
> https://github.com/Parquery/icontract/issues
>
> It reads a bit easier as a discussion rather than a single document -- if
> anybody else needs to follow. What do you think?
>
> On Sun, 30 Sep 2018 at 22:07, James Lu wrote:
will use MockP protocol and otherwise it will check the object is callable
and treat it as a lambda.
Your approach has better type hinting, but I’m not sure if type hinting would
be that useful if you’re adding a contract whilst writing the function.
James Lu
> On Oct 1, 2018, at 1:01 AM, Ma
I think the confusion would be minimal and not worth the hassle of renaming to
pcontract. People would just say “Python icontract” when it’s ambiguous.
Sent from my iPhone
> On Oct 1, 2018, at 3:28 AM, Marko Ristin-Kaufmann
> wrote:
>
> Hi Cameron,
> A nerdy way to make it sound like a senten
The file system is really just a b-tree. If you’re concerned about using memory, you can implement a O(log n) map using the file system, where the entires are the different critical sections.Every node is a folder and every file is a leaf. Many package managers implement maps like this. I’d like to
> Interesting. In the thread you linked on DBC, it seemed like Steve
D'Aprano and David Mertz (and possibly others) were put off by the
verbosity and noisiness of the decorator-based solution you provided with
icontract (though I think there are ways to streamline that solution). It
seems like synt
Backtick expressions work exactly like lambdas, except that they are bound to
the instance they are created in every time that class is used to create one.
To illustrate, this “percent” property is bound to the instance, not to the
class.
class Example:
percent = property(`self.v*self.v2/100`)
So here’s an interesting idea, not a proposal yet.
In C++20, a Concept is a list of Boolean expressions with a name that can be
used in place of a type in a templated (ie type-generic) function.
from typing import Concept
Iterator = Concept(lambda o: hasattr(o, "__iter__", lambda o: iter(o) !=
> On Jan 21, 2019, at 1:56 AM, Steven D'Aprano wrote:
>
> It disturbs me that you believe you get to tell everyone what syntax
> highlighting they should use for this feature. That's pretty
> dictatorial, and not in a good BDFL way.
I don’t want to tell anyone how to make their syntax highlig
> On Jan 21, 2019, at 1:56 AM, Steven D'Aprano wrote:
>
> It disturbs me that you believe you get to tell everyone what syntax
> highlighting they should use for this feature. That's pretty
> dictatorial, and not in a good BDFL way.
I don’t want to tell anyone how to make their syntax highlig
Later today I will send a working implementation of backtick expressions as a
function call.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
I’m a little busy recently, so I’ll reply to as much as I can now and reply to
the rest later.
Scratch the stuff I said about scope. Backtick expressions should inherit the
scope normally like any other nested function.
> That's different behaviour from regular functions, where names are only
specification, I've been working on an example
implementation I'll send soon for backtick expressions.
I've also been doing the "look for use cases in stdlib" thing that
Johnathan and Steve mentioned.
On Wed, Jan 23, 2019 at 3:02 AM Bruce Leban wrote:
> On Sun
I always use ptipython (ptpython shell over the ipython console) for my
REPLs. The built-in python repl is not *batteries included* in the sense
that it already has what you need to explore the language.
I wonder, what do the python committers think about including a
stripped-down version of ipyth
A lot of the traffic on this email list is people saying “I don’t understand”
or “that’s not what I meant” or trying to re-explain. A lot of “-1”s are really
“I don’t see the usefulness of this”.
So I want an open discussion on: How can we communicate clearer?
How do ideas on this mailing list turn into features? What is the typical
roadmap? Can this process be documented somewhere?___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http:
It’s difficult to learn anything with a body (such as a loop or a class or a
function) with the built in REPL because you can’t edit lines you’ve already
written.
Sent from my iPhone
> On Feb 1, 2019, at 1:44 PM, Steven D'Aprano wrote:
>
>> On Fri, Feb 01, 2019 at 09:07:14A
> I want the discussion to focus not only on technical solutions like +1 or
> Mailman 3, but also social ones and how to better express oneself.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
C
It’s very demotivating to hear just negative feedback on this list.
Was starting this thread useful for y’all?
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/
I want y’all to think about this very carefully. What factors led Guido to
quit? And I don’t want you to just reply with the first thing that comes off
your head. The purpose of this question/discussion is to identify problems with
the Python community so we can fix them.
That is the only real
This list IS hard for newcomers. I wish there was one place where I could read
up on how to not feel like a noob.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.
I think we need to step away from the egalitarian ideal and have some way of
knowing that Python committees are python committers. It’s really difficult to
know how well your proposal is doing without having this.
___
Python-ideas mailing list
Python-id
There is no need for any of you to argue over this small point. Tolerate each
other’s language.
Sent from my iPhone
> On Feb 2, 2019, at 3:58 AM, Steven D'Aprano wrote:
>
>> On Sat, Feb 02, 2019 at 05:10:14AM +, MRAB wrote:
>>> On 2019-02-02 04:32, Steven D'Aprano wrote:
>>> [snip]
>>>
>>
Sent from my iPhone
> On Feb 2, 2019, at 3:41 AM, Steven D'Aprano wrote:
>
>> On Sat, Feb 02, 2019 at 12:06:47AM +0100, Anders Hovmöller wrote:
>>
>>> - the status quo means "no change", so there is no hassle there;
>>
>> Not quite true. There is a constant hassle of "do I need to write
>>
ur own blog or Facebook account if you feel so strongly about it.
>
> Regards
>
> Antoine.
>
>
> On Sat, 2 Feb 2019 11:04:40 -0500
> James Lu wrote:
>> I want y’all to think about this very carefully. What factors led Guido to
>> quit? And I don’t want you to j
n-is-growing-so-quickly-future-trends
> https://www.economist.com/graphic-detail/2018/07/26/python-is-becoming-the-worlds-most-popular-coding-language
> Are there indicators we are missing?
>
> --Ned.
>
>> On 2/2/19 11:56 PM, James Lu wrote:
>> Sent from my iPhone
>>
>&
Well, the question wasn’t about any specific proposal but improving
communication in general. I don’t have a specific straw man.
Sent from my iPhone
> On Feb 2, 2019, at 7:00 PM, Steven D'Aprano wrote:
>
>> On Sat, Feb 02, 2019 at 10:59:36AM -0500, James Lu wrote:
>>
>> On Feb 2, 2019, at 7:17 PM, Steven D'Aprano wrote:
>>
>> On Sat, Feb 02, 2019 at 11:12:02AM -0500, James Lu wrote:
>>
>> This list IS hard for newcomers. I wish there was one place where I
>> could read up on how to not feel like a noob.
>
&
https://www.python.org/download/alternatives/ should possibly mention:
- Cython and Nuitka
- Mention the possibility of compiling Python to WASM
- WASM allows Web and Mobile use of Python at possibly native speed.
Though not mature yet, Pyodide is a working implementation.
_
I agree with everything all of you have said in reply to me.
Sent from my iPhone
> On Feb 3, 2019, at 7:34 PM, Ned Batchelder wrote:
>
>> On 2/3/19 6:01 PM, Steven D'Aprano wrote:
>> (1) Taking the group discussion off-list should be done rarely, and
>> usually only for personal messages that s
Here are some alternate syntaxes.
These are all equivalent to len(print(list)).
(len | print)(list)
(len |> print)(list)
(print <| len)(list)
print <| len << list
list >> print <| len
list >> len |> print
## Traditional argument order
print <| len << list
## Stored functions
print_lengths =
Sometimes I see threads briefly go into topics that are unrelated to new
features in Python. For example: talking about a writer’s use of
“inhomogeneous” vs “heterogenous” vs “anhomogenous.” We get what the original
author meant, there is no need to fiddle with the little details of language at
Has anyone thought about my proposal yet? I think because it allows chained
function calls to be stored, which is probably something that is a common; if
imagine people turning the same series of chained functions into a lambda of
its own once it’s used more than once in a program.
Arguably, th
A general rule of thumb is, if Python feels inconvenient or awkward, you’re
doing something wrong.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofc
I agree with Storchaka here. The advantage of existing dict merge syntax is
that it will cause an error if the object is not a dict or dict-like object,
thus preventing people from doing bad things.
> On Feb 28, 2019, at 2:16 AM, Serhiy Storchaka wrote:
>
> 27.02.19 20:48, Guido van Rossum пи
I propose that the + sign merge two python dictionaries such that if there are
conflicting keys, a KeyError is thrown.
This way, d1 + d2 isn’t just another obvious way to do {**d1, **d2}. The second
syntax makes it clear that a new dictionary is being constructed and that d2
overrides keys fro
> On Mar 4, 2019, at 3:41 AM, Stefan Behnel wrote:
>
> James Lu schrieb am 04.03.19 um 03:28:
>> I propose that the + sign merge two python dictionaries such that if there
>> are conflicting keys, a KeyError is thrown.
>
> Please, no. That would be really anno
>> On Mar 4, 2019, at 4:51 AM, Stefan Behnel wrote:
>
> Jimmy Girardet schrieb am 04.03.19 um 10:12:
>> I'm not old on this list but every time there is a proposal, the answer
>> is "what are you trying to solve ?".
>>
>> Since
>>
>> |z ={**x,**y} and z.update(y) Exists, I can"t find the answer
> On Mar 4, 2019, at 10:02 AM, Stefan Behnel wrote:
>
> INADA Naoki schrieb am 04.03.19 um 11:15:
>> Why statement is not enough?
>
> I'm not sure I understand why you're asking this, but a statement is "not
> enough" because it's a statement and not an expression. It does not replace
> the co
> On Mon, Mar 04, 2019 at 10:01:23AM -0500, James Lu wrote:
>
> If you want to merge it without a KeyError, learn and use the more explicit
> {**d1, **d2} syntax.
On Mar 4, 2019, at 10:25 AM, Steven D'Aprano wrote:
> In your previous email, you said the {**d ...}
On Mar 4, 2019, at 11:25 AM, Steven D'Aprano wrote:
>> How many situations would you need to make a copy of a dictionary and
>> then update that copy and override old keys from a new dictionary?
>>
>
> Very frequently.
>
> That's why we have a dict.update method, which if I remember correctly
> On Mar 4, 2019, at 11:25 AM, Steven D'Aprano wrote:
>
> The PEP gives a good example of when this "invariant" would be
> unnecessarily restrictive:
>
>For example, updating default configuration values with
>user-supplied values would most often fail under the
>requirement that
By the way, my “no same keys with different values” proposal would not apply to
+=.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
large portion of Python users primarily use online
documentation
James Lu
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
1 - 100 of 135 matches
Mail list logo