2017-02-07 4 views
3

Pythonには、dir()__builtin__の組み込みオブジェクトのリストがあります。JuliaのPythonのdir(オブジェクト)と__builtin__相当

>>> dir(__builtins__) 
['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BufferError', 'BytesWarning', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 'False', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', 'None', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', 'StandardError', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning', 'ZeroDivisionError', '_', '__debug__', '__doc__', '__import__', '__name__', '__package__', 'abs', 'all', 'any', 'apply', 'basestring', 'bin', 'bool', 'buffer', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'cmp', 'coerce', 'compile', 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile', 'exit', 'file', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'intern', 'isinstance', 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'long', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode', 'vars', 'xrange', 'zip'] 

ジュリア内のオブジェクトを調べることができますdir()機能はありますか?

ジュリアには__builtin__のオブジェクトのリストもありますか?

+0

私はこのためにマクロを使用しています。それは私が[ここ](http://codereview.stackexchange.com/questions/138246/saving-the-values-of-all-variabled-declared-in-a-block)を投稿したものに基づいています。 静かではありません。たとえば、ネストされたスコープは無視されます。 私はそれを修正して、ある時点でパッケージとしてリリースするかもしれません –

答えて

4

粗い同等物は、次のとおり

  • names:(必要に応じて第二引数trueと非エクスポート名を返す)モジュール内のバインディングを返します。

  • fieldnames:オブジェクトフィールド名を返します。

もジュリアで組み込みオブジェクトのリストはありますか?

names(Base)およびnames(Core)で始まります。