New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
str(tick library) fails in IPython #49
Comments
I think something like
is missing... |
Merged
Full code to reproduce problem is: In [1]: from arctic import Arctic
In [2]: store = Arctic('localhost')
In [3]: store.initialize_library('library_name', 'TickStoreV3')
In [4]: store['library_name']
Out[4]: ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
//anaconda/envs/py27/lib/python2.7/site-packages/IPython/core/formatters.pyc in __call__(self, obj)
695 type_pprinters=self.type_printers,
696 deferred_pprinters=self.deferred_printers)
--> 697 printer.pretty(obj)
698 printer.flush()
699 return stream.getvalue()
//anaconda/envs/py27/lib/python2.7/site-packages/IPython/lib/pretty.pyc in pretty(self, obj)
381 if callable(meth):
382 return meth(obj, self, cycle)
--> 383 return _default_pprint(obj, self, cycle)
384 finally:
385 self.end_group()
//anaconda/envs/py27/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _default_pprint(obj, p, cycle)
501 if _safe_getattr(klass, '__repr__', None) not in _baseclass_reprs:
502 # A user-provided repr. Find newlines and replace them with p.break_()
--> 503 _repr_pprint(obj, p, cycle)
504 return
505 p.begin_group(1, '<')
//anaconda/envs/py27/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle)
683 """A pprint that just redirects to the normal repr function."""
684 # Find newlines and replace them with p.break_()
--> 685 output = repr(obj)
686 for idx,output_line in enumerate(output.splitlines()):
687 if idx:
//anaconda/envs/py27/lib/python2.7/site-packages/arctic/tickstore/tickstore.pyc in __repr__(self)
107
108 def __repr__(self):
--> 109 return str(self)
110
111 def delete(self, symbol, date_range=None):
//anaconda/envs/py27/lib/python2.7/site-packages/arctic/tickstore/tickstore.pyc in __str__(self)
104 def __str__(self):
105 return """<%s at %s>
--> 106 %s""" % (self.__class__.__name__, hex(id(self)), indent(str(self._arctic_lib), 4))
107
108 def __repr__(self):
NameError: global name 'indent' is not defined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When stringifying a library object, it blows up in IPython:
The text was updated successfully, but these errors were encountered: