-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathellipsis.go
47 lines (37 loc) · 1008 Bytes
/
ellipsis.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2018 The go-python Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Ellipsis objects
package py
type EllipsisType struct{}
var (
EllipsisTypeType = NewType("EllipsisType", "")
Ellipsis = EllipsisType(struct{}{})
)
// Type of this object
func (s EllipsisType) Type() *Type {
return EllipsisTypeType
}
func (a EllipsisType) M__bool__() (Object, error) {
return False, nil
}
func (a EllipsisType) M__repr__() (Object, error) {
return String("Ellipsis"), nil
}
func (a EllipsisType) M__eq__(other Object) (Object, error) {
if _, ok := other.(EllipsisType); ok {
return True, nil
}
return False, nil
}
func (a EllipsisType) M__ne__(other Object) (Object, error) {
if _, ok := other.(EllipsisType); ok {
return False, nil
}
return True, nil
}
// Check interface is satisfied
var _ I__bool__ = Ellipsis
var _ I__repr__ = Ellipsis
var _ I__eq__ = Ellipsis
var _ I__eq__ = Ellipsis