예제 #1
0
	async def _aname(self):
		warnloop(logger)
		assert inloop()
		if self._name is Undefined:
			return await self.unseeded_base_object._aname
		else:
			assert self._name is not Undefined
			return self.name
예제 #2
0
	async def _args_str(self):
		warnloop(logger)
		assert inloop()
		ret = []
		async with finish() as f:
			for x in (f.future(arg) for arg in self.args):
				ret.append(arg)
		return str([x.result() for x in ret])
예제 #3
0
	async def __ainit__(self, unseeded_base_object: 'UnseededFunction', args: tuple = Undefined, **kwargs) -> None:
		warnloop(logger)
		assert inloop()
		if __debug__:
			from .unseeded_function import UnseededFunction
			assert isinstance(unseeded_base_object, UnseededFunction), '{}, type {}'.format(unseeded_base_object, type(unseeded_base_object))
		async with finish() as f:
			f.future(super().__ainit__(**kwargs))
			f.future(self.__asetattr__('unseeded_base_object', unseeded_base_object))
			f.future(self.__asetattr__('args', args))
		assert hasattr(self, 'unseeded_base_object')
		assert hasattr(self, 'args')
예제 #4
0
	def get_vars(self):
		warnloop(logger) #idk if this is necessary
		assert inloop() #idk if this is necessary
		ret = []
		for arg in self.args:
			if isinstance(arg, SeededFunction):
				logger.debug('Append get_vars from SeededFunction at 0x{:0x}'.format(id(arg)))
					# cause cant call str cause might be in loop
				ret += arg.get_vars()
			elif isinstance(arg, Variable):
				logger.debug('Append get_vars from Variable at 0x{:0x}'.format(id(arg)))
					# cause cant call str cause might be in loop
				ret.append(arg)
		return ret
예제 #5
0
 async def _aderiv(self, du: 'Variable') -> (0, 1):
     warnloop(logger)
     assert inloop()
     return await self.scrub(int(not await self._aisconst(du)))
예제 #6
0
 async def _aisconst(self, du: 'Variable') -> bool:
     warnloop(logger)
     assert inloop()
     return self is not du and self.name != du.name