ut meaning type(lhs)(chain(…)) on some types, so
why do the equivalent with @?)
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archiv
y a waste of effort.
Because really, when you need N-way products, you almost always need either
iterators or numpy in the first place.
But if the OP has some good examples, maybe we can extrapolate from those
instead of guessing what might be useful if examples existed. :)
______
a specific) version in site-packages so they aren’t burdened by the release
cycle. Would that not be appropriate for the way packaging needs TOML?
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-ideas-le...@python.
choose
whether you want clarity:
def consume(it):
for _ in it: pass
… or performance:
def consume(it):
colllections.deque(it, maxlen=0)
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-ideas-le
al classes and methods but pointers to opaque Class and Selector
objects, and it feels more like you’re writing an ObjC interpreter than writing
ObjC code.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to
ust scrap the nice context managers and
use finally, or add two more layers of indentation, or, most commonly, just
punt on the problem and don’t handle errors correctly.
So, I think adding with to the idea makes it a lot more compelling.
_______
Python
s (still) by
far the fastest way to do it in CPython (short of a custom C function for
consume, and even that isn’t much faster), and not quite the fastest but close
enough in PyPy.
_______
Python-ideas mailing list -- [email protected]
To
maybe the bikeshedding potential
will be higher than expected, and a variety of different modules that all
handle the placeholders differently will compete, and it’ll turn out that
everyone loves some different design that allows both single-arg and multi-arg
placeholders
_____
are useful, you can file it on b.p.o. (ideally with a patch) and I’m
sure someone will take a look.
Meanwhile, there are going to be functions that take positional arguments,
whether for semantic reasons, for performance reasons, or for pure legacy
issues. As long as any of those cases exi
e realistic code in some realistic scenario, maybe by giving us some code
with functions whose bodies are like `#80 lines of complicated stuff to get the
value for spam` followed by `?spam`, and then a fake console dump or
interactive session log showing the program being started and displaying
se, not something like for…else that some experts use but
most people live without.
(But I don’t have a better syntax to offer. I actually like with…except, if it
were just for my use, but on reflection I can see why others find it confusing.
Just like for…else.)
____
worthwhile goal, and at present the only way to achieve
it is with somewhat verbose and clunky code.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.py
d of code really is a serious problem, then the proposal doesn’t
solve it; we need a proposal everyone will be able to learn and use. (And if
it’s not a serious problem, then the proposal isn’t needed in the first place.)
_______
Python-ideas mailing list -- py
nd-line utility a lot easier than using argparse. I think whenever you
want anything more than argv and don’t want argparse, you should probably just
use one of those libraries.
___________
Python-ideas mailing list -- [email protected]
To unsubscribe
On Jul 30, 2019, at 20:49, Andrew Barnert via Python-ideas
wrote:
>
> There are lots of great third-party libraries that make turning a function
> into a command-line utility a lot easier than using argparse. I think
> whenever you want anything more than argv and don’t want a
dirty scripts, but would be
disastrous for many other programs.)
So… never mind.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.p
sure than coding) it helps to have as much information as
possible at your fingertips. Oh, I know you can always work through a
trace (if one is available) to see exactly where an error occurred, but
that takes time.
_______
Python-ideas mailing
should
be implemented. I just don't want its merits to be overlooked.)
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Mess
p file to make it automatic), because I think
a sizable number of people would want that. (In fact, even if you can get it
accepted into Python, some people will want a backport that they can use with
3.7.
_______________
Python-ideas mailing list -- python-ide
the recipes
(and it’s kept up-to-date, so the occasional new recipes are available to
anyone who installs it, even with older versions of Python). So, just add that
to your requirements file, and you can import consume from more_itertools
instead of itertools._____
On Aug 1, 2019, at 09:27, Christopher Barker wrote:
>
>
>
>> On Thu, Aug 1, 2019 at 9:19 AM Andrew Barnert via Python-ideas
>> wrote:
>
>> > Given that in 3.x every stdlib module is supposed to be in Python with an
>> > optional C accelerator,
>
tall more-itertools and use that, and mention the recipes so
they can maybe read them later
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lis
to "bother".
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-idea
n Python 2.5 rather than 3.7. The actual people
being helped have never seemed reticent.)
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-idea
the best recommendations to consider making.
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/a
sales and isopen:`, but it would do the wrong
thing if `no` is special syntax that reverses the sense of the `if` rather than
a normal operator that binds more tightly than `and`.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe
On Aug 1, 2019, at 22:26, Brendan Barnwell wrote:
>
>> On 2019-08-01 12:31, Andrew Barnert via Python-ideas wrote:
>>> On Aug 1, 2019, at 10:48, Eli Berkowitz wrote:
>>> >
>>> >In terms of an argument for why it should be included, for most Python
>
.
Or you could port itertools to Python plus C accelerator and then just
copy-paste the recipes into the Python part. I suspect the latter would be
easier to get accepted, but I have no idea whether it’s more or less work.
_______
Python-ideas mailing list --
of the pitch for yield from that I
can’t remember.)
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
ht
e plus grouper plus some of
the less trivial recipes (or, more simply, just all of them, to avoid
bikeshedding arguments on each one) is.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
h
discussion, or whatever, but the easiest way
to find out (unless he joins this thread) is to just file the bug and add the
patch.
(By the way, why not just read PEP 399 instead of asking and then relying on
the interpretation of some random guy on the internet?)
_______
d to live without once you get used to
them. Also, most of them are curses or otherwise full-screen.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailm
removing all non-escape-sequence backslashes, so you can paste
something with backslash-escaped spaces from bash.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.py
tion.
Ronald
—
Twitter: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.py
the original un-parsed string.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/p
when the values
are unchanged.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python
;: Decimal('0.6441726684570313')}
dson:seri = {"val": 0.6441726684570312}
```
The possibility to specify the "raw" textual output, which does not get mangled
by the JSONEncoder when custom encoder is used seems to be missing.
˙``
_______
Without explicitly listing the args in order somewhere, how do you
solve that? And is there a way to list the named args of a function in order
that’s less boilerplate than (but just as understandable as) a def statement?
_______
Python-ideas mailing
gh that you can hope someone else
does), and you’ll probably get a difference response than you get by
defensively claiming that you’re not asking for what you’re asking for but then
repeating your need for it anyway.
_______
Python-ideas mailing list -
s you
add in encode only affect the top-level value, not values inside arrays or
objects.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-
erty would be an easy
problem. But I think with the way Python is today, it’s not.
Of course I’d be happy to be proven wrong on that. :)___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.
design what happens if someone
else does.
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
ht
complexity for the reader to deal with, so I think you’re still
better off not doing it.
(As a side note, you probably want a numerical stable average like the ones in
statistics or numpy, rather than one that accumulates float rounding errors
indiscriminately, but that’s another issue.)
___
attributes too?), that
would be a step forward. But adding the their half of str while breaking the
existing magic (and making named attributes harder rather than easier) doesn’t
seem like it is.
_______
Python-ideas mailing list -- python-ideas@pyth
he only JSON docs you ever receive
are just individual numbers, and they’re all between -0.1 and -0.2, so the only
possible error that can arise is this one. And so on. But I doubt any of those
is common.
___
Python-ideas mailing list -- python-ideas@p
thing to parse in the world, but why duplicate the parser (and potentially
create new bugs) if you already have one?
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.pyth
Decimal can’t solve for anyone; there’s no additional problem that Decimal
can’t solve here that’s only faced by your weird app.
> But an application
> that cared about that would be pretty weird. So I think a
> "use decimal" option would cover the vast majority of use
> c
eck, using the Decimal constructor is not a good
check. It’s similar to the spec, but not the same, and why validate that
someone’s output passes a similar specification instead of the one they’re
trying to use? Especially when we already have tested (and configurable) code
that exactly parses
needing json to import decimal I would have
said it was a great idea—but after this thread, I’m not so sure. It everyone
who wants it, or wants other people to have it, is wrong about what it would
do, that just screams attractive nuisance rather than useful feature.
______
g that
you asked what you asked, and then pretending to have a different problem in
hopes that different problem might be solved by the feature you asked for, so
maybe the feature will be added so you can misuse it for what you really wanted.
_______
Python-id
ts for the temporary rather than a whole int
object anyway.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://ma
nt libraries? Or a library you
don’t know? Or JSON edited by hand or by sed scripts that might not even be
consistent?
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://
ry should have allowed it…)
Also, because Python follows the obsolete RFC 7159 instead of 8259, there may
be other issues—I don’t think there are, but I wouldn’t want to guarantee that
without checking.
_______
Python-ideas mailing list -- python-ideas
s is exactly the reason C offers types like intptr_t.
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
h
at’s as readable as possible for a single line that meets
the standards of an entry in all of JSONlines, NDJ, and LDJSON. But at the time
nobody could have known about JSONlines, or that 7-bit-clean pretty-printed
JSON would never be useful, etc.
_____
On Aug 13, 2019, at 11:21, Chris Angelico wrote:
>
> On Wed, Aug 14, 2019 at 3:12 AM Andrew Barnert via Python-ideas
> wrote:
>>
>>> On Aug 13, 2019, at 01:04, Richard Musil wrote:
>>>
>>> Concerning the custom separators, and why the implementati
On Aug 13, 2019, at 15:01, Eric V. Smith wrote:
>
>> On 8/13/2019 5:49 PM, Andrew Barnert via Python-ideas wrote:
>> But I think the lazy-import-decimal-on-first-dump-with-use_decimal solves
>> that, and solves it even better than __json__, even besides the fact that
>
de local functions? Classes defined within the
function? Exec from within the function (does it depend whose locals are
passed)?
What about a callable that’s not a function or class? Does it just catch
exceptions raised inside the __call__ method itself?
And so on.
______
o generate invalid JSON if they want to" is not
> without precedent.
Sure, and as soon as you discover another special case that millions of
existing programs expect to be handled in a way that violates the RFC, that
somehow nobody has noticed in the last 16 years, file a bug to handle that wit
with you that we
probably don’t want to add that support in the first place. But, as you say, at
least some people disagree, so…)
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.pytho
e
It seems to me this idea will help library users more correctly handle their
exceptions if this is problematic. This will save time and make code more
reliable.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to
t be looked up anywhere. Avro is intentionally unversioned because it
will never change, according to version 1.8 of the spec. And so on. We’re in
great shape for the future. :)
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email
d start a separate thread.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/arch
expecting that one of the many JSON-based and
JSON-like formats is going to become an official successor to JSON and take
over its ubiquity. But that really isn’t likely (and you aren’t going to make
it any more likely by arguing for it on python-ideas, and even less so by
arguing for four of the
t.
So this is only even worth discussing if the “serialize arbitrary text” feature
is added.
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pyt
that accepts ast_list as a subclass. (The
lists_as_nodes flag becomes slightly more complicated, but still pretty
simple—and besides, that’s all under-the-covers code.)
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an emai
nything wrong with it
if people really want it.
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.or
et from choice?)_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/lis
the only thing anyone wants from it is something that doesn’t make
sense, then maybe we’re better off without it?
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.py
e the case that their coverage is sufficient,
or make some other argument that it’s guaranteed to be safe, or ignore str and
write a _decimal_str similar to the existing _float_str, or find a way to
validate it that isn’t too slow.
_______
Python-ideas mailing
dd that PEP and ...
> honnestly not very used to github.
>
> In short, can you help me and advise on this?
>
> Thanks a lot and best regards,
> Michaël Hooreman
>
>
> _______
> Python-ideas mailing list -- [email protected]
d advise on this?
>
> Thanks a lot and best regards,
> Michaël Hooreman
>
>
> _______
> Python-ideas mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org
On Aug 23, 2019, at 09:45, Christopher Barker wrote:
>
> Andrew, thanks for the background.
>
>> On Fri, Aug 23, 2019 at 8:25 AM Andrew Barnert via Python-ideas
>> wrote:
>
>> Also, IIRC, it doesn’t do any post-check; it assumes calling str on any
>> De
rypoint script here.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas
thon than some
>> packages to deploy with setuptools.
Yes, but many of those use cases actually _can_ still benefit from setuptools,
so it’s worth knowing what it can do rather than assuming it’s useless to
anyone who isn’t deploying public monolithic releases to PyPI, much less
getting angr
w _not_ to do that.” Especially since “Here’s how to do that” often
illustrates what a huge pain it is to do that, which convinces people better
than just saying “Don’t do that.” :) But in this case, you already had a
solution to offer, so it’s not really the same thing.
___
n the future that it can
require Python 3.9. And at that point, it’s probably easier to get it into
simplejson (or, if that’s not possible, to fork simplejson), get some
experience with the feature in the wild, and only then propose it for stdlib
inclusion.
This is something most people don’t
rd to teach and learn, and
confusing to read even after you’d learned it. And returning a namedtuple (or
taking a SimpleNamespace to fill, or just making it a mutating method of an
object…) does seem like a much better way to solve the UX problem, as you said._______
valid today?
(And maybe you could even something similar on the def side, although fitting
the “return params” in with the type of the normal return might be tricky.)
On the plus side, this is ugly enough that hopefully nobody will ever ask for
it. :)
______
other literals can work, but things like version can interact nicely with
plain string literals, and r, and b if that’s appropriate, and most of all f,
by just accepting a cooked string.
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email
n,
but off the top of my head:
* Decimal, Fraction, np.float32, mpz, …
* Path objects
* Windows native Path objects, possibly with “really raw” processing to allow
trailing backslashes
* regex, possibly with flags, possibly with “really raw” backslashes
* “Really raw” strings in general.
* J
On Aug 26, 2019, at 23:43, Serhiy Storchaka wrote:
>
> 27.08.19 06:38, Andrew Barnert via Python-ideas пише:
>> * JSON (register the stdlib or simplejson or ujson),
>
> What if the JSON suffix for?
I think you’d mainly want it in combination with percent-, html-, or
uu-equa
look more carefully at the C++ rules for that?)
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
htt
On Aug 27, 2019, at 08:52, Steven D'Aprano wrote:
>
>> On Tue, Aug 27, 2019 at 05:24:19AM -0700, Andrew Barnert via Python-ideas
>> wrote:
>>
>> There is a possibility in between the two extremes of “useless” and
>> “complete monster”: the prefix accept
ut I’d still do it at the REPL, and likely in
real code as well. But I don’t think that choice would make my code worse
(because when setup costs matter, I _wouldn’t_ make that choice), so I don’t
see that as a problem.
_______
Python-ideas mailing list -- pyt
a method?
What happens if utcoffset raises NotImplementedError? (Or anything else, I
suppose, but NotImplementedError is the documented behavior for the base class.)
Should date get an attribute that’s always False, or is it sufficiently obvious
to most people that dates are always nai
On Tuesday, August 27, 2019, 11:42:23 AM PDT, Serhiy Storchaka
wrote:
> 27.08.19 20:07, Andrew Barnert via Python-ideas пише:
>> Before I get into this, let me ask you a question. What does the j suffix
>> give us? You can write complex numbers without it just fine:
>>
On Tuesday, August 27, 2019, 11:12:51 AM PDT, Chris Angelico
wrote:
>On Wed, Aug 28, 2019 at 3:10 AM Andrew Barnert via Python-ideas
> wrote:
>> Before I get into this, let me ask you a question. What does the j suffix
>> give us? You can write complex numbers wi
eadability.
Look at the plethora of suffixes C has for number and character literals. Look
at how many things people still can’t do with them that they want to.
Look at the way user literals work in C++. While technically you can argue that
they are “syntax customization”, in practice the customiz
ster call or whatever per project. My program that takes 80 seconds to
run starts up 2us faster because a few dozen (or at most hundred) constructed
constants can be stored in the .pyc file. I don’t have to watch my speech to
carefully avoid using the word “literal” imprecisely. None of those are worth
anywhere n
This is
compiled into code that looks up the suffix in a central registry and calls it
with the token’s text. That’s all there is to it.
Compare that adding Decimal (and Fraction, as you said last time) literals when
the types aren’t even builtin. That’s more complexity, for less benefit. So why
is it better?
___
far, even Steven’s facetious quaternion example that he proposed as too
ridiculous for anyone to actually want.
Is it a flaw that there may or may not be some examples that nobody has been
able to think of that might work with a much more complicated feature but won’t
work with this fea
that they’d
all be unfamiliar cryptic one-letter things, is likely to arise.
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-id
On Aug 28, 2019, at 01:05, Paul Moore wrote:
>
> On Wed, 28 Aug 2019 at 05:04, Andrew Barnert via Python-ideas
> wrote:
>> What matters here is not whether things like the OP’s czt'abc' or my 1.23f
>> or 1.23d are literals to the compiler, but whether the
ple,
it’s probably still worth looking at whether it’s feasible.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message ar
as a special restricted
calling syntax, unless you want to actively impede your understanding of the
code.
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/ma
say, do blocks?).
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@pyt
o if you want to re-suggest one of them, you probably want to find the
original rejection and explain why it no longer applies._______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mai
r types? Because even years of Python experience hasn’t cured us
of premature-optimization-itis.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/py
ibility by adding
new operator methods to the type type.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archi
401 - 500 of 1693 matches
Mail list logo