[Python-Dev] Fixing zipfile.BadZipfile to zipfile.BadZipFile

2010-10-15 Thread Boštjan Mejak
I am very glad you're reorganizing the Standard Library. Thumbs up! I
hope everything will comply to PEP 8 after you're done.

Since you're reorganizing, I have my own contribution. I have attached
a patch. The issue7351 <http://bugs.python.org/issue7351> was not
accepted at the time, so I hope you'll accept this fix now.

My point is that every class name in the module zipfile is like this:
- LargeZipFile
- ZipFile
- PyZipFile
.

.

.

So apply my patch to make the class name BadZipfile consistent to
other class names in the zipfile module and let it be named
BadZipFile. Thank you.



Best regards,

Boštjan Mejak


zipfile-patch.diff
Description: Binary data
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Change to logging Formatters: support for alternative format styles

2010-10-26 Thread Boštjan Mejak
Line 31 (in Pastebin): _STYLE_CODES = tuple("% { $".split())

Is this really necessary? Why not
_STYLE_CODES = ('%', '{', '$')


On Tue, Oct 26, 2010 at 1:15 PM, Nick Coghlan  wrote:

> On Tue, Oct 26, 2010 at 9:08 PM, Nick Coghlan  wrote:
> > On Tue, Oct 26, 2010 at 12:28 AM, Vinay Sajip 
> wrote:
> >> Comments welcome. Assuming there are no strong objections asking for
> reversion
> >> of this change, I'll publicise to the wider community in a few days.
> >
> > It strikes me as a solid, pragmatic solution to a thorny problem.
> >
> > Looking at your checkin though, I wonder if it might be worth
> > implementing some little formatting style classes to get rid of the
> > if/elif chains from the Formatter code. Something like:
>
> Some syntax highlighting may make that wall-o'-code a little easier to
> read: http://pastebin.com/SG0Qr3r5
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
> ___
> Python-Dev mailing list
> Python-Dev@python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/bostjan.mejak%40gmail.com
>
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Fwd: Fixing zipfile.BadZipfile to zipfile.BadZipFile

2010-10-27 Thread Boštjan Mejak
Forwarded conversation
Subject: Fixing zipfile.BadZipfile to zipfile.BadZipFile


From: *Boštjan Mejak* 
Date: Fri, Oct 15, 2010 at 11:02 PM
To: python-dev@python.org


I am very glad you're reorganizing the Standard Library. Thumbs up! I
hope everything will comply to PEP 8 after you're done.

Since you're reorganizing, I have my own contribution. I have attached
a patch. The issue7351 <http://bugs.python.org/issue7351> was not
accepted at the time, so I hope you'll accept this fix now.

My point is that every class name in the module zipfile is like this:
- LargeZipFile
- ZipFile
- PyZipFile
.

.

.

So apply my patch to make the class name BadZipfile consistent to
other class names in the zipfile module and let it be named
BadZipFile. Thank you.



Best regards,

Boštjan Mejak


--
From: *Éric Araujo* 
Date: Sun, Oct 17, 2010 at 11:00 PM
To: python-dev@python.org
Cc: Boštjan Mejak 


Hello

(A bit of context: The original message comes from bug #2775, “Implement
PEP 3108”, a meta-bug tracking stdlib reorganization for py3k.)
You may have missed the timeline: Most of the PEP 3108 changes have been
done before the first 3.x release went out.  Now that we have 3.1 out as
a stable and supported, we cannot reorganize and break compatibility
anymore.

(A note about PEP 8 compliance: Module names have been mostly fixed, but
not all function/method names, for example in logging and unittest.  If
I recall correctly, readability did not seem to make all the rewrites
worth it.)
> a patch. The issue7351 <http://bugs.python.org/issue7351> was not
I’ve just re-read the answers there and they are still valid.

Ezio and me: “Your patch need to include an alias (BadZipfile =
BadZipFile) to preserve compatibility with old pickles, as explains
msg95477.”

Antoine: “I don't think changing it for the sake of aesthetics is a good
deal given that many existing programs will have to be converted to the
new spelling.”

Regards


--
From: *Boštjan Mejak* 
Date: Mon, Oct 18, 2010 at 9:25 AM
To: Éric Araujo 


Shoot. Well, too bad. I thought Python is all about readability, but I think
you developers don't take it very seriously. If I was a developer, I would
certainly go to the trouble of all the rewrittes of
package/module/class/method/function names that do not comply to PEP 8 and
have them done by the time the first sub-version of Python 3 would be
released.

--
From: *Éric Araujo* 
Date: Mon, Oct 18, 2010 at 2:14 PM
To: Boštjan Mejak 


Hi

Could you repost your message to the mailing list, so that other people
can see it and eventually react?  Thanks.

(P.S. please make sure not to top-post on the mailing list)

Regards


--
From: *Éric Araujo* 
Date: Mon, Oct 18, 2010 at 2:45 PM
To: python-dev@python.org


Hello

[Sorry if this comes twice, connection errors here]
> a patch. The issue7351 <http://bugs.python.org/issue7351> was not
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/bostjan.mejak%40gmail.com

--
From: *Nick Coghlan* 
Date: Mon, Oct 18, 2010 at 3:13 PM
To: Éric Araujo 
Cc: python-dev@python.org


Correct. We went through this for one module that I recall (threading)
and that was annoying enough that we mostly left things alone after
that unless they were truly obnoxious.

For threading we were able to clean a lot of things up in the process
(such as adding properties where appropriate), but even so, we still
made sure all the old names continued to work.

Cheers,
Nick.

--
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia

--
From: *Boštjan Mejak* 
Date: Mon, Oct 18, 2010 at 4:36 PM
To: Nick Coghlan 


Then please make an alias for this custom BadZipfile exception class.
Add  BadZipfile = BadZipFile  in the zipfile module.


--
From: *Boštjan Mejak* 
Date: Tue, Oct 19, 2010 at 10:34 PM
To: Nick Coghlan 


Sorry, let me correct myself:
 Add  BadZipFile = BadZipfile in the zipfile module.

Please add the above assignment statement in the right place to the zipfile
module and create an alias. Thank you.

--
From: *Boštjan Mejak* 
Date: Wed, Oct 20, 2010 at 11:13 PM
To: Nick Coghlan 


Ah, leave it as is. If in the future you will be able to rename BadZipfile
to BadZipFile, please do.

--
From: *Éric Araujo* 
Date: Wed, Oct 27, 2010 at 6:26 PM
To: python-dev 
Cc: Boštjan Mejak 


[Reply received off-list quoted here]

Le 18/10/2010 09:25, Boštjan Mejak a écrit :
Readability has to be balanced with other important things:
maintainability, discoverability, compatibility, rapidity and other
things ending in -ity.  I’m personally glad that readability gets a huge
place in the language definition itself (no braces, standard
indentation), I follow 98 % of PEP 8 where I can, and have learned to
accept tha

Re: [Python-Dev] Fixing zipfile.BadZipfile to zipfile.BadZipFile

2010-10-29 Thread Boštjan Mejak
The tests prove that r85874 does not break the build.

On Fri, Oct 29, 2010 at 12:49 AM, Éric Araujo  wrote:

> Le 28/10/2010 22:52, anatoly techtonik a écrit :
> > Can anybody summarize the outcome?
> > Is it that renaming BadZipfile to BadZipFile with backward compatible
> > alias and deprecation note breaks something?
>
> See #7351 or r85874.
>
> Regards
>
> ___
> Python-Dev mailing list
> Python-Dev@python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/bostjan.mejak%40gmail.com
>
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com