Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Peter J. Holzer
On 2023-03-03 13:51:11 -0500, avi.e.gr...@gmail.com wrote: > I do not buy into any concept about something being pythonic or not. > > Python has grown too vast and innovated quite a bit, but also borrowed from > others and vice versa. > > There generally is no universally pythonic way nor

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Greg Ewing via Python-list
On 4/03/23 7:51 am, avi.e.gr...@gmail.com wrote: I leave you with the question of the day. Was Voldemort pythonic? Well, he was fluent in Parseltongue, which is not a good sign. I hope not, otherwise we'll have to rename Python to "The Language That Shall Not Be Named" and watch out for

Re: Python list insert iterators

2023-03-03 Thread Alan Bawden
Guenther Sohler writes: Hi Python community, I have a got an example list like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 T T and i eventually want to insert items in the given locations (A shall go between 2 and 3, B shall go between 6 and 7) Right now i just use

Re: Python list insert iterators

2023-03-03 Thread dn via Python-list
On 03/03/2023 21.22, Guenther Sohler wrote: Hi Python community, I have a got an example list like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 T T and i eventually want to insert items in the given locations (A shall go between 2 and 3, B shall go between 6 and 7) Right now i

[Python-announce] pytest 7.2.2

2023-03-03 Thread Bruno Oliveira
pytest 7.2.2 has just been released to PyPI. This is a bug-fix release, being a drop-in replacement. To upgrade:: pip install --upgrade pytest The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. Thanks to all of the contributors to this release: * Bruno

RE: Python list insert iterators

2023-03-03 Thread avi.e.gross
Thomas is correct that this is a bit of an odd request unless explained better. There are a number of implicit assumptions that need to be revisited here. Python Lists are what they are. They are not in any way tagged. They are not linked lists or binary trees or dictionaries or whatever you are

RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread avi.e.gross
Alan, I do not buy into any concept about something being pythonic or not. Python has grown too vast and innovated quite a bit, but also borrowed from others and vice versa. There generally is no universally pythonic way nor should there be. Is there a C way and then a C++ way and an R way

Re: Python list insert iterators

2023-03-03 Thread Thomas Passin
On 3/3/2023 3:22 AM, Guenther Sohler wrote: Hi Python community, I have a got an example list like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 T T and i eventually want to insert items in the given locations (A shall go between 2 and 3, B shall go between 6 and 7) Right now i

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Ethan Furman
On 3/3/23 03:32, Chris Angelico wrote: > On Fri, 3 Mar 2023 at 20:44, Alan Gauld wrote: >> On 02/03/2023 20:54, Ian Pilcher wrote: >>> Seems like an FAQ, and I've found a few things on StackOverflow that >>> discuss the technical differences in edge cases, but I haven't found >>> anything that

Python list insert iterators

2023-03-03 Thread Guenther Sohler
Hi Python community, I have a got an example list like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 T T and i eventually want to insert items in the given locations (A shall go between 2 and 3, B shall go between 6 and 7) Right now i just use index numbers to define the place: A

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Chris Angelico
On Fri, 3 Mar 2023 at 20:44, Alan Gauld wrote: > > On 02/03/2023 20:54, Ian Pilcher wrote: > > Seems like an FAQ, and I've found a few things on StackOverflow that > > discuss the technical differences in edge cases, but I haven't found > > anything that talks about which form is considered to be

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Alan Gauld
On 02/03/2023 20:54, Ian Pilcher wrote: > Seems like an FAQ, and I've found a few things on StackOverflow that > discuss the technical differences in edge cases, but I haven't found > anything that talks about which form is considered to be more Pythonic > in those situations where there's no