ipython/ipython — pull request #4827 by immerrr (2014-01-18 11:22:07+00:00)
Title: Print sources for property fget/fset/fdel methods

This is a work-in-progress fixing issue #1555 which has been bugging me for quite a while. Here's what it is capable of now:

```python

In [1]: def foo(x): return id(x)

In [2]: p = property(foo, lambda x,val: None, id)

In [3]: p?
Type: property
String Form:
File: /home/immerrr/sources/
Docstring:

In [4]: p??
Type: property
String Form:
File: /home/immerrr/sources/
Getter: def foo(x): return id(x)

Setter: p = property(foo, lambda x,val: None, id)

Deleter:

In [5]: class Foo(object):
...: @property
...: def bar(self):
...: return None
...:

In [6]: f = Foo()

In [7]: f.bar?
Type: property
String Form:
File: /home/immerrr/sources/
Docstring:

In [8]: f.bar??
Type: property
String Form:
File: /home/immerrr/sources/
Getter:
@property
def bar(self):
return None

```

Admittedly, this is not perfect, so ideas about what's missing are welcome. What I think is missing:
- [ ] tests (didn't look how testing is done in IPython, nor do I have an idea how to test this properly)
- [ ] get rid of newlines that still appear after one-liner source snippets
- [ ] stop invoking property getter when querying as it may cause unintended side-effects and/or raise an error rendering the property inaccessible