I don't remember making such a mistake ever before, but it might have
happened. -= is a convenient operator so I've probably used it a lot.
Anyway, I found that flake8 flagged this as
E225 missing whitespace around operator
and it's the only linter of pylint, flake8 and pyflake that detects
On 3/14/23 18:50, Rob Cliffe wrote:
On 14/03/2023 21:28, avi.e.gr...@gmail.com wrote:
Type hints are actually situationally quite useful (though yes, kind of
hard to understand when you first come across their use, largely because
of things like Union). And I wouldn't recommend their use
On Tue, 14 Mar 2023 22:15:34 GMT, Gilmeh Serda wrote:
> On Mon, 13 Mar 2023 22:26:20 +0100, Morten W. Petersen wrote:
>
>> numbers for calculations didn't add up. It went into negative numbers,
>> when that shouldn't have been possible.
>
> We have all written code that makes us wonder why the
"Morten W. Petersen" writes:
> I was working in Python today, and sat there scratching my head as the
> numbers for calculations didn't add up. It went into negative numbers,
> when that shouldn't have been possible.
>
> Turns out I had a very small typo, I had =- instead of -=.
>
> Isn't it
On 14/03/2023 21:28, avi.e.gr...@gmail.com wrote:
TThere are people now trying to in some ways ruin the usability by putting in
type hints that are ignored and although potentially helpful as in a linter
evaluating it, instead often make it harder to read and write code if required
to use
, freedom is relative and after you have been mugged a few times by your
errors, you may decide it is worth getting some protection.
So, consider having code reviews where fresh eyes may spot your errors.
-Original Message-
From: Python-list On
Behalf Of Morten W. Petersen
Sent
Hoi.
After reading the replies, I think some script / linter etc. is the right
thing to do. What's the best linter for Python out there that covers this
as well?
At first glance I thought =- was a new assignment operator, and this is
what seemed unpythonic to me, to have two operators that were
On 2023-03-13, Morten W. Petersen wrote:
> I was working in Python today, and sat there scratching my head as the
> numbers for calculations didn't add up. It went into negative numbers,
> when that shouldn't have been possible.
>
> Turns out I had a very small typo, I had =- instead of -=.
>
>
On 3/13/23 17:26, Morten W. Petersen wrote:
It went into negative numbers,
when that shouldn't have been possible.
Turns out I had a very small typo, I had =- instead of -=.
Isn't it unpythonic to be able to make a mistake like that?
That is why I tell Alice it is always best to stay
On 3/13/2023 9:47 PM, Chris Angelico wrote:
On Tue, 14 Mar 2023 at 12:38, Thomas Passin wrote:
On 3/13/2023 9:07 PM, Chris Angelico wrote:
Of course, all this is predicated on you actually putting whitespace
around your equals signs. If you write it all crunched together as
"x=-5", there's
On Tue, 14 Mar 2023 at 12:38, Thomas Passin wrote:
>
> On 3/13/2023 9:07 PM, Chris Angelico wrote:
> > Of course, all this is predicated on you actually putting whitespace
> > around your equals signs. If you write it all crunched together as
> > "x=-5", there's no extra clues to work with.
> >
>
On 3/13/2023 9:07 PM, Chris Angelico wrote:
Of course, all this is predicated on you actually putting whitespace
around your equals signs. If you write it all crunched together as
"x=-5", there's no extra clues to work with.
Linters and code reviewers can make use of all the available
problem of a hard to find bug because it LOOKS
RIGHT to you. But it is what it is.
Avi
-Original Message-
From: Python-list On
Behalf Of Morten W. Petersen
Sent: Monday, March 13, 2023 5:26 PM
To: python-list
Subject: =- and -= snag
Hi.
I was working in Python today, and sat there scr
On 2023-03-14 00:28, Gary Herron wrote:
On 3/13/23 2:26 PM, morp...@gmail.com wrote:
Hi.
I was working in Python today, and sat there scratching my head as the
numbers for calculations didn't add up. It went into negative numbers,
when that shouldn't have been possible.
Turns out I had a
On Tue, 14 Mar 2023 at 11:37, Gary Herron wrote:
>
>
> On 3/13/23 2:26 PM, morp...@gmail.com wrote:
> > Hi.
> >
> > I was working in Python today, and sat there scratching my head as the
> > numbers for calculations didn't add up. It went into negative numbers,
> > when that shouldn't have been
On 3/13/23 2:26 PM, morp...@gmail.com wrote:
Hi.
I was working in Python today, and sat there scratching my head as the
numbers for calculations didn't add up. It went into negative numbers,
when that shouldn't have been possible.
Turns out I had a very small typo, I had =- instead of -=.
Hi.
I was working in Python today, and sat there scratching my head as the
numbers for calculations didn't add up. It went into negative numbers,
when that shouldn't have been possible.
Turns out I had a very small typo, I had =- instead of -=.
Isn't it unpythonic to be able to make a mistake
17 matches
Mail list logo