[Python-ideas] working on a PEP for the __preview__ package

Devin Jeanpierre jeanpierreda at gmail.com
Wed Jan 4 12:49:11 CET 2012


> A correct way IMO would be to introduce a versioned exp27, exp271 packages:

+2. Rather than silently introducing subtle semantics changes,
wouldn't it be better for older imports to fail with an ImportError?
Since this is just for toying around, this shouldn't break any play,
but it _should_ discourage (very strongly) people using experimental
stuff in their published code.

Perhaps a dunder name like __preview32__ ? __preview__._32 ?

> 1. It makes it explicitly clear when imported package version was considered
> experimental

I agree with this too. It's a good benefit.

> 2. It allows to switch between multiple experimental package versions
> 3. It will provide future compatibility if a package released from `exp`
> breaks API

Less sold on these. This isn't the purpose of __preview__ as I
understand it, and including every revision of every __preview__
package could increase Python's size very dramatically over time.

-- Devin

On Wed, Jan 4, 2012 at 5:45 AM, anatoly techtonik <techtonik at gmail.com> wrote:
> On Wed, Jan 4, 2012 at 4:29 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>>
>> On Wed, Jan 4, 2012 at 3:29 AM, Antoine Pitrou <solipsis at pitrou.net>
>> wrote:
>> > On Tue, 03 Jan 2012 16:27:35 +0000
>> > Robert Kern <robert.kern at gmail.com> wrote:
>> >> The nice thing about the dunders is that no one will make a module with
>> >> a
>> >> conflicting name. That's really the common factor behind all uses of
>> >> dunders:
>> >> reserving a name for Python's use. Whether something is a protocol or
>> >> bag of
>> >> switches doesn't really enter into it.
>> >
>> > Plus, writing "from __preview__ import regex" looks cooler than
>> > "from exp import regex".
>>
>> Dunder names also alert people that something special is going on (in
>> this case, it helps alert them to the fact that the modules in this
>> namespace *will* be moved in the future).
>
>
> I am afraid that dunders will become a standard thing in many Python
> packages, because of everybody's natural desire to use latest features that
> work right. That means that new people to Python will have to deal with
> Python magic right from the start, which will make language more complicated
> for them.
>
> A correct way IMO would be to introduce a versioned exp27, exp271 packages:
> 1. It makes it explicitly clear when imported package version was considered
> experimental
> 2. It allows to switch between multiple experimental package versions
> 3. It will provide future compatibility if a package released from `exp`
> breaks API
> 5. as a sum of 2+3 above - it provides a development process and extends
> time to stabilize API with public testing and feedback before freezing the
> package to die in stdlib
>
> --
> anatoly t.
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



More information about the Python-ideas mailing list