[Python-ideas] Re: List - append

2020-01-19 Thread Siddharth Prajosh
t; wrote: > >> On Sun, Jan 19, 2020 at 2:45 PM Siddharth Prajosh >> wrote: >> > >> > Moreover, shouldn't it work? >> > How do I add that feature in Python? >> >> How you can do it with warus operator. >> >> >>

[Python-ideas] Re: List - append

2020-01-19 Thread Siddharth Prajosh
On Sun, 19 Jan, 2020, 11:35 Inada Naoki, wrote: > On Sun, Jan 19, 2020 at 2:45 PM Siddharth Prajosh > wrote: > > > > Moreover, shouldn't it work? > > How do I add that feature in Python? > > How you can do it with warus operator. > > >>> (xs :=

[Python-ideas] List - append

2020-01-18 Thread Siddharth Prajosh
This is more of a doubt than a new idea. Python has always worked intuitively but this was a bummer. A list has an append method. So I can do list.append(value). I tried doing list(range(10)).append(10) and it returns None. I'd usually assume list(range(10)) returns a list, to which I can append w

[Python-ideas] Re: __eq__ and __ne__

2019-12-27 Thread Siddharth Prajosh
cy. Another is symmetry and completeness. > > Read the docs about the minimum a class must to do be: > >- hashable >- sortable > > > > On Fri, Dec 27, 2019 at 12:00 PM Siddharth Prajosh > wrote: > >> Why do we need separate functions for == and != ?

[Python-ideas] __eq__ and __ne__

2019-12-27 Thread Siddharth Prajosh
Why do we need separate functions for == and != ? Isn't this supposed to be negation of each other? ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/li

[Python-ideas] Re: Renaming json.load()

2019-12-25 Thread Siddharth Prajosh
I second that.. json.load/loads and json.dump/dumps should be more understandable.. On Thu, 26 Dec, 2019, 04:50 python-ideas--- via Python-ideas, < python-ideas@python.org> wrote: > Well, `json` and the other modules could add another standard: `serialize` > and `deserialize` > > As an example, t

[Python-ideas] Re: Segmentation of string

2019-12-25 Thread Siddharth Prajosh
Why not create a new custom class which has this function there? You can use that object whenever you need the segments. This is a very rare use case and doesn't make sense to implement that in str. On Wed, 25 Dec, 2019, 09:25 python-ideas--- via Python-ideas, < python-ideas@python.org> wrote: >

[Python-ideas] Re: Add "elif" to "for_stmt" and "while_stmt"

2019-12-15 Thread Siddharth Prajosh
I don't think this is really useful. For else in itself is a very odd thing to have. For-elif-else will make this even more complicated. But that's just my opinion. Cheers, Siddharth Prajosh On Sun, 15 Dec, 2019, 19:28 Anders Hovmöller, wrote: > In my opinion this doesn't ma

[Python-ideas] Python slicing

2019-12-12 Thread Siddharth Prajosh
Python slicing looks really weird. How do I explain *s=list(range(100)); s[10:20] *gives you a part of the list. Can we have an extra function for lists and string (and wherever slicing works) to explicitly mention that we're slicing?? Something like - *s=list(range(100)); s.slice(10, 20).* Has t

[Python-ideas] Re: Python including packages

2019-07-08 Thread Siddharth Prajosh
14 PM Cameron Simpson wrote: > On 08Jul2019 11:40, Siddharth Prajosh wrote: > >Hey all, after this talk > >< > http://pyfound.blogspot.com/2019/05/amber-brown-batteries-included-but.html > > > >on how useful standard libraries are this has been in talks in mul

[Python-ideas] Python including packages

2019-07-07 Thread Siddharth Prajosh
Hey all, after this talk on how useful standard libraries are this has been in talks in multiple channels. I just wanted to present my idea on the same. Why not keep the essentials (ensurepip) and strip off everything el