On 2016-02-08 8:02 PM, Steven D'Aprano wrote:
On Mon, Feb 08, 2016 at 05:43:25PM -0500, Yury Selivanov wrote:
On 2016-02-08 5:19 PM, Terry Reedy wrote:
On 2/8/2016 4:51 PM, Victor Stinner wrote:
2016-02-08 22:28 GMT+01:00 Alexander Walters :
What incantation do you need to do to make that
On Tuesday, February 9, 2016 8:14 AM, Michel Desmoulin
wrote:
> I give regular Python trainings and I see similar errors regularly such as:
>
> - not returning something;
> - using something without putting the result back in a variable.
>
> However, these are impossible to warn about.
>
> Wh
Hello,
Le 08/02/2016 20:13, Guido van Rossum a écrit :
On Mon, Feb 8, 2016 at 9:44 AM, Victor Stinner wrote:
I changed the Python compiler to ignore any kind "constant
expressions", whereas it only ignored strings and integers before:
http://bugs.python.org/issue26204
The compiler now also em
On 02/09/2016 10:57 AM, Joseph Martinot-Lagarde wrote:
> Victor Stinner gmail.com> writes:
>
>>
>> Hi,
>>
>> I changed the Python compiler to ignore any kind "constant
>> expressions", whereas it only ignored strings and integers before:
>> http://bugs.python.org/issue26204
>>
>> The compiler
2016-02-09 10:57 GMT+01:00 Joseph Martinot-Lagarde :
> I frequently use 1/0 as a quick break in a script or a program (it's even
> more useful with post-mortem debugging). Would it be considered as a
> constant and ignored instead of raising a ZeroDivisionError ?
"self.x - self.y" and "1/0" are no
Victor Stinner gmail.com> writes:
>
> Hi,
>
> I changed the Python compiler to ignore any kind "constant
> expressions", whereas it only ignored strings and integers before:
> http://bugs.python.org/issue26204
>
> The compiler now also emits a SyntaxWarning on such case. IMHO the
> warning can
On Tue, Feb 9, 2016 at 7:34 AM, Guido van Rossum wrote:
> On Mon, Feb 8, 2016 at 11:51 AM, Victor Stinner
> wrote:
>> Le 8 févr. 2016 8:14 PM, "Guido van Rossum" a écrit :
>>> Hum. I'm not excited by this idea. It is not bad syntax.
>>
>> Do you see an use case for "constant statements" other th
Personally I don't think it's worth the churn.
On Mon, Feb 8, 2016 at 5:49 PM, Chris Angelico wrote:
> On Tue, Feb 9, 2016 at 12:41 PM, MRAB wrote:
>> On 2016-02-09 00:53, Guido van Rossum wrote:
>>>
>>> The warning for 'assert (cond, msg)' was specifically put in because
>>> this is a nasty tra
On Mon, Feb 8, 2016 at 5:41 PM, MRAB wrote:
> On 2016-02-09 00:53, Guido van Rossum wrote:
>>
>> The warning for 'assert (cond, msg)' was specifically put in because
>> this is a nasty trap. It's *always* a mistaken attempt to write
>> 'assert cond, msg' -- usually in an attempt to break a long li
On Tue, Feb 9, 2016 at 12:41 PM, MRAB wrote:
> On 2016-02-09 00:53, Guido van Rossum wrote:
>>
>> The warning for 'assert (cond, msg)' was specifically put in because
>> this is a nasty trap. It's *always* a mistaken attempt to write
>> 'assert cond, msg' -- usually in an attempt to break a long l
On 2016-02-09 00:53, Guido van Rossum wrote:
The warning for 'assert (cond, msg)' was specifically put in because
this is a nasty trap. It's *always* a mistaken attempt to write
'assert cond, msg' -- usually in an attempt to break a long line
without using a backslash. I'd actually consider promo
On Mon, Feb 08, 2016 at 05:43:25PM -0500, Yury Selivanov wrote:
>
>
> On 2016-02-08 5:19 PM, Terry Reedy wrote:
> >On 2/8/2016 4:51 PM, Victor Stinner wrote:
> >>2016-02-08 22:28 GMT+01:00 Alexander Walters :
> >>>What incantation do you need to do to make that behavior apparent?
> >>
> >>I didn'
The warning for 'assert (cond, msg)' was specifically put in because
this is a nasty trap. It's *always* a mistaken attempt to write
'assert cond, msg' -- usually in an attempt to break a long line
without using a backslash. I'd actually consider promoting it to a
syntax error rather than removing
On Mon, Feb 8, 2016 at 3:48 PM, MRAB wrote:
> help('assert')
>
> You'll see that in "assert (True,)", the tuple (an object) is the first
> condition (and probably a mistake), whereas in "assert True,", the True is
> the condition and the second expression (after the comma) is missing.
yes,
On 2016-02-08 23:21, Chris Barker wrote:
On Mon, Feb 8, 2016 at 1:51 PM, Victor Stinner mailto:victor.stin...@gmail.com>> wrote:
I didn't know. I just checked. It's assert used with a non-empty tuple:
>>> assert ("tuple",)
which is more interesting with a tuple without the parenthese
On Mon, Feb 8, 2016 at 1:51 PM, Victor Stinner
wrote:
> I didn't know. I just checked. It's assert used with a non-empty tuple:
>
> >>> assert ("tuple",)
>
which is more interesting with a tuple without the parentheses:
t = In [*4*]: t = True,
In [*5*]: t
Out[*5*]: (True,)
works fine, but no
On 2016-02-08 5:19 PM, Terry Reedy wrote:
On 2/8/2016 4:51 PM, Victor Stinner wrote:
2016-02-08 22:28 GMT+01:00 Alexander Walters :
What incantation do you need to do to make that behavior apparent?
I didn't know. I just checked. It's assert used with a non-empty tuple:
assert ("tuple",)
On 2/8/2016 4:51 PM, Victor Stinner wrote:
2016-02-08 22:28 GMT+01:00 Alexander Walters :
What incantation do you need to do to make that behavior apparent?
I didn't know. I just checked. It's assert used with a non-empty tuple:
assert ("tuple",)
:1: SyntaxWarning: assertion is always true,
On Tue, Feb 9, 2016 at 8:51 AM, Victor Stinner wrote:
> 2016-02-08 22:28 GMT+01:00 Alexander Walters :
>> What incantation do you need to do to make that behavior apparent?
>
> I didn't know. I just checked. It's assert used with a non-empty tuple:
>
assert ("tuple",)
> :1: SyntaxWarning: ass
2016-02-08 22:28 GMT+01:00 Alexander Walters :
> What incantation do you need to do to make that behavior apparent?
I didn't know. I just checked. It's assert used with a non-empty tuple:
>>> assert ("tuple",)
:1: SyntaxWarning: assertion is always true, perhaps remove parentheses?
Victor
__
On Tue, Feb 9, 2016 at 8:41 AM, Alexander Walters
wrote:
>
>
> On 2/8/2016 16:37, John Mark Vandenberg wrote:
>>
>> fwiw, pyflakes doesnt detect this. I've created a bug for that
>> https://bugs.launchpad.net/pyflakes/+bug/1543246
>
>
> Flake8 does, so it might be in the ... poorly named ... pep8
On 2/8/2016 16:37, John Mark Vandenberg wrote:
fwiw, pyflakes doesnt detect this. I've created a bug for that
https://bugs.launchpad.net/pyflakes/+bug/1543246
Flake8 does, so it might be in the ... poorly named ... pep8 checker.
___
Python-Dev mai
On Tue, Feb 9, 2016 at 8:20 AM, Victor Stinner wrote:
> Le 8 févr. 2016 9:34 PM, "Guido van Rossum" a écrit :
>> If you want to do linter integration that should probably be
>> integrated with the user's editor, like it is in PyCharm, and IIUC
>> people can do this in e.g. Emacs, Sublime or Vim a
On Mon, Feb 8, 2016 at 1:20 PM, Victor Stinner wrote:
> Le 8 févr. 2016 9:34 PM, "Guido van Rossum" a écrit :
>> If you want to do linter integration that should probably be
>> integrated with the user's editor, like it is in PyCharm, and IIUC
>> people can do this in e.g. Emacs, Sublime or Vim a
What incantation do you need to do to make that behavior apparent?
tritium@gesa:~$ python3.5 -W all
Python 3.5.1 (default, Dec 18 2015, 02:15:10)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
Jedi is not installed, falling back to readline
>>> assert
Le 8 févr. 2016 9:10 PM, "Alexander Walters" a
écrit :
>
> I am not keen on a SyntaxWarning. Either something is python syntax, or
it is not.
Oh I forgot to mention that Python already emits SyntaxWarning, on "assert
True" for example.
Victor
___
Pyth
Le 8 févr. 2016 9:34 PM, "Guido van Rossum" a écrit :
> If you want to do linter integration that should probably be
> integrated with the user's editor, like it is in PyCharm, and IIUC
> people can do this in e.g. Emacs, Sublime or Vim as well. Leave the
> interpreter alone.
In GCC, warnings are
On 02/08/2016 10:15 AM, Ethan Furman wrote:
On 02/08/2016 09:44 AM, Victor Stinner wrote:
> Are you ok with the new warning?
+1
Changing my vote:
-1 on the warning
+0 on simply removing the unused constant
--
~Ethan~
___
Python-Dev mailing list
On Mon, Feb 8, 2016 at 11:51 AM, Victor Stinner
wrote:
> Le 8 févr. 2016 8:14 PM, "Guido van Rossum" a écrit :
>> Hum. I'm not excited by this idea. It is not bad syntax.
>
> Do you see an use case for "constant statements" other than strings and
> ellipsis?
The same use case as for all dead cod
I am not keen on a SyntaxWarning. Either something is python syntax, or
it is not. This warning catches something linters have been catching
for ages. I really don't see the value in adding this, and can see it
causing more confusion than it solves. In the #python irc channel, we
see quite
Le 8 févr. 2016 8:14 PM, "Guido van Rossum" a écrit :
> Hum. I'm not excited by this idea. It is not bad syntax.
Do you see an use case for "constant statements" other than strings and
ellipsis?
Such statement does nothing. Previously the compiler emited
LOAD_CONST+POP_TOP.
GCC also emits a war
> On Feb 8, 2016, at 11:13, Guido van Rossum wrote:
>
>> On Mon, Feb 8, 2016 at 9:44 AM, Victor Stinner
>> wrote:
>> I changed the Python compiler to ignore any kind "constant
>> expressions", whereas it only ignored strings and integers before:
>> http://bugs.python.org/issue26204
>>
>> The c
On Mon, Feb 8, 2016 at 9:44 AM, Victor Stinner wrote:
> I changed the Python compiler to ignore any kind "constant
> expressions", whereas it only ignored strings and integers before:
> http://bugs.python.org/issue26204
>
> The compiler now also emits a SyntaxWarning on such case. IMHO the
> warni
>> New behaviour:
>>
>> haypo@smithers$ ./python
>> Python 3.6.0a0 (default:759a975e1230, Feb 8 2016, 18:21:23)
> def f():
>> ... False
>> ...
Ok, I see in your case there's no return :-)
___
Python-Dev mailing list
Python-Dev@python.org
https://
On 02/08/2016 09:44 AM, Victor Stinner wrote:
> Are you ok with the new warning?
+1
--
~Ethan~
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/
On 02/08/2016 10:00 AM, francismb wrote:
> On 02/08/2016 06:44 PM, Victor Stinner wrote:
>> I changed the Python compiler to ignore any kind "constant
>> expressions", whereas it only ignored strings and integers before:
>> http://bugs.python.org/issue26204
>>
>> The compiler now also emits a Syn
On Mon, Feb 8, 2016 at 9:44 AM Victor Stinner
wrote:
> Hi,
>
> I changed the Python compiler to ignore any kind "constant
> expressions", whereas it only ignored strings and integers before:
> http://bugs.python.org/issue26204
>
> The compiler now also emits a SyntaxWarning on such case. IMHO the
Hi,
On 02/08/2016 06:44 PM, Victor Stinner wrote:
> Hi,
>
> I changed the Python compiler to ignore any kind "constant
> expressions", whereas it only ignored strings and integers before:
> http://bugs.python.org/issue26204
>
> The compiler now also emits a SyntaxWarning on such case. IMHO the
>
Hi,
I changed the Python compiler to ignore any kind "constant
expressions", whereas it only ignored strings and integers before:
http://bugs.python.org/issue26204
The compiler now also emits a SyntaxWarning on such case. IMHO the
warning can help to detect bugs for developers who just learnt Pyt
39 matches
Mail list logo