Python lists are arrays in other languages. You’ll have to roll your own or
find something in https://pypi.org, etc. I think this incomplete implementation
does the trick.
#
# MIT licensed
#
from dataclasses import dataclass
from typing import TypeVar, Generic
T = TypeVar("T")
@dataclass
clas
Hi guys,
I have a strange problem that I do not understand. I am testing function
which returns a dictionary. The code should ensure that the keys of the
dictionary are generated in a given order.
I am testing the function with the standard unittest module and use the
assertListEqual statement t
Gabor Urban schreef op 4/03/2023 om 17:38:
Hi guys,
I have a strange problem that I do not understand. I am testing function
which returns a dictionary. The code should ensure that the keys of the
dictionary are generated in a given order.
I am testing the function with the standard unittest
Peter,
Of course each language has commonly used idioms as C with pointer
arithmetic and code like *p++=*q++ but my point is that although I live near
a seaway and from where C originated, I am not aware of words like "c-way"
or "scenic" as compared to the way people keep saying "pythonic".
Yes,
On 3/4/2023 11:38 AM, Gabor Urban wrote:
Hi guys,
I have a strange problem that I do not understand. I am testing function
which returns a dictionary. The code should ensure that the keys of the
dictionary are generated in a given order.
I am testing the function with the standard unittest mo
On 3/4/2023 2:47 AM, Peter J. Holzer wrote:
Even before Python existed there was the adage "a real programmer
can write FORTRAN in any language", indicating that idiomatic usage of a
language is not governed by syntax and library alone, but there is a
cultural element: People writing code in a sp
On 04/03/2023 20.47, Peter J. Holzer wrote:
On 2023-03-03 13:51:11 -0500, avi.e.gr...@gmail.com wrote:
...
No. Even before Python existed there was the adage "a real programmer
can write FORTRAN in any language", indicating that idiomatic usage of a
language is not governed by syntax and libra
On 04/03/2023 17:38, avi.e.gr...@gmail.com wrote:
>
> Of course each language has commonly used idioms
>
That's the point, the correct term is probably "idiomatic"
rather than "pythonic" but it is a defacto standard that
idiomatic Python has become known as Pythonic. I don't
think that's a prob
Thomas Passin schreef op 4/03/2023 om 18:49:
On 3/4/2023 11:38 AM, Gabor Urban wrote:
> Hi guys,
>
> I have a strange problem that I do not understand. I am testing function
> which returns a dictionary. The code should ensure that the keys of the
> dictionary are generated in a given order.
On Sun, 5 Mar 2023 at 05:44, Roel Schroeven wrote:
>
> Thomas Passin schreef op 4/03/2023 om 18:49:
> > On 3/4/2023 11:38 AM, Gabor Urban wrote:
> > > Hi guys,
> > >
> > > I have a strange problem that I do not understand. I am testing function
> > > which returns a dictionary. The code should e
On 3/4/2023 1:42 PM, Roel Schroeven wrote:
Thomas Passin schreef op 4/03/2023 om 18:49:
On 3/4/2023 11:38 AM, Gabor Urban wrote:
> Hi guys,
> > I have a strange problem that I do not understand. I am testing
function
> which returns a dictionary. The code should ensure that the keys of the
>
On 2023-03-04 12:38:22 -0500, avi.e.gr...@gmail.com wrote:
> Of course each language has commonly used idioms as C with pointer
> arithmetic and code like *p++=*q++ but my point is that although I live near
> a seaway and from where C originated, I am not aware of words like "c-way"
> or "scenic"
I don't know, Thomas. For some simple programs, there is some evolutionary
benefit by starting with what you know and gradually growing from there. He
first time you need to do something that seems to need a loop in python,
there are loops to choose from.
But as noted in a recent discussion, thin
Great idea, DN!
A whole series of books can be written such as:
- Python for virgin dummies who never programmed before.
- Python for former BASIC programmers
- Python for former LISP programmers with a forked tongue
- Python for former Ada Programmers
- Python for ...
- Python for those who find
Alan,
I got divorced from the C++ crowd decades ago when I left Bell Labs. You are
making me glad I did!
I do accept your suggestion that you can be idiomatic if you follow the common
methods of whatever language you use. That will take you quite far as long as
you are not a total slave to it.
On 3/4/2023 4:18 PM, avi.e.gr...@gmail.com wrote:
I don't know, Thomas. For some simple programs, there is some evolutionary
benefit by starting with what you know and gradually growing from there. He
first time you need to do something that seems to need a loop in python,
there are loops to choo
Nope. No consensus.
I’d use self.__class__ . Seems more explicit and direct to me.
From: Python-list on
behalf of Ian Pilcher
Date: Thursday, March 2, 2023 at 4:17 PM
To: python-list@python.org
Subject: Which more Pythonic - self.__class__ or type(self)?
*** Attention: This is an external ema
Bonjour je suis français et je ne comprend pas comment je peux acceder a
python merci de me repondre
CORDIALEMENT Lilian
Envoyé à partir de [1]Courrier pour Windows
References
Visible links
1. https://go.microsoft.com/fwlink/?LinkId=550986
--
https://mail.python.o
On 3/4/2023 12:13 PM, Tom wrote:
Bonjour je suis français et je ne comprend pas comment je peux acceder a
python merci de me repondre
CORDIALEMENT Lilian
Envoyé à partir de [1]Courrier pour Windows
Veuillez expliquer ce que vous entendez par "peux accéder à un python".
On 2023-03-04 17:13, Tom wrote:
Bonjour je suis français et je ne comprend pas comment je peux acceder a
python merci de me repondre
CORDIALEMENT Lilian
Go to https://www.python.org/downloads/ and download the installer for
your operating system (Windows or MacOS). For Windows I'd
>>> I think you are over-thinking this, Avi :)
Is overthinking the pythonic way or did I develop such a habit from some
other language?
More seriously, I find in myself that I generally do not overthink. I
overtalk and sort of overwrite, so for now, I think I will drop out of this
possibly non-py
On 5/03/23 5:12 pm, Dino wrote:
I can do a substring search in a list of 30k elements in less than 2ms
with Python. Is my reasoning sound?
I just did a similar test with your actual data and got
about the same result. If that's fast enough for you,
then you don't need to do anything fancy.
--
22 matches
Mail list logo