| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Hmm, this is interesting, and I would rather not do this. But actually this solves this example: >>> a = ()
>>> b = ()
>>> a is b
TruePlease add a test snippet for this special case. |
Sorry, something went wrong.
| fn run_module(vm: &VirtualMachine, module: &str) -> PyResult<()> { | ||
| debug!("Running module {}", module); | ||
| vm.import(module, &vm.ctx.new_tuple(vec![]), 0)?; | ||
| vm.import(module, &vm.ctx.empty_tuple(), 0)?; |
There was a problem hiding this comment.
Please do not use this empty tuple directly, and make it a private method on PyContext. I think it is better to call the new_tuple function with an empty vector, so we have one way to create a tuple.
Sorry, something went wrong.
| self.not_implemented.clone().into_object() | ||
| } | ||
|
|
||
| pub fn empty_tuple(&self) -> PyObjectRef { |
There was a problem hiding this comment.
I think this method could be private, or merged into the new_tuple function.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Yeah, not all that big of an optimization, but it seemed dumb to be allocating a new Rc for something that's essentially empty.