FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Pratice-Python/operator/operator_typechecking.py at master · socialpercon/Pratice-Python · GitHub
socialpercon
/
Pratice-Python
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
2
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Pratice-Python
/
operator
/
operator_typechecking.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (25 loc) · 621 Bytes
Breadcrumbs
Pratice-Python
/
operator
/
operator_typechecking.py
Copy path
File metadata and controls
31 lines (25 loc) · 621 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""
"""
__version__
=
"$Id$"
#end_pymotw_header
from
operator
import
*
class
NoType
(
object
):
"""Supports none of the type APIs"""
class
MultiType
(
object
):
"""Supports multiple type APIs"""
def
__len__
(
self
):
return
0
def
__getitem__
(
self
,
name
):
return
'mapping'
def
__int__
(
self
):
return
0
o
=
NoType
()
t
=
MultiType
()
for
func
in
(
isMappingType
,
isNumberType
,
isSequenceType
):
print
'%s(o):'
%
func
.
__name__
,
func
(
o
)
print
'%s(t):'
%
func
.
__name__
,
func
(
t
)
Back
|
FazBrowse Home
|
New Git URL