如何阻止在拿破仑生成的文档中实例化的可选参数

时间:2016-07-14 12:57:22

标签: python-sphinx

我有以下类定义:

class AdmInterface:
    def __init__(self, user=my_credentials['User'], 
                 password=my_credentials['Pass'], 
                 host=my_host):
        '''
        Args:
            user : string username to connect to database with (default to my_credentials)
            password : string password to connect with (default to my_credentials)
            host : address of the database to connect to
        '''
        self.conn = None
        self.host = host
        self.user = user
        self.password = password
        return

请注意,在代码中,我的默认用户/密码值是从文件中读取的变量。

在启用了拿破仑/ autodoc的sphinx生成的HTML文档中,类定义如下所示:

class adm_interface.AdmInterface(user ='myactualusername',password ='myactualpassword',host ='myactualdatabase')

有没有办法让原始变量名称而不是我的机器上的特定实例显示在文档中?

0 个答案:

没有答案