3

var = Instance(object)?

3
  • 2
    Since it's not part of the standard library, we can only guess. Where did you see this code? Please provide a reference or a link to the place where you saw this code. Commented Aug 21, 2010 at 20:02
  • Perhaps s/he meant isinstance? Commented Aug 21, 2010 at 21:29
  • 1
    @elo80ka: Unlikely: the question's syntax isn't close to isinstance at all. Commented Aug 21, 2010 at 21:54

2 Answers 2

4

It calls the __call__() method.

Sign up to request clarification or add additional context in comments.

Comments

0

Actually, I thought it was from the standard library. On inspection, it is from enthought.traits.api.Instance. It holds a reference to an object instance. If you pass a specific class to the constructor (e.g. Instance(MyClass) ), it does validation to make sure you pass the correct class.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.