##// END OF EJS Templates
rust-pyo3: simplified API to get core Index references...
rust-pyo3: simplified API to get core Index references Given the amount of conversion and arcane internal detail, it is easier for the caller and makes a better separation of concerns to just introduce a new unsafe helper. It is actually possible that it would be safe, and we can decide about that later. Actually the reason given in the `cpython` crate for unsafety of the `try_borrow()` method is the following: ``` // try_borrow() and try_borrow_mut() are unsafe because self.data may // have a function returning the inner &'static reference. // If T is &'static U, its lifetime can be easily coerced to &'a U, but // how could we do that for Whatever<'static> in general? ``` Given that we coerce the Index reference to the GIL lifetime and that it is unlikely that the inner data would contain a function returning the a `'static` reference, it is possible that it is actually even safe.
Georges Racinet -
r53311:23370710 default
Show More
Name Size Modified Last Commit Author
/ mercurial / hgweb
__init__.py Loading ...
common.py Loading ...
hgweb_mod.py Loading ...
hgwebdir_mod.py Loading ...
request.py Loading ...
server.py Loading ...
webcommands.py Loading ...
webutil.py Loading ...
wsgicgi.py Loading ...
wsgiheaders.py Loading ...