source: orange/Orange/testing/regression/tests_20/reference_cb-mydomain.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 497 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

Line 
1# Description: Shows an example of an Orange class that cannot be subtyped in Python
2# Category:    callbacks to Python
3# Classes:     Domain
4# Uses:        lenses
5# Referenced:  callbacks.htm
6
7import orange, orngTree, orngMisc
8tab = orange.ExampleTable(r"lenses.tab")
9
10
11class MyDomain(orange.Domain):
12    def __call__(self, ex):
13        ex2 = orange.Domain.__call__(self, ex)
14        ex2.setclass("?")
15        return ex2
16
17md = MyDomain(tab.domain)
18ce1 = orange.Example(md, tab[0])
19ce2 = md(tab[0])
20print ce1
21print ce2
Note: See TracBrowser for help on using the repository browser.