A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-July/067485.html below:

[Python-Dev] Dynamic module namspaces

[Python-Dev] Dynamic module namspaces [Python-Dev] Dynamic module namspacesJames Y Knight foom at fuhm.net
Mon Jul 17 06:33:23 CEST 2006
On Jul 15, 2006, at 2:38 PM, Johan Dahlin wrote:
> What I want to ask, is it possible to have a sanctioned way to  
> implement
> a dynamic module/namespace in python?
>
> For instance, it could be implemented to allow you to replace the
> __dict__ attribute in a module with a user provided object which
> implements the dictionary protocol.

I'd like this, as well, although my use case is different: I'd like  
to be able to deprecate attributes in a module. That is, if I have:

foo.py:
SOME_CONSTANT = 5

I'd like to be able to do something such that any time anyone  
accessed foo.SOME_CONSTANT, it'd emit a DeprecationWarning.

James
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4