[Python-ideas] Show deprecation warnings in the interactive interpreter

Chris Angelico rosuav at gmail.com
Wed Feb 25 11:17:04 CET 2015


On Wed, Feb 25, 2015 at 9:01 PM, Ben Finney <ben+python at benfinney.id.au> wrote:
> Steven D'Aprano <steve at pearwood.info> writes:
>
>> On Wed, Feb 25, 2015 at 07:39:50PM +1100, Ben Finney wrote:
>> > To its detriment: Making the interactive interpreter behave differently
>> > by default from the non-interactive interpreter should be resisted; code
>> > which behaves a certain way by default in one should behave the same way
>> > in the other, without extremely compelling justification.
>>
>> The ship has sailed on that one. […]
>
> Please note two things:
>
> I don't claim there must be no differences, only that differences
> proposed today must come with compellign justification.
>
> The fact that there are already differences doesn't justify diverging
> further. Whatever positive justification is offered, “they already
> diverge” cannot count for creating further divergence.

Agreed; the difference does need justification. Here's justification:
Interactive execution places code and output right next to each other.
The warning would be emitted right at the time when the corresponding
code is entered.

Hmm. There are a few places where code gets pre-evaluated by the back
end (eg to figure out whether a continuation prompt is needed). Should
applicable SyntaxWarnings be emitted during such partial evaluation,
or should they be held over until the whole block can be parsed?

ChrisA


More information about the Python-ideas mailing list