On Tue, 23 Aug 2016 12:29 am, Random832 wrote:
> Receiving a SyntaxError or whatever other exception, which provides no
> suggestion about how to actually fix the issue (install a later version
> of python / run with "python3" instead of "python"), is a bad user
> experience.
Er wot?
If I run th
On Tuesday, August 23, 2016 at 2:30:10 AM UTC+12, Random832 wrote:
> Receiving a SyntaxError or whatever other exception, which provides no
> suggestion about how to actually fix the issue (install a later version
> of python / run with "python3" instead of "python"), is a bad user
> experience.
W
On Tue, Aug 23, 2016 at 12:29 AM, Random832 wrote:
> On Mon, Aug 22, 2016, at 09:21, Steve D'Aprano wrote:
>> Rather, you just use the features you rely on, document the minimum
>> supported version, and if somebody is silly enough to try running your
>> code
>> under Python 1.4, they'll get a Syn
On Mon, Aug 22, 2016, at 09:21, Steve D'Aprano wrote:
> Rather, you just use the features you rely on, document the minimum
> supported version, and if somebody is silly enough to try running your
> code
> under Python 1.4, they'll get a SyntaxError or an exception when you try
> to
> do something
On Mon, 22 Aug 2016 10:52 pm, Random832 wrote:
> On Mon, Aug 22, 2016, at 08:44, Chris Angelico wrote:
>> However, I don't think it's particularly necessary. Explicit version
>> number checks should be very rare, and shouldn't be encouraged.
>> Instead, encourage feature checks, as Steve gave some
On Monday, August 22, 2016 at 7:00:36 PM UTC+5:30, Steve D'Aprano wrote:
> Realistically, by the time you convince people this is a useful feature,
> write a patch and have the patch reviewed, you'll be looking at Python 3.7.
> So 3.7 will have this new syntax "use version", and *no other version*.
On Mon, 22 Aug 2016 08:32 pm, rocky wrote:
> On Monday, August 22, 2016 at 1:36:07 AM UTC-4, Steven D'Aprano wrote:
[...]
>> But... I don't understand what this proposal actually is. We already have
>> a uniform way to indicate the Python language version: check sys.version,
>> or sys.version_info
Random832 :
> The problem is when you want to write a large body of code that just
> *uses* lots of features (including syntactic features), *without*
> checking for them.
Ordinarily, that's the job of package management. The installer will
perform the necessary checks for you.
Marko
--
https:/
On Monday, August 22, 2016 at 8:45:05 AM UTC-4, Chris Angelico wrote:
> On Mon, Aug 22, 2016 at 10:05 PM, Marko Rauhamaa wrote:
> > rocky :
> >
> >> A slightly different but related problem is noting the Python dialect
> >> at the package-level.
> >
> > I don't know what if anything is needed supp
On Mon, Aug 22, 2016, at 08:44, Chris Angelico wrote:
> However, I don't think it's particularly necessary. Explicit version
> number checks should be very rare, and shouldn't be encouraged.
> Instead, encourage feature checks, as Steve gave some examples of.
The problem is when you want to write
On Monday, August 22, 2016 at 8:05:15 AM UTC-4, Marko Rauhamaa wrote:
> rocky :
>
> > A slightly different but related problem is noting the Python dialect
> > at the package-level.
>
> I don't know what if anything is needed support this idea, but one
> option would be to just use "import":
>
>
On Mon, Aug 22, 2016 at 10:05 PM, Marko Rauhamaa wrote:
> rocky :
>
>> A slightly different but related problem is noting the Python dialect
>> at the package-level.
>
> I don't know what if anything is needed support this idea, but one
> option would be to just use "import":
>
> import python
rocky :
> A slightly different but related problem is noting the Python dialect
> at the package-level.
I don't know what if anything is needed support this idea, but one
option would be to just use "import":
import python3_5_17
That would require Python and modules to install such empty mo
On Monday, August 22, 2016 at 12:33:53 AM UTC-4, Chris Angelico wrote:
> On Mon, Aug 22, 2016 at 1:37 PM, rocky wrote:
> > Sorry should have been:
> >
> > assert sys.version_info >= (3,0)
>
> The next question is: How common is code like this? I don't put
> version checks in any of my modules. A
On Monday, August 22, 2016 at 6:44:43 AM UTC-4, Rustom Mody wrote:
> On Monday, August 22, 2016 at 3:53:27 PM UTC+5:30, rocky wrote:
> > On Monday, August 22, 2016 at 2:04:39 AM UTC-4, Random832 wrote:
> > > On Mon, Aug 22, 2016, at 01:35, Steven D'Aprano wrote:
> > > > Could somebody (the OP?) ple
On Monday, August 22, 2016 at 3:53:27 PM UTC+5:30, rocky wrote:
> On Monday, August 22, 2016 at 2:04:39 AM UTC-4, Random832 wrote:
> > On Mon, Aug 22, 2016, at 01:35, Steven D'Aprano wrote:
> > > Could somebody (the OP?) please explain what is the purpose of this
> > > proposal, what it does, how i
On Monday, August 22, 2016 at 1:36:07 AM UTC-4, Steven D'Aprano wrote:
> On Monday 22 August 2016 14:33, Chris Angelico wrote:
>
> > On Mon, Aug 22, 2016 at 1:37 PM, rocky wrote:
> >> Sorry should have been:
> >>
> >> assert sys.version_info >= (3,0)
> >
> > The next question is: How common is
On Monday, August 22, 2016 at 2:04:39 AM UTC-4, Random832 wrote:
> On Mon, Aug 22, 2016, at 01:35, Steven D'Aprano wrote:
> > Could somebody (the OP?) please explain what is the purpose of this
> > proposal, what it does, how it works, and when would people use it?
>
> I think what he wants is a w
On Monday 22 August 2016 16:03, Stefan Behnel wrote:
> Steven D'Aprano schrieb am 22.08.2016 um 07:35:
>> if sys.version < '3':
>> import mymodule2 as mymodule
>> else:
>> import mymodule3 as mymodule
>
> This condition is going to fail when Python 30.0 comes out.
That will be sometime
On Mon, Aug 22, 2016 at 3:35 PM, Steven D'Aprano
wrote:
> Could somebody (the OP?) please explain what is the purpose of this proposal,
> what it does, how it works, and when would people use it?
My theory: A directive is actually parsed by the compiler, not
executed at run-time. So you could hav
Stefan Behnel schrieb am 22.08.2016 um 08:03:
> Steven D'Aprano schrieb am 22.08.2016 um 07:35:
>> if sys.version < '3':
>> import mymodule2 as mymodule
>> else:
>> import mymodule3 as mymodule
>
> This condition is going to fail when Python 30.0 comes out.
Oh, sorry - make that Python 10
On Mon, Aug 22, 2016, at 02:03, Stefan Behnel wrote:
> Steven D'Aprano schrieb am 22.08.2016 um 07:35:
> > if sys.version < '3':
> > import mymodule2 as mymodule
> > else:
> > import mymodule3 as mymodule
>
> This condition is going to fail when Python 30.0 comes out.
Er, won't it rather
On Mon, Aug 22, 2016, at 01:35, Steven D'Aprano wrote:
> Could somebody (the OP?) please explain what is the purpose of this
> proposal, what it does, how it works, and when would people use it?
I think what he wants is a way for a module which uses features
(syntactic or otherwise, but I suppose
Steven D'Aprano schrieb am 22.08.2016 um 07:35:
> if sys.version < '3':
> import mymodule2 as mymodule
> else:
> import mymodule3 as mymodule
This condition is going to fail when Python 30.0 comes out.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
On Monday 22 August 2016 14:33, Chris Angelico wrote:
> On Mon, Aug 22, 2016 at 1:37 PM, rocky wrote:
>> Sorry should have been:
>>
>> assert sys.version_info >= (3,0)
>
> The next question is: How common is code like this? I don't put
> version checks in any of my modules. Adding magic comment
On Mon, Aug 22, 2016 at 1:37 PM, rocky wrote:
> Sorry should have been:
>
> assert sys.version_info >= (3,0)
The next question is: How common is code like this? I don't put
version checks in any of my modules. Adding magic comments would be of
value only if this sort of thing is common enough to
Sorry should have been:
assert sys.version_info >= (3,0)
On Sunday, August 21, 2016 at 11:30:11 PM UTC-4, Ben Finney wrote:
> rocky writes:
>
> > The assertion should have been
> >
> > assert sys.version >= (3, 0)
>
> Perhaps you haven't tried any of these examples before presenting th
rocky writes:
> The assertion should have been
>
> assert sys.version >= (3, 0)
Perhaps you haven't tried any of these examples before presenting them?
>>> import sys
>>> assert sys.version >= (3, 0)
Traceback (most recent call last):
File "", line 1, in
TypeError: uno
The assertion should have been
assert sys.version >= (3, 0)
If we want to indicate the Python program supports language versions 3.0 and
greater.
On Sunday, August 21, 2016 at 3:59:48 PM UTC-4, Vincent Vande Vyvre wrote:
> Le 21/08/2016 à 20:28, rocky a écrit :
> > The problem:
> >
> > 1. th
Le 21/08/2016 à 20:28, rocky a écrit :
The problem:
1. there are various code inspection tools that parse Python programs looking
for style issues or whatnot. The deeper ones have to do a full parse of the
python program. It would be helpful if there were a uniform way to indicate the
Python
The problem:
1. there are various code inspection tools that parse Python programs looking
for style issues or whatnot. The deeper ones have to do a full parse of the
python program. It would be helpful if there were a uniform way to indicate the
Python language level used in Python source code
31 matches
Mail list logo