anomaly

zipher dreamingforward at gmail.com
Tue May 12 11:34:14 EDT 2015


On Tuesday, May 12, 2015 at 8:56:32 AM UTC-5, Steven D'Aprano wrote:
> The consensus among the core developers is:
> * in general, the harm and inconvenience from accidentally
>   shadowing built-ins is not great, and it usually easy to
>   spot, debug and prevent;

Where is that the consensus?  Please cite examples.

> * when it comes to built-in functions (e.g. sum, map, pow)
>   and types (e.g. int, str, list) there are significant and
>   important use-cases for allowing shadowing;

Name one "significant and important" use case for shadowing built-in types.  Functions, I don't have a problem with, but types are more fundamental than functions.

> The general principle here is of consenting adults: Python allows you to
> shadow built-ins because sometimes it is useful, and the good outweighs the
> potential harm. 

I think you'll have to give examples, either from the developer community or some significant use cases to be believable.

Mark



More information about the Python-list mailing list