Unless someone is counting lines of code for some purpose, like number of
error found per thousand lines of code, many short one-liners strike me as
more readable and especially if followed by a blank line so it is a bit
obvious.
Consider a similar issue in many languages that use curly braces and
On Thu, 15 Dec 2022 at 16:29, Thomas Passin wrote:
>
> PEP-8, which is Guido's style guide and generally good to follow, does
> not completely discourage single-line usage like the example. It's not
> clear to me how Chris's example fits into the guidelines.
>
> PEP-8:
> "While sometimes it’s oka
PEP-8, which is Guido's style guide and generally good to follow, does
not completely discourage single-line usage like the example. It's not
clear to me how Chris's example fits into the guidelines.
PEP-8:
"While sometimes it’s okay to put an if/for/while with a small body on
the same line,
On 15/12/2022 07.53, Aaron P wrote:
I occasionally run across something like:
for idx, thing in enumerate(things):
if idx == 103:
continue
do_something_with(thing)
It seems more succinct and cleaner to use:
if idx == 103: continue.
Of course this would be considered an anti
On Thu, 15 Dec 2022 at 14:41, Aaron P wrote:
>
> I occasionally run across something like:
>
> for idx, thing in enumerate(things):
> if idx == 103:
> continue
> do_something_with(thing)
>
> It seems more succinct and cleaner to use:
>
> if idx == 103: continue.
>
> Of course this
Dictionaries and sets are your friends here.
On 12/14/2022 1:50 PM, songbird wrote:
I'm relatively new to python but not new to programming in general.
The program domain is accounting and keeping track of stock trades and other
related information (dates, cash accounts, interest, divid
DFS writes:
> On 12/14/2022 3:55 AM, Cecil Westerhof wrote:
>> If I want to know the dependencies for requests I use:
>> pip show requests
>> And one of the lines I get is:
>> Requires: certifi, charset-normalizer, idna, urllib3
>> But I want (in this case) to know with version of chars
I occasionally run across something like:
for idx, thing in enumerate(things):
if idx == 103:
continue
do_something_with(thing)
It seems more succinct and cleaner to use:
if idx == 103: continue.
Of course this would be considered an anti-pattern, and Flake8 will complain.
Any
I'm relatively new to python but not new to programming in general.
The program domain is accounting and keeping track of stock trades and other
related information (dates, cash accounts, interest, dividends, transfers of
funds, etc.)
Assume that all data is CSV format. There are multi
On 12/14/2022 12:55 AM, Gronicus@SGA.Ninja wrote:
I realized it had something to do with tupilation
The simple fix is to add the * into the original code.
Startt = datetime.datetime(*Startt)
I am not sure what "dts1 == Startt # True" does
It demonstrates that the version with the "*" give
On 12/14/2022 3:55 AM, Cecil Westerhof wrote:
If I want to know the dependencies for requests I use:
pip show requests
And one of the lines I get is:
Requires: certifi, charset-normalizer, idna, urllib3
But I want (in this case) to know with version of charset-normalizer
requests need
If I want to know the dependencies for requests I use:
pip show requests
And one of the lines I get is:
Requires: certifi, charset-normalizer, idna, urllib3
But I want (in this case) to know with version of charset-normalizer
requests needs.
How do I get that?
--
Cecil Westerhof
Senior
12 matches
Mail list logo