[Twisted-Python] jelly and instances

Glyph glyph at twistedmatrix.com
Wed Sep 10 01:18:09 MDT 2014


On Sep 9, 2014, at 7:50 PM, Wolfgang Rohdewald <wolfgang.kde at rohdewald.de> wrote:

> doc says:
> 
> Instance: s is an instance of UserString.UserString, with a __dict__
> {'data': 'hello'}::
>    [\"UserString.UserString\", ['dictionary', ['data', 'hello']]]
> 
> There is no test for instances. To be precise, no test ever enters
> jelly._unjelly_instance()
> 
> I also cannot find any place in jelly.py where an Instance would
> be jellied. There is
> 
> instance_atom = 'instance'
> 
> but instance_atom is not used anywhere.
> 
> Is this outdated code? If not, could you please give me a code
> example using this?

PB was developed during a period of far less rigorous development practices for Twisted.  Particularly, we didn't do test-driven development.

It's quite possible that this code was never used.

Most likely I looked at the Python type system when originally developing PB and thought that I'd want to jelly types.InstanceType, then thought the better of it because types should be types and InstanceType was a wart (which python-dev apparently agreed with since it is gone from the new-style object model).

I imagine the thing to do with this is simply deprecate->remove, if it's already unused.  It's certainly not something we'd want to resurrect.

Thanks,

-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20140910/04ad6eaf/attachment-0002.html>


More information about the Twisted-Python mailing list