[Python-Dev] cpython: simplify and rewrite the zipimport part of 702009f3c0b1 a bit

Georg Brandl g.brandl at gmx.net
Fri May 25 18:57:57 CEST 2012


Am 25.05.2012 07:54, schrieb benjamin.peterson:
> http://hg.python.org/cpython/rev/a47d32a28662
> changeset:   77129:a47d32a28662
> user:        Benjamin Peterson <benjamin at python.org>
> date:        Thu May 24 22:54:15 2012 -0700
> summary:
>   simplify and rewrite the zipimport part of 702009f3c0b1 a bit
> 
> files:
>   Modules/zipimport.c |  92 ++++++++++++++------------------
>   1 files changed, 41 insertions(+), 51 deletions(-)
> 
> 
> diff --git a/Modules/zipimport.c b/Modules/zipimport.c
> --- a/Modules/zipimport.c
> +++ b/Modules/zipimport.c
> @@ -319,13 +319,20 @@
>      return MI_NOT_FOUND;
>  }
>  
> +typedef enum {
> +    fl_error,
> +    fl_not_found,
> +    fl_module_found,
> +    fl_ns_found
> +} find_loader_result;

This is probably minor, but wouldn't it make more sense to have those
constants uppercased?  At least that's the general style we have in
the codebase for enum values.

(There's one exception, but also recently committed, in posixmodule.c
for the utime_result enum.  Maybe that could also be fixed.)

Georg



More information about the Python-Dev mailing list