python BaseManager中register()的描述
register(typeid[, callable[, proxytype[, exposed[, method_to_typeid[, create_method]]]]])
A classmethod which can be used for registering a type or callable with the manager class.
typeid is a “type identifier” which is used to identify a particular type of shared object. This must be a string.
callable is a callable used for creating objects for this type identifier. If a manager instance will be created using the from_address() classmethod or if the create_method argument is False then this can be left as None.
proxytype is a subclass of BaseProxy which is used to create proxies for shared objects with this typeid. If None then a proxy class is created automatically.
exposed is used to specify a sequence of method names which proxies for this typeid should be allowed to access using BaseProxy._callmethod(). (If exposed is None then proxytype._exposed_ is used instead if it exists.) In the case where no exposed list is specified, all “public methods” of the shared object will be accessible. (Here a “public method” means any attribute which has a __call__() method and whose name does not begin with '_'.)
method_to_typeid is a mapping used to specify the return type of those exposed methods which should return a proxy. It maps method names to typeid strings. (If method_to_typeid is None then proxytype._method_to_typeid_ is used instead if it exists.) If a method’s name is not a key of this mapping or if the mapping is None then the object returned by the method will be copied by value.
create_method determines whether a method should be created with name typeid which can be used to tell the server process to create a new shared object and return a proxy for it. By default it is True.
python BaseManager中register()的描述的更多相关文章
- Python虚拟机中的一般表达式(三)
其他一般表达式 在前两章:Python虚拟机中的一般表达式(一).Python虚拟机中的一般表达式(二)中,我们介绍了Python虚拟机是怎样执行创建一个整数值对象.字符串对象.字典对象和列表对象.现 ...
- python语言中的编码问题(续)
上文提到了python开发中非常重要的两处设置. 一个是编解码器的默认设置defaultencoding >>> import sys >>> sys.getdef ...
- 在Python应用中使用MongoDB
Python是开发社区中用于许多不同类型应用的强大编程语言.很多人都知道它是可以处理几乎任何任务的灵活语言.因此,在Python应用中需要一个什么样的与语言本身一样灵活的数据库呢?那就是NoSQL,比 ...
- python虚拟机中的异常流控制
异常:对程序运行中的非正常情况进行抽象.并且提供相应的语法结构和语义元素,使得程序员能够通过这些语法结构和语义元素来方便地描述异常发生时的行为. 1.Python中的异常机制: 1.1Python虚拟 ...
- Python 3 中的json模块使用
1. 概述 JSON (JavaScript Object Notation)是一种使用广泛的轻量数据格式. Python标准库中的json模块提供了JSON数据的处理功能. Python中一种非常常 ...
- python内置函数详细描述与实例演示
python有许多内置函数,列出表格如下 内置函数 abs() delattr() hash() memoryview() set() all() dict() help() min() setatt ...
- 【转载】路径双反斜杠!!!Python IDLE或Python shell中切换路径 切换目录os.chdir("C:\\python37\\2019pythonshel37\\diedai")
Python IDLE或shell中切换路径在Python自带的编辑器IDLE中或者python shell中不能使用cd命令,那么跳到目标路径呢.方法是使用os包下的相关函数实现路径切换功能. im ...
- Python编程中 re正则表达式模块 介绍与使用教程
Python编程中 re正则表达式模块 介绍与使用教程 一.前言: 这篇文章是因为昨天写了一篇 shell script 的文章,在文章中俺大量调用多媒体素材与网址引用.这样就会有一个问题就是:随着俺 ...
- python基础19 -------面向对象终结篇(介绍python对象中各种内置命令)
一.isinstance()和issubclass()命令 1.isinstance(对象,类型) 用来判定该对象是不是此类型或者说是该对象是不是此类的对象,返回结果为True和False,如图所示. ...
随机推荐
- Yii2:记一次尴尬的bug
创建一个文章模块,写完添加动作之后,分配到视图,发现报错: Exception (Not Supported) 'yii\base\NotSupportedException' with messag ...
- 一、hadoop单节点安装测试
一.hadoop简介 相信你或多或少都听过hadoop这个名字,hadoop是一个开源的.分布式软件平台.它主要解决了分布式存储(hdfs)和分布式计算(mapReduce)两个大数据的痛点问题,在h ...
- Java数组声明与拷贝的几种方式
Java数组声明的三种方式 第一种(声明并初始化): 数据类型[] 数组名={值,值,...}; 例:int[] a = {1,2,3,4,5,6,7,8}; ...
- 第一天-python基础
每一个今天的坚持都会改变明天的自己! 一.python介绍 python是一门由解释型.弱类型的高级开发编程语言,由龟叔于1989圣诞开发出,后经过二十多年的发展,因其简洁高效的特点而被广泛使用,在世 ...
- jQuery自适应-3D旋转轮播图
3D旋转轮播图 本例源于(站长之家实例http://sc.chinaz.com/jiaoben/170215391070.htm) 其他相似示例(https://www.cnblogs.com/inc ...
- The memory graph Shared by the method
Phone类 package com.itheima_03; /* * 手机类 */ public class Phone { String brand; int price; String colo ...
- Python爬虫教程-01-爬虫介绍
Spider-01-爬虫介绍 Python 爬虫的知识量不是特别大,但是需要不停和网页打交道,每个网页情况都有所差异,所以对应变能力有些要求 爬虫准备工作 参考资料 精通Python爬虫框架Scrap ...
- OpenStack 学习笔记 (三)
个人网站:臭蛋www.choudan.net 一直苦于不知道如何加入到开源社区参与开发,感受开源社区分布式协作开发和巨神们coding的魅力,特意在网上查了资料,直接指导的很少,还得的靠官网上的文档. ...
- MooseFS安装部署
环境信息 Master服务器 dev04 chunkserver服务器 dev02.dev03.dev04 metalogger服务器 dev03 mount客户端 dev01.dev02 安装前下载 ...
- Spring Boot框架搭建
用idea搭建Springboot还是很方便的 环境变量是JDK1.8 SpringBoot自带了Tomcat启动也很方便 1.创建项目 2. 3.选择SpringBoot的版本以及组件 4.创建完成 ...