Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev

PEP 3003 - Python Language Moratorium

 

 

First page Previous page 1 2 3 4 Next page Last page  View All Python dev RSS feed   Index | Next | Previous | View Threaded


dirkjan at ochtman

Nov 6, 2009, 1:47 AM

Post #51 of 94 (1243 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Fri, Nov 6, 2009 at 10:35, Nick Coghlan <ncoghlan [at] gmail> wrote:
> Longer term, a solution may be to extend the standard deprecation period
> one release and make pending deprecation warnings required rather than
> optional. That way, on the ball developers would have a full release to
> quash deprecation warnings before their users encountered them by default.
>
> That is:
>
>  Release X.Y: deprecated in docs, pending deprecation in code
>  Release X.Y+1: deprecated in code
>  Release X.Y+2: removed in code and docs
>
> (Or we could just make that the policy now and not do anything specific
> in relation to the moratorium and the standard library)

This sounds like an improvement for things like Mercurial, at least.
We did support 2.3-2.6 until relatively recently, and I think that's
hard to get around for software that actually has to work on the
user's box. This is a bit different from webapps, I suspect, where you
"only" have to support the servers, which you often have more control
over.

But supporting 4 releases in a row has been a bit of a PITA. Luckily,
we finally felt it was time to drop 2.3, so now we can make use of
luxuries such as subprocess... Still, supporting 3 releases seems
relatively common in the Python world (after all, parts of Zope still
require 2.4, I think), and so it would be nice if the stdlib moved a
little bit slower.

Cheers,

Dirkjan
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


ncoghlan at gmail

Nov 6, 2009, 2:20 AM

Post #52 of 94 (1234 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

Dirkjan Ochtman wrote:
> On Fri, Nov 6, 2009 at 10:35, Nick Coghlan <ncoghlan [at] gmail> wrote:
>> Longer term, a solution may be to extend the standard deprecation period
>> one release and make pending deprecation warnings required rather than
>> optional. That way, on the ball developers would have a full release to
>> quash deprecation warnings before their users encountered them by default.
>>
>> That is:
>>
>> Release X.Y: deprecated in docs, pending deprecation in code
>> Release X.Y+1: deprecated in code
>> Release X.Y+2: removed in code and docs
>>
>> (Or we could just make that the policy now and not do anything specific
>> in relation to the moratorium and the standard library)
>
> This sounds like an improvement for things like Mercurial, at least.
> We did support 2.3-2.6 until relatively recently, and I think that's
> hard to get around for software that actually has to work on the
> user's box. This is a bit different from webapps, I suspect, where you
> "only" have to support the servers, which you often have more control
> over.
>
> But supporting 4 releases in a row has been a bit of a PITA. Luckily,
> we finally felt it was time to drop 2.3, so now we can make use of
> luxuries such as subprocess... Still, supporting 3 releases seems
> relatively common in the Python world (after all, parts of Zope still
> require 2.4, I think), and so it would be nice if the stdlib moved a
> little bit slower.

I would personally be open to the open to the idea of requiring 2
releases worth of Pending Deprecation warnings. Then you would have the
following situation for warnings-free operation on up to 3 versions of
Python:

Release X.Y-2: old approach only
Release X.Y-1: no change
Release X.Y: new approach added, old approach deprecated in docs,
pending deprecation warning in code
Release X.Y+1: no change
Release X.Y+2: deprecation warning in code
Release X.Y+3: old approach removed from docs and code

Libraries and applications supporting up to 3 Python versions
simultaneously would then have a clear path to follow: use the old
mechanism up to Release X.Y+1, then switch to the new mechanism in
Release X.Y+2

We would be looking at around 5 years to completely kill off a feature
at that point, which actually aligns fairly well with the time period
for which we provide source-only security patches for really old branches.

Making such a system practical would probably require some additional
infrastructure in the warnings module to handle the details though.

Specifically, rather than having to update the code to raise the correct
kind of warning each release, it would be better to instead be able to
write something like "warnings.warn_deprecated(msg, (3, 4))" and have it
generate PendingDeprecationWarning messages in 3.2 and 3.3, and then
DeprecationWarning messages in 3.4 and later. In code, something like:

def warn_deprecated(msg, version, ref=sys.version, stacklevel=2):
deprecated = version >= ref
if deprecated:
category = DeprecationWarning
else:
category = PendingDeprecationWarning
warn(msg, category, stacklevel)
return deprecated

Would people be interested in such a helper method (along with a
corresponding C API, naturally)?

With the reference version passed in as an optional argument, it would
even be applicable to more than just the Python core and standard library.

Regards,
Nick.

--
Nick Coghlan | ncoghlan [at] gmail | Brisbane, Australia
---------------------------------------------------------------
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


stefan_ml at behnel

Nov 6, 2009, 2:42 AM

Post #53 of 94 (1235 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

Raymond Hettinger, 05.11.2009 23:11:
> [GvR]
>> I haven't seen substantial opposition against the PEP -- in fact I
>> can't recall any, and many people have explicitly posted in support of
>> it. So unless opposition suddenly appears in the next few days, I'll
>> move it to the Accepted state next Monday.
>
> But it would have been so much fun to have a never ending python-ideas
> thread on BEGIN/END blocks ;-)

According to the PEP, you can still have that. It just won't lead to an
implementation being merged (or at least becoming part of a release) within
the next two years.

Stefan

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


exarkun at twistedmatrix

Nov 6, 2009, 6:04 AM

Post #54 of 94 (1235 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On 01:50 pm, dripton [at] ripton wrote:
>On 2009.11.06 08:25:29 +0100, Hagen Fürstenau wrote:
>> >> A switch to enable deprecation warnings would give developers a
>> >> chance to see them when migrating to a new version of python. And
>>it
>> >> would prevent users from having to deal with them.
>> >
>> > PendingDeprecationWarning is silent by default and requires a switch
>>to
>> > be enabled.
>>
>>So what we need is perhaps not a stdlib moratorium, but rather strict
>>adherence to a sequence of PendingDeprecationWarning ->
>>DeprecationWarning -> Removal? (The first one seems to have been
>>underused so far.)
>
>+1
>
>I really don't like the loud warnings for sha and md5 in 2.6,
>considering that hashlib wasn't even added until 2.5. It should be
>possible to write code that works across all the versions of Python 2
>that are currently shipping with mainstream Linux distrobutions without
>deprecation warnings or conditional version-dependent code.
>
>To go a step further, maybe follow javac's example and emit just one
>summary deprecation warning per program by default. Something
>like "this program uses deprecated API calls. Run it with
>python -deprecation to see the details."

End users don't even need to be told this much, though (and if it's
javac that does this for Java, then indeed Java end users probably
aren't seeing this either). I think it would be great for deprecation
warnings to be completely silent for a while *and* for the policy to be
prominently documented so that developers, the people who really need
this information, know how to get it.

Jean-Paul


guido at python

Nov 6, 2009, 8:02 AM

Post #55 of 94 (1242 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Thu, Nov 5, 2009 at 9:55 PM, Brett Cannon <brett [at] python> wrote:
> The clarification I need is will this in any way influence when
> modules are removed. If they stay in for the life of a major version
> then I want it made clear that bug fixes for the code take lower
> priority over all other code in the standard library.

I think we should be as cautious as ever with removing modules. We've
had our chance for clean-up without abandon with Py3k; now we should
stick with our commitment to backwards compatibility. In fact, we
should probably be *more* conservative than we already were given that
the amount of code written in Python is always increasing and hence
the cumulative pain caused by incompatible changes will increase too.

I'm fine with silent deprecations or requiring a flag to turn on
deprecation warnings (like Java does).

We're not yet at the point where C is, but who wouldn't be next to C
on the TIOBE index? :-)

--
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


ubershmekel at gmail

Nov 6, 2009, 8:25 AM

Post #56 of 94 (1270 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Fri, Nov 6, 2009 at 6:02 PM, Guido van Rossum <guido [at] python> wrote:

> I'm fine with silent deprecations or requiring a flag to turn on
> deprecation warnings (like Java does).
>
>
It's easier for java because they have compile time for the deprecation
warnings.

Maybe we should somehow silence all warnings when running eggs?

--yuv


debatem1 at gmail

Nov 6, 2009, 8:25 AM

Post #57 of 94 (1227 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Fri, Nov 6, 2009 at 11:02 AM, Guido van Rossum <guido [at] python> wrote:
> On Thu, Nov 5, 2009 at 9:55 PM, Brett Cannon <brett [at] python> wrote:
>> The clarification I need is will this in any way influence when
>> modules are removed. If they stay in for the life of a major version
>> then I want it made clear that bug fixes for the code take lower
>> priority over all other code in the standard library.
>
> I think we should be as cautious as ever with removing modules. We've
> had our chance for clean-up without abandon with Py3k; now we should
> stick with our commitment to backwards compatibility. In fact, we
> should probably be *more* conservative than we already were given that
> the amount of code written in Python is always increasing and hence
> the cumulative pain caused by incompatible changes will increase too.
>
> I'm fine with silent deprecations or requiring a flag to turn on
> deprecation warnings (like Java does).
>
> We're not yet at the point where C is, but who wouldn't be next to C
> on the TIOBE index? :-)

I'd take being next to lisp if it meant that we didn't have to become
any more like C ;).

And speaking of TIOBE, my impression- and apparently yours- was
that Python was on its way up, but TIOBE lists us as being down
from a little over a year ago. Anybody know anything about their
methodology?

Geremy Condra
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


brett at python

Nov 6, 2009, 9:37 AM

Post #58 of 94 (1228 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Fri, Nov 6, 2009 at 08:02, Guido van Rossum <guido [at] python> wrote:
> On Thu, Nov 5, 2009 at 9:55 PM, Brett Cannon <brett [at] python> wrote:
>> The clarification I need is will this in any way influence when
>> modules are removed. If they stay in for the life of a major version
>> then I want it made clear that bug fixes for the code take lower
>> priority over all other code in the standard library.
>
> I think we should be as cautious as ever with removing modules. We've
> had our chance for clean-up without abandon with Py3k; now we should
> stick with our commitment to backwards compatibility. In fact, we
> should probably be *more* conservative than we already were given that
> the amount of code written in Python is always increasing and hence
> the cumulative pain caused by incompatible changes will increase too.
>
> I'm fine with silent deprecations or requiring a flag to turn on
> deprecation warnings (like Java does).
>

We can discuss this on the stdlib-sig and come back with a proposal on
how to update PEP 4 with an explicit policy on how to handle
deprecations (either Nick's proposal or some flag, and then how long
to let the deprecation last, i.e. three versions or the life of a
major version of Python).

> We're not yet at the point where C is, but who wouldn't be next to C
> on the TIOBE index? :-)
>
> --
> --Guido van Rossum (python.org/~guido)
>
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


stechert at gmail

Nov 6, 2009, 11:31 AM

Post #59 of 94 (1265 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Fri, Nov 6, 2009 at 8:25 AM, geremy condra <debatem1 [at] gmail> wrote:
> And speaking of TIOBE, my impression- and apparently yours- was
> that Python was on its way up, but TIOBE lists us as being down
> from a little over a year ago. Anybody know anything about their
> methodology?

There's a detailed explanation at:

http://www.tiobe.com/index.php/content/paperinfo/tpci/tpci_definition.htm

Andre
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


tseaver at palladion

Nov 6, 2009, 11:37 AM

Post #60 of 94 (1225 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dirkjan Ochtman wrote:

> But supporting 4 releases in a row has been a bit of a PITA. Luckily,
> we finally felt it was time to drop 2.3, so now we can make use of
> luxuries such as subprocess... Still, supporting 3 releases seems
> relatively common in the Python world (after all, parts of Zope still
> require 2.4, I think), and so it would be nice if the stdlib moved a
> little bit slower.

The current release of Zope (finally) requires 2.5 or 2.6: we have a
"don't intentionally break 2.4" policy in place, however, FBO those
users whose system Python is still 2.4, and who can't / won't build
their own Python.


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver [at] palladion
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkr0ewgACgkQ+gerLs4ltQ7W2ACeOXPwhpg8Hi4/XZom/B59/7GD
4mwAnRkixQm0A3ZkNRQMPW1JIbEOy1iC
=gTbW
-----END PGP SIGNATURE-----

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


glyph at twistedmatrix

Nov 6, 2009, 12:48 PM

Post #61 of 94 (1224 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Nov 6, 2009, at 9:04 AM, exarkun [at] twistedmatrix wrote:

> End users don't even need to be told this much, though (and if it's
> javac that does this for Java, then indeed Java end users probably
> aren't seeing this either). I think it would be great for
> deprecation warnings to be completely silent for a while *and* for
> the policy to be prominently documented so that developers, the
> people who really need this information, know how to get it.

Documentation would be great, but then you have to get people to read
the documentation and that's kind of tricky. Better would be for
every project on PyPI to have a score which listed warnings emitted
with each version of Python. People love optimizing for stuff like
that and comparing it.

I suspect that even if all warnings were completely silent by default,
developers would suddenly become keenly interested in fixing them if
there were a metric like that publicly posted somewhere :).

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


tjreedy at udel

Nov 6, 2009, 1:45 PM

Post #62 of 94 (1226 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

Brett Cannon wrote:
> On Fri, Nov 6, 2009 at 08:02, Guido van Rossum <guido [at] python> wrote:
>> On Thu, Nov 5, 2009 at 9:55 PM, Brett Cannon <brett [at] python> wrote:
>>> The clarification I need is will this in any way influence when
>>> modules are removed. If they stay in for the life of a major version
>>> then I want it made clear that bug fixes for the code take lower
>>> priority over all other code in the standard library.
>> I think we should be as cautious as ever with removing modules. We've
>> had our chance for clean-up without abandon with Py3k; now we should
>> stick with our commitment to backwards compatibility. In fact, we
>> should probably be *more* conservative than we already were given that
>> the amount of code written in Python is always increasing and hence
>> the cumulative pain caused by incompatible changes will increase too.
>>
>> I'm fine with silent deprecations or requiring a flag to turn on
>> deprecation warnings (like Java does).
>>
>
> We can discuss this on the stdlib-sig and come back with a proposal on
> how to update PEP 4 with an explicit policy on how to handle
> deprecations (either Nick's proposal or some flag, and then how long
> to let the deprecation last, i.e. three versions or the life of a
> major version of Python).

Complete removal of modules during the seems to have caused problems
especially for people supporting a range of versions. On the other hand,
you want to be able to replace and cease support of modules. So rather
that complete removal, perhaps move them to a new package called, for
instance, 'old'. And move their doc sections to a new chapter call 'Old
Modules' which would begin with something like "The following modules
have been replaced but are still present in the *old* package for back
compatibility. They are no longer maintained and will possibly disappear
in the future, such as if there is ever a Python4." This suggestion
based on the "3. Non-essential Built-in Functions" of the 2.x doc, whose
contents disappeared in 3.0 (even though that seems not to have been
specified in the doc).

Terry Jan Reedy


_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


rdmurray at bitdance

Nov 6, 2009, 1:48 PM

Post #63 of 94 (1224 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Fri, 6 Nov 2009 at 15:48, Glyph Lefkowitz wrote:
> On Nov 6, 2009, at 9:04 AM, exarkun [at] twistedmatrix wrote:
>> End users don't even need to be told this much, though (and if it's javac
>> that does this for Java, then indeed Java end users probably aren't seeing
>> this either). I think it would be great for deprecation warnings to be
>> completely silent for a while *and* for the policy to be prominently
>> documented so that developers, the people who really need this information,
>> know how to get it.
>
> Documentation would be great, but then you have to get people to read the
> documentation and that's kind of tricky. Better would be for every project
> on PyPI to have a score which listed warnings emitted with each version of
> Python. People love optimizing for stuff like that and comparing it.
>
> I suspect that even if all warnings were completely silent by default,
> developers would suddenly become keenly interested in fixing them if there
> were a metric like that publicly posted somewhere :).

+1, but somebody needs to write the code...

--David (RDM)
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


exarkun at twistedmatrix

Nov 6, 2009, 1:52 PM

Post #64 of 94 (1225 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On 09:48 pm, rdmurray [at] bitdance wrote:
>On Fri, 6 Nov 2009 at 15:48, Glyph Lefkowitz wrote:
>>On Nov 6, 2009, at 9:04 AM, exarkun [at] twistedmatrix wrote:
>>>End users don't even need to be told this much, though (and if it's
>>>javac that does this for Java, then indeed Java end users probably
>>>aren't seeing this either). I think it would be great for
>>>deprecation warnings to be completely silent for a while *and* for
>>>the policy to be prominently documented so that developers, the
>>>people who really need this information, know how to get it.
>>
>>Documentation would be great, but then you have to get people to read
>>the documentation and that's kind of tricky. Better would be for
>>every project on PyPI to have a score which listed warnings emitted
>>with each version of Python. People love optimizing for stuff like
>>that and comparing it.
>>
>>I suspect that even if all warnings were completely silent by default,
>>developers would suddenly become keenly interested in fixing them if
>>there were a metric like that publicly posted somewhere :).
>
>+1, but somebody needs to write the code...

How would you collect this information? Would you run the test suite
for each project? This would reward projects with small or absent test
suites. ;)

Jean-Paul
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


guido at python

Nov 6, 2009, 2:37 PM

Post #65 of 94 (1209 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Fri, Nov 6, 2009 at 3:24 PM, Georg Brandl <g.brandl [at] gmx> wrote:
> Guido van Rossum schrieb:
>
>> Actually, I think Dirkjan has a point. I'm not sure that we need
>> another moratorium (that's a rather dramatic kind of decision which
>> should be very rare indeed) but I do agree that deprecations are often
>> more of a pain than they're worth.
>>
>> For example, take the deprecation of the md5 and sha modules in Python
>> 2.6. They make it a bit of a pain to write code that *cleanly*
>> supports Python 2.4 (doesn't have hashlib) through 2.6 (warns when
>> importing md5 instead of hashlib). You can silence the warning, but
>> that is in itself not particularly clean, and users really hate having
>> the warnings.
>
> Trying to import hashlib and importing md5 on ImportError isn't *too* unclean,
> is it?

That's not all -- you also have to modify the code that uses the
module, unless you use "import as", which has problems of its own.
Plus, I may not care (yet) about supporting 2.7, and yet I am forced
to change my code to cleanly support 2.6. I really don't like it.

--
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


g.brandl at gmx

Nov 6, 2009, 3:24 PM

Post #66 of 94 (1214 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

Guido van Rossum schrieb:

> Actually, I think Dirkjan has a point. I'm not sure that we need
> another moratorium (that's a rather dramatic kind of decision which
> should be very rare indeed) but I do agree that deprecations are often
> more of a pain than they're worth.
>
> For example, take the deprecation of the md5 and sha modules in Python
> 2.6. They make it a bit of a pain to write code that *cleanly*
> supports Python 2.4 (doesn't have hashlib) through 2.6 (warns when
> importing md5 instead of hashlib). You can silence the warning, but
> that is in itself not particularly clean, and users really hate having
> the warnings.

Trying to import hashlib and importing md5 on ImportError isn't *too* unclean,
is it?

Georg


--
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


ncoghlan at gmail

Nov 6, 2009, 6:42 PM

Post #67 of 94 (1200 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

Georg Brandl wrote:
> Guido van Rossum schrieb:
>
>> Actually, I think Dirkjan has a point. I'm not sure that we need
>> another moratorium (that's a rather dramatic kind of decision which
>> should be very rare indeed) but I do agree that deprecations are often
>> more of a pain than they're worth.
>>
>> For example, take the deprecation of the md5 and sha modules in Python
>> 2.6. They make it a bit of a pain to write code that *cleanly*
>> supports Python 2.4 (doesn't have hashlib) through 2.6 (warns when
>> importing md5 instead of hashlib). You can silence the warning, but
>> that is in itself not particularly clean, and users really hate having
>> the warnings.
>
> Trying to import hashlib and importing md5 on ImportError isn't *too* unclean,
> is it?

Having had to do this myself a few times, I was always a little
surprised the "import-or" idea [1] didn't get more support the last time
it was proposed.

Ah well, don't need to worry about that idea again until 3.4 or so :)

Cheers,
Nick

P.S. For anyone unfamiliar with it, "import-or" was a suggestion made
around the time xml.etree was added to the standard library to provide a
"import x or y as z" shorthand for:
try:
import x as z
except ImportError:
import y as z

(allowing "from a or b import c" was also part of the suggestion, as was
allowing multiple "or" elements in a single import request)

Support for the idea was lukewarm at best, hostile at worst (hence the
lack of PEP).

Cheers,
Nick.

--
Nick Coghlan | ncoghlan [at] gmail | Brisbane, Australia
---------------------------------------------------------------
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


guido at python

Nov 6, 2009, 7:16 PM

Post #68 of 94 (1192 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Fri, Nov 6, 2009 at 6:42 PM, Nick Coghlan <ncoghlan [at] gmail> wrote:
> Georg Brandl wrote:
>> Guido van Rossum schrieb:
>>
>>> Actually, I think Dirkjan has a point. I'm not sure that we need
>>> another moratorium (that's a rather dramatic kind of decision which
>>> should be very rare indeed) but I do agree that deprecations are often
>>> more of a pain than they're worth.
>>>
>>> For example, take the deprecation of the md5 and sha modules in Python
>>> 2.6. They make it a bit of a pain to write code that *cleanly*
>>> supports Python 2.4 (doesn't have hashlib) through 2.6 (warns when
>>> importing md5 instead of hashlib). You can silence the warning, but
>>> that is in itself not particularly clean, and users really hate having
>>> the warnings.
>>
>> Trying to import hashlib and importing md5 on ImportError isn't *too* unclean,
>> is it?
>
> Having had to do this myself a few times, I was always a little
> surprised the "import-or" idea [1] didn't get more support the last time
> it was proposed.
>
> Ah well, don't need to worry about that idea again until 3.4 or so :)
>
> Cheers,
> Nick
>
> P.S. For anyone unfamiliar with it, "import-or" was a suggestion made
> around the time xml.etree was added to the standard library to provide a
> "import x or y as z" shorthand for:
>  try:
>    import x as z
>  except ImportError:
>    import y as z
>
> (allowing "from a or b import c" was also part of the suggestion, as was
> allowing multiple "or" elements in a single import request)
>
> Support for the idea was lukewarm at best, hostile at worst (hence the
> lack of PEP).

I'm still -1 on that -- while it may sound like a good shorthand if
you have to deal with this, it's IMO pretty mysterious if you
encounter this and don't already happen to know what it means. Also,
it makes no sense without the 'as' clause which makes it a bit
awkward. (I could probably come up with a few more arguments against
it, just trying to hint that I'm personally less than lukewarm. :-)

--
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


stephen at xemacs

Nov 7, 2009, 12:35 AM

Post #69 of 94 (1226 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

~b <ea2499da0911051453n3569387aj581ad4acf5b799c8 [at] mail>
<4222a8490911051521r1b9c8165id6e0f12d62da0613 [at] mail>
<ca471dc20911051526u7f3642ecg19e4eb73bcca1d3a [at] mail>
<bbaeab100911051535g68cefa18kdadea33f78de9495 [at] mail>
<48c184130911051555r9a5b78cs3a13cb1345d3cbf7 [at] mail>
<20091106001430.3229.796306500.divmod.xquotient.180 [at] localhost>
<4AF3CF69.6090709 [at] gmx>
<20091106135058.GA13578 [at] vidar>
<20091106140412.3229.80002680.divmod.xquotient.193 [at] localhost>
<68272E43-D993-4833-8DC9-DB45CB40F368 [at] twistedmatrix>
<Pine.LNX.4.64.0911061647160.12274 [at] kimball>
<20091106215210.3229.1142452245.divmod.xquotient.212 [at] localhost>
X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta29) "garbanzo" d20e0a45a4b2 XEmacs Lucid (x86_64-unknown-linux)
Date: Sat, 07 Nov 2009 17:35:21 +0900
Message-ID: <87aayyspfa.fsf [at] uwakimon>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

exarkun [at] twistedmatrix writes:

> How would you collect this information? Would you run the test suite
> for each project? This would reward projects with small or absent test
> suites. ;)

Multiply by the number of lines of code and divide by the number of
tests run.
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


glyph at twistedmatrix

Nov 7, 2009, 12:36 AM

Post #70 of 94 (1193 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Nov 6, 2009, at 4:52 PM, exarkun [at] twistedmatrix wrote:

> On 09:48 pm, rdmurray [at] bitdance wrote:
>> On Fri, 6 Nov 2009 at 15:48, Glyph Lefkowitz wrote:
>>

>>> Documentation would be great, but then you have to get people to
>>> read the documentation and that's kind of tricky. Better would be
>>> for every project on PyPI to have a score which listed warnings
>>> emitted with each version of Python. People love optimizing for
>>> stuff like that and comparing it.
>>>
>>> I suspect that even if all warnings were completely silent by
>>> default, developers would suddenly become keenly interested in
>>> fixing them if there were a metric like that publicly posted
>>> somewhere :).
>>
>> +1, but somebody needs to write the code...
>
> How would you collect this information? Would you run the test
> suite for each project? This would reward projects with small or
> absent test suites. ;)



*I* would not collect this information, as I am far enough behind on
other projects ;-) but I if I were to advise someone *else* as to how
to do it, I'd probably add a feature to the 'warnings' module where
users could opt-in (sort of like popcon.debian.org) to report warnings
encountered during normal invocations of any of their Python programs.

I would also advise such a hypothetical data-gathering project to
start with a buildbot doing coverage runs; any warning during the test
suite would be 1 demerit, any warning during an actual end-user run of
the application *not* caught by the test suite would be 1000
demerits :).

And actually it would make more sense if this were part of an overall
quality metric, like http://pycheesecake.org/ proposes (although I
think that cheesecake's current metric is not really that great, the
idea is wonderful).

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


skip at pobox

Nov 7, 2009, 4:10 AM

Post #71 of 94 (1199 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

Guido> ... it's IMO pretty mysterious if you encounter this and don't
Guido> already happen to know what it means.

If you require parens maybe it parses better:

import (a or b or c) as mod

Given that the or operator shortcuts I think that (a or b or c) terminates
once a module is found isn't too hard to grasp.

Skip
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


exarkun at twistedmatrix

Nov 7, 2009, 5:44 AM

Post #72 of 94 (1173 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On 12:10 pm, skip [at] pobox wrote:
> Guido> ... it's IMO pretty mysterious if you encounter this and
>don't
> Guido> already happen to know what it means.
>
>If you require parens maybe it parses better:
>
> import (a or b or c) as mod
>
>Given that the or operator shortcuts I think that (a or b or c)
>terminates
>once a module is found isn't too hard to grasp.

Did everyone forget what the subject of this thread is?

Jean-Paul
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


g.brandl at gmx

Nov 7, 2009, 9:30 AM

Post #73 of 94 (1162 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

exarkun [at] twistedmatrix schrieb:
> On 12:10 pm, skip [at] pobox wrote:
>> Guido> ... it's IMO pretty mysterious if you encounter this and
>>don't
>> Guido> already happen to know what it means.
>>
>>If you require parens maybe it parses better:
>>
>> import (a or b or c) as mod
>>
>>Given that the or operator shortcuts I think that (a or b or c)
>>terminates
>>once a module is found isn't too hard to grasp.
>
> Did everyone forget what the subject of this thread is?

Why? The subject of this thread is "Importing module alternatives cleanly".
We just happened to forget adapting the "Subject:" line.

Georg

--
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


steve at pearwood

Nov 7, 2009, 4:14 PM

Post #74 of 94 (1165 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Fri, 6 Nov 2009 09:05:17 am Guido van Rossum wrote:
> On Tue, Nov 3, 2009 at 9:35 AM, Guido van Rossum <guido [at] python>
wrote:
> > I've checked draft (!) PEP 3003, "Python Language Moratorium", into
> > SVN. As authors I've listed Jesse, Brett and myself.
>
> I haven't seen substantial opposition against the PEP -- in fact I
> can't recall any, and many people have explicitly posted in support
> of it. So unless opposition suddenly appears in the next few days,
> I'll move it to the Accepted state next Monday.

I'm not a core developer, but I have made some objections on the
python-ideas list. For what it is worth, I don't think a moratorium is
needed, and it is not cost free. Whether the cost is worth it is a
matter of opinion, but I've read posts suggesting that there's no
downside to a moratorium. I think that's naive.

Firstly, the core developers are very conservative in the features they
add to the language. Nobody suggests that will change -- there are (as
far as I know) a grand total of *one* proposed language changes under
consideration for 3.2, namely "yield from". It isn't like the
moratorium is needed to stem a flood of vast numbers of incompatible
language changes, and this is not likely to change.

The given reason for the moratorium is to give the developers of other
Python implementations a chance to catch up. But as far as I know --
and I welcome correction -- only one such developer has spoken up, and
he says that new language features generally aren't a problem for
IronPython, but some standard library features are:

http://mail.python.org/pipermail/python-ideas/2009-October/006328.html

(In fairness, I should point out that Dino did not vote against the
moratorium, he gave a conditional "in favour" vote but asked for some
wiggle-room. A moratorium with wiggle-room is not a moratorium.)

A moratorium isn't cost-free. With the back-end free to change, patches
will go stale over 2+ years. People will lose interest or otherwise
move on. Those with good ideas but little patience will be discouraged.
I fully expect that, human nature being as it is, those proposing a
change, good or bad, will be told not to bother wasting their time,
there's a moratorium on at least as often as they'll be encouraged to
bide their time while the moratorium is on.

A moratorium turns Python's conservativeness up to 11. If Python already
has a reputation for being conservative in the features it accepts --
and I think it does -- then a moratorium risks giving the impression
that Python has become the language of choice for old guys sitting on
their porch yelling at the damn kids to get off the lawn. That's a plus
for Cobol. I don't think it is a plus for Python.

What one person sees as "stable", another may see as "moribund".
Perception does matter. Nick Coglan spoke of Jython having "fell by the
wayside" when CPython introduced new style classes:

http://mail.python.org/pipermail/python-ideas/2009-October/006431.html

I think that speaks to the opposite conclusion that Nick intended. If
developers craved stability, and were put off by the pace of changes to
CPython, why weren't they migrating to Jython, which had one new
production release in six years?

http://www.jython.org/archive/22/news.html

Nick also described C as changing much more slowly over its life that
Python has. This is misleading: it is true that the C standard has been
stable, but that doesn't mean that C compilers have been. Changes to
the standard were driven by changes introduced by the implementations,
not visa versa. Likewise for Cobol, where the first implementation to
introduce OOP was released in 1997, but the standard wasn't updated
until 2002.

Python is nothing like that. Python doesn't have an official standard,
and Guido has dismissed the need for an ISO standard. The other
implementations have historically let CPython lead as far as language
evolution goes. If CPython stops, likely Python stops. Who is going to
risk adding language features that break compatibility with the most
popular implementation? It won't be Python anymore.

The PEP says the moratorium will last "at least" two years from the
release of 3.1. Given the normal slow pace of new language features,
two years isn't bad -- that's effectively just 3.2. But Guido has
suggested it could last to 3.3. Could it last beyond that? 3.4? Until
some distant future Python-4000?

At the very least, I believe, any moratorium should have a clear end
date. A clear end date will be a powerful counter to the impression
that Python the language is moribund. It says, this is an exceptional
pause, not a permanent halt.




--
Steven D'Aprano
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


steve at pearwood

Nov 7, 2009, 4:16 PM

Post #75 of 94 (1163 views)
Permalink
Re: PEP 3003 - Python Language Moratorium [In reply to]

On Fri, 6 Nov 2009 08:46:00 pm Willem Broekema wrote:

> CLPython is in steady development, quite complete and stable on the
> language level (somewhere between 2.5 and 2.6), but missing most
> built-in library functionality. (It reuses the pure-Python parts of
> the stdlib.)
>
> As its developer, I don't care much about being mentioned in
> discussions or presentations, as CLPython is not as widely used as
> IronPython and Jython. But in a PEP like this, which is directly
> about alternative implementations, it deserves to be mentioned, IMHO.

Willem, the rationale for this PEP is to give alternative
implementations the chance to catch up with CPython.

Given your statement that CLPython is quite complete on the language
level, but missing standard library features, how do you think the
moratorium will help CLPython?



--
Steven D'Aprano
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

First page Previous page 1 2 3 4 Next page Last page  View All Python dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.