I really appreciate the pointers, thank you. I will look into them.
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org
Makes sense, will do so.
___
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
supporting YAML, I would think it time for Python to formally adopt this
technology in the core foundation.
Is there still a reason why this isn't being pursued as native infrastructure
in Python?
___
Python-ideas mailing list -- python-
when calling `__iter__` on an exhausted
generator?
_______
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
empty list.
BoppreH
On Mon, Jun 12, 2023, at 10:11 PM, Barry wrote:
>
>
> > On 12 Jun 2023, at 16:55, BoppreH via Python-ideas
> > wrote:
> >
> > Then the empty list creates hard-to-track bugs. I'm familiar with the
> > iterator protocol and why the
via Python-ideas wrote:
> > Also the OP's request was for generators, not for any iterator.
>
> IMO it would be a bad idea to make generators behave differently
> from other iterators in this regard. And it's far too late to
> redefine the iterator protocol in general, becaus
would already be helpful, like
Go's race condition detector.
--
BoppreH_______
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
http
ed numbers.
> 2. If I wanted unmodified list and if it was modified then it is an error,
> your solution doesn’t work either.
> 3. If sorting is ok only on non-empty iterator, then just `assert sorted`
> after sorting.
>
> If you could give a full real-life scenario, then i
Sorry, I'm new to the list and was not aware the burden of proof was so high.
Can you point me to one or two successful posts in Python-ideas where I can
learn how to show there's a real need for a feature?
On Tue, Jun 13, 2023, at 11:25 PM, Chris Angelico wrote:
> On Wed, 14 Jun
____
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/[email protected]/message/KAF
nd invoked once.
-- Original Message --
From: "Rob Cliffe via Python-ideas"
To: "Dom Grigonis" ; "Jothir Adithyan"
Cc: [email protected]
Sent: Monday, 17 Jul, 23 At 16:09
Subject: [Python-ideas] Re: Proposal for get_or function in Python
dictionari
/datamodel.html#descriptors
--
Regards,
=dn
_______
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://
to make use of
them in our application code...
(YMMV!)
--
Regards,
=dn
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
On 19/10/2023 20.43, Dom Grigonis wrote:
On 19 Oct 2023, at 10:27, dn via Python-ideas wrote:
On 19/10/2023 19.50, Dom Grigonis wrote:
Thank you,
Good information, thank you. Was not aware of __set_name__.
IIRC that was one of the updates/improvements. Thanks to whomsoever...!
The
o the user_name variable will only have the name 'person_name',
but not user_name, as the field objects need to know their names on the
model (and their names on the views/forms).
-- Original Message --
From: "Rene Nejsum"
To: [email protected]
Sent: Saturday,
dress this
issue?
___
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
> From: Paul Bryan via Python-ideas
> Sent: Thursday, December 31, 2020 12:06 PM
> To: [email protected]
> Subject: [EXTERNAL] [Python-ideas] PEP 533 Redux?
> I've now encountered an issue I believe that PEP 533 was intended to
> address:
>
> When
structures, which
> > is likewise dependent on special help from the particular built-in type.
> > Can something be founded on |||__getstate__| ?
>
> I don't think so. All the logic for dealing with cycles is buried
> inside pickle -- __getstate__ just gets info about on
guage designers is about this.
IMHO it is highly unlikely that any proposal about adding braces to
Python would be accepted.
Ronald
—
Twitter / micro.blog: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/
___
Python-ideas mailing list -- [email protected]
To
uot;acceptance", and accepted it themselves.
>>>
>>> The problem? There's high duplication of effort in that area, and
>>> the same implementation bugs are repeated again and again. So the
>>> question is whether someone who did it, tried to spec out what
re would be no backwards incompatibility.
>
> If we want to get really crazy we can also allow an "open for" loop
> and kick off a very long deprecation process where eventually an
> unadorned for loop would become "closed" by default.
>
> Thanks,
> B
dataclass
decorator parameter like "init_kwonly" (default=False to provide
backward compatibility) that if True would implement this behavior.
Thoughts?
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-id
The main benefits of this proposal:
- the order of fields (those with defaults, those without) is
irrelevant
- don't need to pedantically add default = None for Optional values
On Sun, 2021-01-24 at 19:46 +, Paul Bryan via Python-ideas wrote:
> I've created a helper class in m
Eric
> On 1/24/2021 3:07 PM, Paul Bryan via Python-ideas wrote:
>
> The main benefits of this proposal:
>
> - the order of fields (those with defaults, those without) is
> irrelevant
> - don't need to pedantically add default = None for Optional values
>
&
#we do not do a 'return' here, so that area.ResumeTimer() will
be called at the end of this function.
# For keys that cause user interaction (e.g. popping up a form),
#we 'return' here, so that the timer will not be restarted yet.
_______
re treated similarly*. This is just an
amorphous mass of code that I find much harder to grok. (YMMV but I find
it hard to imagine.)
Rules are all very well, but "A Foolish Consistency is the Hobgoblin of
Little Minds" [PEP 8]
Best wishes
Rob
PS Can anyone shed any light on why Alt-R d
d.
PS Can anyone shed any light on why Alt-R doesn't always "work" on
Windows 10? I believe there's some bit of installed software that
has hijacked it, but I'm not sure what.
I'm hopeless there
-Chris B
--
Christopher Barker, PhD (Chris)
Python Language Consulting
I'd like '->' much better than '=>'.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Me
mind Python loosening slightly to use the keyword it probably should
have in the beginning.
-Mike
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/py
ching
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.pytho
None of the other names IMO convey the
intended/suggested use nearly as well.
Rob Cliffe
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pyth
rt allowing 'def' as an alternative to 'lambda'
(allowing 'def' to ultimately become the recommended usage).
(I'm -0.5 on adding an alternative arrow syntax, but that's a purely
subjective opinion.)
Rob Cliffe
_
On 24/02/2021 14:04, Random832 wrote:
On Tue, Feb 23, 2021, at 17:01, Rob Cliffe via Python-ideas wrote:
As far as I know, there is no case of valid syntax using 'lambda' where
replacing 'lambda' by 'def' results in valid syntax.
Can anyone provide a counter-ex
ot;)
.split(":")[0]
.lower()
i.e., not requiring an explicit line continuation character in the case where
the next line starts with a period.
I've had a search through the archives and I couldn't see this discussion
before. Feel free to point me to it if I
away with the C portions).
An emphatic +1.
Rob Cliffe
What would be the benefits of locking down modules in this way?
--
~Ethan~
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
for a in f1():
for b in f2():
yield (a, b)
```
Would others find this useful? Are there any drawbacks I'm missing?
Best,
Alastair
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-id
ke a reasonable request (as someone that’s not the ipaddr
maintainer and doesn’t really use IPv6). Could you file an issue about this?
Ronald
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-ideas-le...
d be less helpful.
Rob Cliffe
There are situations (e.g. monkey patch) where this is not obvious. Would be
great detail to include that in the traceback, I think.
Best
Pol
_______
Python-ideas mailing list -- [email protected]
To unsubscribe se
x27;{x} is {x!lc} in lowercase'
just by registering 'lc' as a conversion from my code. Chaining then per
Serhiy's other suggestion would bring a fair amount of power.
Cheers,
Cameron Simpson
_______
Python-ideas mailing list -- python-idea
wanted to use a stronger expression) is an SaaS? I'd never heard of it.
OK, Google told we what it stood for, but I don't feel any the wiser.
Rob Cliffe
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to pyt
rest is
simple literals.
For readability, reuse and testing I think it often helps to have
a function (whose name is meaningful). We can get this via
as_list_int_literal = gensep(',', '[', ']')
It would also be nice to allow as_list_int
On 02/05/2021 20:07, Abdur-Rahmaan Janhangeer wrote:
Oh seems like you are a dinosaur needing some carbon
dating.
Thanks for the insult.
Rob Cliffe
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python
ully understand the proposal and how it would be
implemented, but IMO adding an overhead (not to mention more complicated
semantics) to *every* chained attribute lookup is enough to kill the
proposal, given that it seems to have relatively slight benefits.
Best wishes
Rob Cliffe
__
" means, either to the interpreter or to
another programmer? Every objection has been based on the confusion of
"except TypeError, ValueError as e:", and I agree with that.
+0.9. A practical solution, although it makes the language definition
more complicated. Practicality beatin
F(1,2) ?
Rob Cliffe
_______
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/[email protected]/message/46U4V4PPFBDL
try:
>element = some_list[index]/divisor
>except ZeroDivisionError:
>element = 0 # It will make element zero if divisor is zero,
> but it will not except IndexError in case index is out of range for
> some_list
> *Can be rewritten as:*
>e
On Sunday, May 23, 2021, 02:23:05 PM GMT+1, Shivam Saini
wrote:
>> Like the first example in which I am sending an log, which isn't important.
If the log is not important, then why are you sending it?
_______
Python-ideas m
high.
But then on the other hand, who would ever want to change the value of
pi?
Surely you recall the Indiana Pi Bill?
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
s.python.org/3/library/sys.html#sys.__stdin__
_______________
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/
__`` method can be used as
well and can hide state (with the “consulting adults” caveat, the state is
hidden, not inaccessible).
Ronald
—
Twitter / micro.blog: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/
___________
Python-ideas mailing list -- p
like A, B, ID, BA (as in "Bachelor of Arts"), UN, US,
HCF, WHO, NASA, UNICEF?
Rob Cliffe
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/li
ck by caching values in the VM.
Ronald
—
Twitter / micro.blog: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/m
> On 27 May 2021, at 11:42, Chris Angelico wrote:
>
> On Thu, May 27, 2021 at 7:20 PM Ronald Oussoren via Python-ideas
> wrote:
>> On 27 May 2021, at 09:56, Shreyan Avigyan wrote:
>>
>>> Static should behave much like Python's for loop variable
ne will consider adding it to the language.
Ronald
—
Twitter / micro.blog: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-ideas-le...@pyth
> On 27 May 2021, at 18:15, Steven D'Aprano wrote:
>
> On Thu, May 27, 2021 at 04:53:17PM +0200, Ronald Oussoren via Python-ideas
> wrote:
>
>> Statics are still hidden global state
>
> How are they *global* state when they are specific to an individual
>
will be
better received by more if the type hint is required?).
Please, please, please, don't ever make type hints *required*! Some of
us are perfectly happy not using them (and not having to learn them)!
Rob Cliffe
_______
Python-ideas mailing list
ame, thus reproducing what
we see when using the C code in this example.For library writers, this would be
easily reverted when attempting to debug.For end users, this would result in
much more readable tracebacks, unencumbered by extra lines of code that are
outside of their control.
André Rob
;
spam # No problem
Rob Cliffe
But this is introducing a new multiline
syntax, and it makes no more sense to take away the
second line and expect a naked decorator to be valid
than it does remove the decorator and expect the
naked identifier to be valid.
______
ré Roberge
wrote:
What I am interested in is having a project-agnostic standardised Python way to
specify what to show to an end-user when an exception is raised.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email
;#id13>
TODO
Open Issues <#id14>
TODO
References <#id15>
[1] <#id1> FrOW, "HTML Fragments Over the Wire". Frameworks like
Unpoly, Hotwire or htmx.
[2] <#id3>
https://docs.djangoproject.com/en/3.2/ref/utils/#django.utils.html.conditional_escape
<https://d
nti-pattern and how
to correct it.
So I propose moving (eventually) to the same system with lists as for
strings. Or else removing the performance trip-hazard from the sum
function with lists.
Best regards,
Oliver
_______
Python-ideas mailing lis
On 18/06/2021 16:42, Mathew Elman wrote:
I don't see how allowing
[x, y for x in a]
follows from allowing
[*chunk for chunk in list_of_lists].
Nor do I.
Rob Cliffe
___
Python-ideas mailing list -- [email protected]
To unsubscribe se
ke this in
Python? In JavaScript the equivalent syntax ("...chunk", where the
"..." are a literal ellipsis) is called "spread". We could borrow this
term.
I'm not convinced.
1, 2 + x
does not mean the same as
chunk + x
but it would be if there were p
s that I know of that have extension methods the most given
argument is better code readability.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailm
n that
prompts for continuation after each screenful of output. Very handy!
Power is good, as long as it's used with discretion.
Rob Cliffe
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-ideas-le
rd by reusing one that can't go
there, like except?
for i in range(0,10) except (2, 8):
don't know if it is actually worth it, but at least it doesn't add a new
keyword.
_______
Python-ideas mailing list -- [email protected]
To
On 02/07/2021 08:12, Thomas Güttler wrote:
Hi Nick and all other Python ideas friends,
yes, you are right. There is not much difference between PEP-501 or my
proposal.
One argument why I would like to prefer backticks:
Some IDEs detect that you want to use a f-string automatically:
You
nslating
[2]: https://github.com/python/python-docs-bn-in
[3]: https://github.com/JulienPalard/python-docs-cookiecutter
[4]: https://devguide.python.org/documenting/#starting-a-new-translation
--
[Julien Palard](https://mdk.fr)
_______
Python-ideas mailing list -- pyth
ion of that). For
> instance:
>
> domain.findsuffix((".fr", ".com", ".org"))
>
> ChrisA
> _______
> Python-ideas mailing list -- [email protected]
> To unsubscribe send an email to python-ideas-le.
't understand why my comment
> about "can be used eg for indexing" was being quoted for context
> there. I was talking about how you could do something like this:
>
> protocol = ("ws:", "wss:")[url.startswith("https:")]
>
> If the return value changes, this breaks.
r of aliases. The API is more cumbersome to use, and you
loose type checking from the C compiler.
Other than that, the variants you mention could in general just by aliases for
conversion functions to/from the basic C types.
Ronald
—
Twitter / micro.blog: @ronaldoussoren
Blog: https:/
G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
_______
Python-ideas mailing list -- [email protected]
To unsu
g/en-US/docs/Mozilla/QA/Bug_writing_guidelines>
>
>
> Is there a reason why we can't just link to the Wayback Machine
copy like
> you did here?
>
> >
> >
___
Python-ideas mailing li
mpty() method is implemented there,
all typical use cases should be covered.
I'm looking forward to your feedback!
Tim
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
ht
u have to
change a check `if values` to `if len(values) == 0`. That works for both but is
against the PEP8 recommendation. This is a shortcoming of the language.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to
y. However, Python makes a strong point on readability, which IMHO is
one of the major reasons for its success. I belive that in that context adding
is_empty syntactic sugar would be a clear improvement.
_______
Python-ideas mailing list -- python-ideas@pyt
empty()" method. However,
defining a method downstream breaks duck typing and maybe even more important
authors have to mentally switch between the two empty-check variants `if users`
and `if users.is_empty()` depending on the context.
Ethan Furman wrote:
> On 8/23/21 1:15 PM, Tim
Ethan Furman wrote:
> On 8/23/21 2:31 PM, Tim Hoffmann via Python-ideas wrote:
> > Ethan Furman wrote:
> > > It seems to me that the appropriate fix is for numpy to have an
> > > "is_empty()" function
> > that knows how to deal with arrays and array-like
, even if it did exist.
As written in another post here, `len(container) == 0` is on a lower
abstraction level than `isempty(container)`.
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-ideas-le...@py
hird party libs to adopt that convention as well.
That would give a uniform syntax by convention.
Reflecting the discussion in this thread, I now favor variant 3).
Tim
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email
Ethan Furman wrote:
> On 8/24/21 3:03 PM, Tim Hoffmann via Python-ideas wrote:
> > **How do you check if a container is empty?**
> > IMHO the answer should not depend on the container.
> I think this is the fly in the ointment -- just about everything, from len()
> to bo
ere are
any.
If we come to the conclusion that an explicit empty check is better than a
length=0 check, there are again different ways how that could be implmented
again. My favorite solution now would be adding `is_empty()` methods to all
standard containers and encourage numpy and pandas to add
arrays and
dataframes.
_______
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-id
ant enough here to take
further action.
Anyway, thanks all for the discussion!
Tim
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/li
culties to implement.
_______
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/[email protected]/message/5KKHG6TLBLI4
And also IPython:
https://ipython.readthedocs.io/en/stable/interactive/shell.html
e.g.
ls_lines = !ls -l
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org
lly a cool feature, because pickle is to keep python object,
completeness is a great advantage of pickle than json and other data persist
library.
Sent with ProtonMail Secure Email.
_______
Python-ideas mailing list -- [email protected]
To unsubscri
On 26/08/2021 15:44, Christopher Barker wrote:
Python itself is purposely not designed to provide quick and easy
shell access.
Is that really true? What evidence do you have for that statement?
Best wishes
Rob Cliffe
___
Python-ideas mailing
m.
Why do you prefer strings for the options rather than an Enum? The enum
clearly documents what the valid options are for the option.
Ronald
—
Twitter / micro.blog: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/
_______
Python-ideas mailing lis
question was out of
interest in this particular remark.
Ronald
>
> -CHB
>
>
> --
> Christopher Barker, PhD (Chris)
>
> Python Language Consulting
> - Teaching
> - Scientific Software Development
> - Desktop GUI and Web Development
> - wxPython, numpy, s
Currently, in Python 3.9, `dbm.open()`, `dbm.gnu.open()` and `dbm.ndbm.open()`
doesn't support path-like object, class defined in `pathlib`.
It would be nice to add support with it.
Sent with ProtonMail Secure Email.
___
Python-ideas mailing
assertions.
Best wishes
Rob Cliffe
___
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
", "-filove-python", "CFLAGS=-O3"])
" ".join(opts)
'-filove-python CFLAGS=-O3'
What do you think guys about this? Perhaps it was proposed by someone else?
Thanks!
Stepan Dyatkovskiy
___
Python-ideas
te an implementation yourself.
What should be done about deque for block sizes > 1? If this change gets made,
should we add way to create a deque with block size == 1 whose iterators are
never invalidated?
_______
Python-ideas mailing list -- pyt
input, then it will return None
type. This would be a nice feature.
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Me
# can't use this feature
etc.
Best wishes
Rob Cliffe
_______
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
exception coming.
Best wishes
Rob Cliffe
_______
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
es
Rob Cliffe
_______
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@pytho
to a subsequent early-binding default, e.g.
def f(a := b+1, b = b_default):
I don't feel strongly about this. But L-to-R is nice and simple,
and I would reverse the parameter order here to make it work (and be
more comprehensible).
Best wishes
Rob Cliffe
_
On 26/10/2021 02:12, Chris Angelico wrote:
On Tue, Oct 26, 2021 at 11:44 AM Rob Cliffe via Python-ideas
wrote:
I prefer 1). Easier to understand and debug in examples with side-effects such
as
def f(a := enter_codes(), b = assign_targets(), c := unlock_missiles(), d
= FIRE()):
(not
101 - 200 of 1693 matches
Mail list logo