##// END OF EJS Templates
Merge pull request #1535 from doerwalter/master...
Merge pull request #1535 from doerwalter/master Fix pretty printing dispatch. This patch fixes a problem mentioned here: http://mail.scipy.org/pipermail/ipython-dev/2012-March/008874.html Search for the best method to use for pretty printing an object now no longer prefers any registered printer in `type_printers` for the class or any of the base classes over a `_repr_pretty_` method defined in the class or any of its base classes. Instead the mro is walked, looking for both registered printers and `_repr_pretty_` methods, so that the inheritance hierarchy will be taken into account.

File last commit:

r6035:3077781f
r6483:81039be0 merge
Show More
helloworld.ipynb
91 lines | 1.8 KiB | text/plain | TextLexer
Brian E. Granger
Converting notebooks to JSON format.
r4634 {
MinRK
regenerate example notebooks to remove transformed output
r5981 "metadata": {
"name": "helloworld"
Brian Granger
Updating example notebooks to v3 format.
r6035 },
"nbformat": 3,
MinRK
regenerate example notebooks to remove transformed output
r5981 "worksheets": [
{
"cells": [
{
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "markdown",
MinRK
regenerate example notebooks to remove transformed output
r5981 "source": [
Brian Granger
Updating example notebooks to v3 format.
r6035 "# Distributed hello world",
"",
MinRK
regenerate example notebooks to remove transformed output
r5981 "Originally by Ken Kinder (ken at kenkinder dom com)"
]
Brian Granger
Updating example notebooks to v3 format.
r6035 },
MinRK
regenerate example notebooks to remove transformed output
r5981 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "code",
"collapsed": true,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
"from IPython.parallel import Client"
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
"language": "python",
"outputs": [],
MinRK
regenerate example notebooks to remove transformed output
r5981 "prompt_number": 1
Brian Granger
Updating example notebooks to v3 format.
r6035 },
MinRK
regenerate example notebooks to remove transformed output
r5981 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "code",
"collapsed": true,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
Brian Granger
Updating example notebooks to v3 format.
r6035 "rc = Client()",
MinRK
regenerate example notebooks to remove transformed output
r5981 "view = rc.load_balanced_view()"
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
"language": "python",
"outputs": [],
MinRK
regenerate example notebooks to remove transformed output
r5981 "prompt_number": 2
Brian Granger
Updating example notebooks to v3 format.
r6035 },
MinRK
regenerate example notebooks to remove transformed output
r5981 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "code",
"collapsed": true,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
Brian Granger
Updating example notebooks to v3 format.
r6035 "def sleep_and_echo(t, msg):",
" import time",
" time.sleep(t)",
MinRK
regenerate example notebooks to remove transformed output
r5981 " return msg"
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
"language": "python",
"outputs": [],
MinRK
regenerate example notebooks to remove transformed output
r5981 "prompt_number": 3
Brian Granger
Updating example notebooks to v3 format.
r6035 },
MinRK
regenerate example notebooks to remove transformed output
r5981 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "code",
"collapsed": true,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
Brian Granger
Updating example notebooks to v3 format.
r6035 "world = view.apply_async(sleep_and_echo, 3, 'World!')",
MinRK
regenerate example notebooks to remove transformed output
r5981 "hello = view.apply_async(sleep_and_echo, 2, 'Hello')"
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
"language": "python",
"outputs": [],
MinRK
regenerate example notebooks to remove transformed output
r5981 "prompt_number": 4
Brian Granger
Updating example notebooks to v3 format.
r6035 },
MinRK
regenerate example notebooks to remove transformed output
r5981 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "code",
"collapsed": false,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
Brian Granger
Updating example notebooks to v3 format.
r6035 "print \"Submitted tasks:\", hello.msg_ids, world.msg_ids",
MinRK
regenerate example notebooks to remove transformed output
r5981 "print hello.get(), world.get()"
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
"language": "python",
MinRK
regenerate example notebooks to remove transformed output
r5981 "outputs": [
{
Brian Granger
Updating example notebooks to v3 format.
r6035 "output_type": "stream",
"stream": "stdout",
MinRK
regenerate example notebooks to remove transformed output
r5981 "text": [
Brian Granger
Updating example notebooks to v3 format.
r6035 "Submitted tasks: ['dd1052e0-aa75-4b25-9d35-ecbdaf6e3ed7'] ['1b46aa21-20d1-459c-bc36-2d8d03336f74']",
MinRK
regenerate example notebooks to remove transformed output
r5981 "Hello"
]
Brian Granger
Updating example notebooks to v3 format.
r6035 },
MinRK
regenerate example notebooks to remove transformed output
r5981 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "output_type": "stream",
"stream": "stdout",
MinRK
regenerate example notebooks to remove transformed output
r5981 "text": [
" World!"
]
}
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
MinRK
regenerate example notebooks to remove transformed output
r5981 "prompt_number": 5
}
]
}
]
Brian E. Granger
Converting notebooks to JSON format.
r4634 }