On 15/12/20 15:26, Grant Edwards wrote:
> On 2020-12-15, Mark Polesky via Python-list wrote:
>
>> I see. Perhaps counterintuitive,
> I guess that depends on what programming language you normally think
> in. Python's handling of function parameters is exactly what I
> expected, because all of the
On 2020-12-16 at 12:01:01 +1300,
dn via Python-list wrote:
> > On Tue, Dec 15, 2020 at 9:57 AM Mark Polesky via Python-list <
> > python-list@python.org> wrote:
> >
> >> Hi.
> >>
> >> # Running this script
> >>
> >> D = {'a':1}
> >> def get_default():
> >> print('Nobody expects this')
>
On 12/15/2020 11:25 AM, Bob Gailer wrote:
On Tue, Dec 15, 2020, 10:42 AM <2qdxy4rzwzuui...@potatochowder.com> wrote:
On 2020-12-15 at 16:04:55 +0100,
Jan Erik Moström wrote:
I want to do some text substitutions but a bit more advanced than what
string.Template class can do. I addition to pla
On 12/15/2020 1:42 PM, Skip Montanaro wrote:
Dang... I'm having very incomplete thoughts. Apologies for the multiple
replies when one would have sufficed.
https://docs.python.org/3/whatsnew/3.9.html
In particular, for latest release (now 3.9) you would want tkinter in
https://docs.python.org/3
On Wed, Dec 16, 2020 at 10:03 AM dn via Python-list
wrote:
>
> On 16/12/2020 07:52, Dan Stromberg wrote:
> ...> BTW, I tend to prefer collections.defaultdict over the two argument
> D.get
> > or setdefault.
>
>
> Contrarily, dict.get() seems 'better', unless (a) the dict's values are
> all to be i
On 16/12/2020 07:52, Dan Stromberg wrote:
...> BTW, I tend to prefer collections.defaultdict over the two argument
D.get
or setdefault.
Contrarily, dict.get() seems 'better', unless (a) the dict's values are
all to be initialised to the same value, eg all None, int 0, or empty
list []; or (
> On Tue, Dec 15, 2020 at 9:57 AM Mark Polesky via Python-list <
> python-list@python.org> wrote:
>
>> Hi.
>>
>> # Running this script
>>
>> D = {'a':1}
>> def get_default():
>> print('Nobody expects this')
>> return 0
>> print(D.get('a', get_default()))
>>
>> # ...generates this out
On Tue, Dec 15, 2020 at 11:05 AM Serhiy Storchaka
wrote:
> 15.12.20 19:07, Mark Polesky via Python-list пише:
> > # Running this script
> >
> > D = {'a':1}
> > def get_default():
> > print('Nobody expects this')
> > return 0
> > print(D.get('a', get_default()))
> >
> > # ...generates
On 12/15/20 9:07 AM, Mark Polesky via Python-list wrote:
> D = {'a':1}
>
> def get_default():
> print('Nobody expects this')
> return 0
>
> print(D.get('a', get_default()))
Python has short-circuiting logical operations, so one way to get the behavior
you're looking for is:
D.get
On 2020-12-15, Mark Polesky via Python-list wrote:
> I see. Perhaps counterintuitive,
I guess that depends on what programming language you normally think
in. Python's handling of function parameters is exactly what I
expected, because all of the previous languages I used did the same
thing.
Pu
I see. Perhaps counterintuitive, but implemented consistently. Add it to the
list of gotchas, I guess.
By the way... four helpful responses in under an hour, very impressive. Nice
community here. Thanks to all who answered.
Mark
On Tuesday, December 15, 2020, 11:05:10 AM PST, Serhiy Storc
On Tue, 15 Dec 2020, Skip Montanaro wrote:
Dang... I'm having very incomplete thoughts. Apologies for the multiple
replies when one would have sufficed.
https://docs.python.org/3/whatsnew/3.9.html
Skip,
No apologies needed. That page looks like a reformatted Release Notes.
Thanks again,
Ric
On Tue, 15 Dec 2020, Skip Montanaro wrote:
Also, check www.python.org for "What's New" pages. I believe one is
generated for every release. It will be less detailed than change logs in
GitHub, but more reader friendly.
Skip,
I don't find a "What's New" page, but under Download -> All Releases
On Tue, 15 Dec 2020, Skip Montanaro wrote:
Change logs are kept as part of the source, I believe. Try browsing the
cpython GitHub repo:
https://github.com/python/cpython
Skip,
Thanks, I will.
Stay well,
Rich
--
https://mail.python.org/mailman/listinfo/python-list
15.12.20 19:07, Mark Polesky via Python-list пише:
> # Running this script
>
> D = {'a':1}
> def get_default():
> print('Nobody expects this')
> return 0
> print(D.get('a', get_default()))
>
> # ...generates this output:
>
> Nobody expects this
> 1
>
> ###
>
> Since I'm brand new t
On Wed, Dec 16, 2020 at 4:58 AM Mark Polesky via Python-list
wrote:
>
> Hi.
>
> # Running this script
>
> D = {'a':1}
> def get_default():
> print('Nobody expects this')
> return 0
> print(D.get('a', get_default()))
>
> # ...generates this output:
>
> Nobody expects this
> 1
>
> ###
>
On Tue, Dec 15, 2020 at 9:57 AM Mark Polesky via Python-list <
python-list@python.org> wrote:
> Hi.
>
> # Running this script
>
> D = {'a':1}
> def get_default():
> print('Nobody expects this')
> return 0
> print(D.get('a', get_default()))
>
> # ...generates this output:
>
> Nobody exp
Dang... I'm having very incomplete thoughts. Apologies for the multiple
replies when one would have sufficed.
https://docs.python.org/3/whatsnew/3.9.html
Skip
--
https://mail.python.org/mailman/listinfo/python-list
Also, check www.python.org for "What's New" pages. I believe one is
generated for every release. It will be less detailed than change logs in
GitHub, but more reader friendly.
Skip
--
https://mail.python.org/mailman/listinfo/python-list
Change logs are kept as part of the source, I believe. Try browsing the
cpython GitHub repo:
https://github.com/python/cpython
Skip
On Tue, Dec 15, 2020, 10:05 AM Rich Shepard
wrote:
> I've upgraded from Python-3.7.x to Python-3.9.x and want to learn about
> differences (if any) in tkinter bet
Hi.
# Running this script
D = {'a':1}
def get_default():
print('Nobody expects this')
return 0
print(D.get('a', get_default()))
# ...generates this output:
Nobody expects this
1
###
Since I'm brand new to this community, I thought I'd ask here first... Is this
worthy of a bug rep
On Tue, Dec 15, 2020, 10:42 AM <2qdxy4rzwzuui...@potatochowder.com> wrote:
> On 2020-12-15 at 16:04:55 +0100,
> Jan Erik Moström wrote:
>
> > I want to do some text substitutions but a bit more advanced than what
> > string.Template class can do. I addition to plain text substitution I
> would
>
I've upgraded from Python-3.7.x to Python-3.9.x and want to learn about
differences (if any) in tkinter between the two versions.
Looking on the python.org web site I did not find change logs with the
sources or under the other menus I checked. Please point me to any available
logs.
Regards,
Ri
On 2020-12-15 at 16:04:55 +0100,
Jan Erik Moström wrote:
> I want to do some text substitutions but a bit more advanced than what
> string.Template class can do. I addition to plain text substitution I would
> like to be able to do some calculations:
>
> $value+1 - If value is 16 this would inse
I want to do some text substitutions but a bit more advanced than what
string.Template class can do. I addition to plain text substitution I
would like to be able to do some calculations:
$value+1 - If value is 16 this would insert 17 in the text. I would also
like to subtract.
$value+1w - I
Hello!
I'm pleased to announce version 3.9.0, the first release
of branch 3.9 of SQLObject.
What's new in SQLObject
===
Contributors for this release are:
+ Michael S. Root, Ameya Bapat - ``JSONCol``;
+ Jerry Nance - reported a bug with ``DateTime`` from ``Zope``.
Feature
Il 15/12/2020 12:25, Chris Angelico ha scritto:
On Tue, Dec 15, 2020 at 9:56 PM jak wrote:
this could be a way to emulate a long_jump:
def f(i):
if i < 10:
i += 1
yield from f(i)
else:
yield i
i = 0
retult = 0
for n in f(i):
result = n
br
Il 12/12/2020 07:39, ast ha scritto:
Hello
In case a function recursively calls itself many times,
is there a way to return a data immediately without
unstacking all functions ?
try this way:
def path_finder(graph, start, end, path=[]):
if start in path:
yield None
if start =
On Tue, Dec 15, 2020 at 9:56 PM jak wrote:
>
> this could be a way to emulate a long_jump:
>
> def f(i):
> if i < 10:
> i += 1
> yield from f(i)
> else:
> yield i
>
> i = 0
> retult = 0
> for n in f(i):
> result = n
> break
> print(result)
>
Note tha
Il 15/12/2020 10:41, jak ha scritto:
Il 12/12/2020 18:20, Dieter Maurer ha scritto:
ast wrote at 2020-12-12 07:39 +0100:
In case a function recursively calls itself many times,
is there a way to return a data immediately without
unstacking all functions ?
Python does not have "long jump"s (ou
Il 12/12/2020 18:20, Dieter Maurer ha scritto:
ast wrote at 2020-12-12 07:39 +0100:
In case a function recursively calls itself many times,
is there a way to return a data immediately without
unstacking all functions ?
Python does not have "long jump"s (out of many functions, many loop
incarna
31 matches
Mail list logo