On Tue, Apr 23, 2019 at 8:41 AM Skip Montanaro wrote:
>>
>> By "accepted" you mean that it isn't complaining?
>
> Accepted, as in it provokes no complaints.
>
>> What kind of flagging?
>
> Unused.
>
Cool, thanks.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
>
> By "accepted" you mean that it isn't complaining?
Accepted, as in it provokes no complaints.
What kind of flagging?
Unused.
S
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Apr 23, 2019 at 8:21 AM Skip Montanaro wrote:
>
> > Interesting. So it would flag this code?
> >
> > for _ in range(5): next(f) # skip five lines
>
> As of at least recent versions (I have 2.1.1 in my Conda install at
> home) It seems to properly accept "_" as a variable name, even when
>
> Interesting. So it would flag this code?
>
> for _ in range(5): next(f) # skip five lines
As of at least recent versions (I have 2.1.1 in my Conda install at
home) It seems to properly accept "_" as a variable name, even when
not used. It also seems to accept any variable name as a loop index.
H
On Tue, Apr 23, 2019 at 7:28 AM Skip Montanaro wrote:
>
> > Not quite. The single-letter names mean "I am an iterator/index/etc",
> > but "_" means "I am not used anywhere".
>
> Small addendum to this. pyflakes (at least in my experience) doesn't
> interpret "_" as a variable name or prefix to a l
> Not quite. The single-letter names mean "I am an iterator/index/etc",
> but "_" means "I am not used anywhere".
Small addendum to this. pyflakes (at least in my experience) doesn't
interpret "_" as a variable name or prefix to a local variable as
"unused".
Skip
--
https://mail.python.org/mailm
On Tue, Apr 23, 2019 at 6:18 AM DL Neil wrote:
> Yet, because "i" (or "n", "a", or "x"...) does not convey usage-meaning
> - other than, "I am a place-holder"! So, aren't we back to "_"?
Not quite. The single-letter names mean "I am an iterator/index/etc",
but "_" means "I am not used anywhere".
Isn't there an argument that in this context, using the single letter
"l" as a variable name is 'lazy'? That the "l" could be used in
different contexts (per OP). That it conveys no meaning as to the
variable's purpose?
In this specific case, I actually think that "l" is a bad choice, but
not be
On 2019-04-20, Chris Angelico wrote:
> In this specific case, I actually think that "l" is a bad choice, but
> not because it's a single letter - more because there is a very strong
> convention of using "i" for a loop iterator, and the lowercase "l" is
> confusingly similar.
Also, in some fonts
On Sun, Apr 21, 2019 at 8:43 AM DL Neil wrote:
> > Be aware that this is using an old form of Python syntax, not
> > supported by current versions. To try this example in a modern version
> > of Python, write it like this:
> >
> > for l in range(50):
> > print(l, end=" ")
>
>
> Python2: print
On 21/04/19 8:16 AM, Chris Angelico wrote:
On Sun, Apr 21, 2019 at 2:14 AM Dennis Lee Bieber wrote:
Only use short (single character) names for items that only exist as
loop control, and are not rebound within the loop, nor used outside of the
scope of that loop (but can be reused in a
On Sun, Apr 21, 2019 at 2:14 AM Dennis Lee Bieber wrote:
> Only use short (single character) names for items that only exist as
> loop control, and are not rebound within the loop, nor used outside of the
> scope of that loop (but can be reused in another subsequent loop
> control)...
>
>
On 2019-04-19, Stefan Ram wrote:
> Now consider the same in Python:
>
> def f():
> # ...
> l = 22 # representing a length
> # ...
> l = 'abc'; # representing the left half of something
> # ...
>
> A Python implementation does not catch the "error".
Obviously it is a deli
Gilmeh Serda writes:
> On Fri, 19 Apr 2019 21:01:05 +, Stefan Ram wrote:
>
>> Has this ever been a problem for someone?
>
> Only for programmers who come here from other languages and expect Python
> to behave in the same manner as their favorite language, so they try and
> argue that thi
14 matches
Mail list logo