teresting example to argue against my claim that == None is reliable.
>
> Best,
>
> Nick
>
> On Mon, Aug 30, 2021 at 12:06 PM Matthias Bussonnier
> wrote:
>>
>> From my point of view as someone who sometimes help Scientist write
>> Python, this is a no
>From my point of view as someone who sometimes help Scientist write
Python, this is a no go, there are too many cases where == and is are
different.
$ ipython
Python 3.8.5 | packaged by conda-forge | (default, Sep 16 2020, 17:43:11)
Type 'copyright', 'credits' or 'license' for more information
I
Methods that mutate their argument typically return None, to avoid
confusing them with methods that return copies;
If you both mutate and return a copy it is easy to end up with shared
objects in place you actually don't want them
>>> even = [2,4,6]
>>> odd = [1,3,5]
>>> all = odd.extend(even)
.
Works well with 0 parameters and currying, read almost like a haskell
function definition.
f = () => ((b) => b)
g = (a) => (b) => b+a
h = (a) => (b) => (b, a)
i = (a,b) => a
print(f()(2))
print(g(1)(2))
print(h(1)(2))
print(i(1, 2))
On Sat, 13 Feb 2021 at 06:35, Paul Sokolovsky wrote:
>
> He
If it's for the REPL, it's already there, you simply need to start the
async REPL.
$ python -m asyncio
asyncio REPL 3.8.5 | packaged by conda-forge | (default, Sep 16 2020, 17:43:11)
[Clang 10.0.1 ] on darwin
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "
Chris Said:
> If I'm understanding you correctly, this means I could do something like:
>
> $ python3 -m venv env --see-also ../master-env
>
> and then any packages installed in master-env would be visible inside
> this environment too? Seems pretty useful to me.
Yes, it does allows multiple p
Hello Python Ideas,
Would there be any interest in upstreaming a patch allowing virtualenv to be
inherited in core python ?
I'm working with a company that uses such an internal patch and would be ok
with me spending some time trying to upstream it.
When creating a venv, this let you point
Oh, well, but stdlib json already emit (and parse) invalid json by default...
$ ipython
Python 3.8.3 (default, May 19 2020, 13:54:14)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.15.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import json
In [2]: jso
Many of the tempfile modules' classes and utils could maybe return
Path instead of str. I'm not sure how disruptive that would be, but I
would definitely welcome something that avoids having to wrap
everything in Path.
I think they might need to return a "StrPath" for compatibility, but
IMHO only
numpy arrays are ... arrays, if you want * to do matmul, use
numpy.matrix (which is soft deprecated since now we have @), and will
do what you expect with square matrix times vector.
broadcasting is the natural extension of array `op` scalar on... arrays.
Say you have an array Pressure with 3 coo
> Do you mean that it's not possible to implement this at the syntax level
> because we don't know until runtime if this is being call from a loop (async
> calling sync code) ?
No. I'm saying you should clarify the semantics you want if you have
if your sync `test()` is called from within an asy
See some of the previous discussions on asyncio reentrancy.
https://mail.python.org/pipermail/async-sig/2019-March/thread.html
I do think there is some case for non rentrency and nested loop where
what you define here would block an outer loop, but most people
suggesting what you ask actually wan
Hi Guido,
Excited about the possibilities of the new PEG parser !
Have there been any consideration to allow this new call syntax to
actually quote the expression given as parameter ? Or have a different
meaning than a normal call ?
In IPython/Jupyter we use the fact that this is not valid syntax
On Tue, 31 Mar 2020 at 10:18, Gerrit Holl wrote:
> the command ``cat $(find . -name '*.py') | grep -oi term | wc -l`` was used.
I'm quite concern in the lack of mention of proper forms and procedure
to perform experiment with domestic felines.
--
Mathias
>
>
> In general Python error messages don't include the relevant values or much
> information about them, although I often wish they would. For example when I
> get a KeyError I wish I could see which keys are present, unless there's too
> many for it to be practical. I'm speculating, but I thi
> I'm torn -- on the one hand, these very old modules may as well stay frozen
in time (please double check that they aren't listed in PEP 594)
And
> I expect that will be quite common — older code commonly uses lower case
class names
Thank, checking 594 is a good idea; I understand why you are
Thanks for pointing those out.
At least when the alias is `error = OtherName` the text is the stack trace are
informative.
--
M
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
ht
I've been tripped up a couple of time by a few Exception names being lower case
both in code and tracebacks. In particular `error` (all lower case)
I tend to read `error` as a function instead of a class.
According to my non-scientific grep-foo, I find that ~ 300 descendant from
Exceptions st
Hi all,
I want to point out that if it's not common to dispatch on values of
exceptions it might be **because** it is hard to do or to know wether
an exception will be structured or not. If Exceptions were by default
more structured, if CPython would provide a default
"StructuredException", or we
> (Btw IPython just supports normal TeX notations like \pi, \lambda etc, so it
> is very easy to remember)
IPython dev here. I am the one who implemented (most of) that. We do
support it, but it's not easy to
remember unless you know how to write latex, and know said character.
Question, how wou
if bk:
break
vs
for i in outer:
bk = False
for j in inner:
if cond:
bk = True
break # this.
if bk:
break
Sorry if I'm mis expressing myself.
--
M
On Fri, Mar 3, 2017 at 10:52 AM, Chris Angelico wrote:
> On Sat, Mar 4, 2017 at 5:5
Hi Brice,
On Fri, Mar 3, 2017 at 10:00 AM, Brice PARENT wrote:
> Thanks Matthias for taking the time to give your opinion about it.
>
> Just to set the focus where I may have failed to point it:
> the main purpose of this proposal is the creation of the object itself, an
> object representing the
Hi Brice,
On Fri, Mar 3, 2017 at 1:14 AM, Brice PARENT wrote:
>
> A word about compatibility and understandability before:
> "as" is already a keyword, so it is already reserved and easy to parse. It
> couldn't be taken for its other uses (context managers, import statements
> and
> exceptions)
On Thu, Mar 2, 2017 at 9:13 PM, Mike Miller wrote:
>
> It is a built-in singleton so rarely known that you will almost never
> encounter code with it, so you'll have it all to yourself. Even on a python
> mailing list, in a thread about sentinels/singletons, it will not be
> mentioned. Some may
> I just noticed a module on PyPI to implement this behaviour on Python
> functions:
> https://pypi.python.org/pypi/positional
This library seem to do the opposite of what you ask and force kwarg only.
In [11]: @positional.positional(1)
...: def foo(a=1,b=2):
...: print(a,b)
.
I think that was started as pep 457:
https://www.python.org/dev/peps/pep-0457/ (Syntax For Positional-Only
Parameters)
Still informal.
+1, it's likely possible to backport it to previous version using a
decorator and faking __signature__.
--
M
On Tue, Feb 28, 2017 at 2:03 PM, Yury Selivanov
On Thu, Jan 26, 2017 at 7:20 PM, Nathaniel Smith wrote:
> I also don't know why your numbers are so much larger than mine...
That's because copy/pasting from the html table prepend the row number
to the download count.
>> Also % seem swapped depending on python2 vs Python3, and quite different.
On Thu, Jan 26, 2017 at 5:23 PM, Nathaniel Smith wrote:
> It's also relatively common to need a 64-bit Python, e.g. if running
> programs that need more than 4 GiB of address space. (Data analysts
> run into this fairly often.)
>
> I don't know enough about Windows to have an informed opinion abo
On Mon, Jan 9, 2017 at 2:50 PM, Simon Lovell wrote:
> Hmm, Thanks Chris. I thought I was posting this to the correct place.
>
> I've never seen that "for line in open ..." after googling it many times!
> Why is this question so often asked then?
>
The distinction and the explanation of this is th
On Fri, Dec 30, 2016 at 5:24 PM, Nick Coghlan wrote:
>
> I understood the "iterhash" suggestion to be akin to itertools.accumulate:
>
> >>> for value, tally in enumerate(accumulate(range(10))): print(value, ...
It reminds me of hmac[1]/hashlib[2], with the API : h.update(...)
before a .diges
There are a couple of project that tried to improved heuristic on some
error messages.
Two I can think off are:
https://github.com/SylvainDe/DidYouMean-Python
and
https://github.com/dutc/didyoumean
I think that better error messages could be implemented only in the
repl, and/or by alternati
On Wed, Nov 16, 2016 at 6:50 PM, Stephen J. Turnbull
wrote:
> Replying to Paul Moore when
> deprecating "sarcastic" replies is just bad manners; Paul is never
> intentionally sarcastic that I can remember.
Apologies, if my message looked like targetting Paul, and was a reply
to Paul. Paul answe
Hi all,
Please be mindful when replying, even if some of the lurker know who
some of you are and can figure out that some of the reply to this
thread below this message are sarcastic, not all readers can. Your
messages can also be cited out of context.
Thus many messages in this thread can be misi
On Sun, Nov 6, 2016 at 5:32 PM, Nathaniel Smith wrote:
>
> If we're considering options along these lines, then I think the local
> optimum is actually a "quoted-call" operator, rather than a quote
> operator. So something like (borrowing Rust's "!"):
>
> eval_else!(foo.bar, some_func())
>
>
Hi all,
For those of you not aware, the Julia Programming Language [1] does
make extensive use of (mathematical) unicode symbols in its standard
library, even document a method of input [2] (hint tab completion).
They go even further by recognizing some characters (like \oplus) that
parse as opera
35 matches
Mail list logo