Skip to content

Commit

Permalink
Tests and implementation for type(some class). (Which returns type)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhalter committed Jul 1, 2015
1 parent 3ac8f02 commit f2cc320
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jedi/evaluate/representation.py
Expand Up @@ -445,6 +445,9 @@ def py__call__(self, evaluator, params):
def py__getattribute__(self, name):
return self._evaluator.find_types(self, name)

def py__class__(self, evaluator):
return compiled.builtin.get_by_name('type')

@property
def params(self):
return self.get_subscope_by_name('__init__').params
Expand Down
3 changes: 3 additions & 0 deletions test/completion/stdlib.py
Expand Up @@ -61,6 +61,9 @@ def x():
import os
#? type(os)
type(math)
class X(): pass
#? type
type(X)

# -----------------
# re
Expand Down

0 comments on commit f2cc320

Please sign in to comment.