Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0e449234
Commit
0e449234
authored
Jan 30, 2003
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SF patch 672098: Three __contains__ implementations
Contributed by Jp Calderone.
parent
61bb35f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
Lib/lib-tk/Canvas.py
Lib/lib-tk/Canvas.py
+2
-0
Lib/plat-riscos/riscosenviron.py
Lib/plat-riscos/riscosenviron.py
+2
-0
Lib/xml/sax/xmlreader.py
Lib/xml/sax/xmlreader.py
+3
-0
No files found.
Lib/lib-tk/Canvas.py
View file @
0e449234
...
...
@@ -39,6 +39,8 @@ class CanvasItem:
return
self
.
_keys
def
has_key
(
self
,
key
):
return
key
in
self
.
keys
()
def
__contains__
(
self
,
key
):
return
key
in
self
.
keys
()
def
addtag
(
self
,
tag
,
option
=
'withtag'
):
self
.
canvas
.
addtag
(
tag
,
option
,
self
.
id
)
def
bbox
(
self
):
...
...
Lib/plat-riscos/riscosenviron.py
View file @
0e449234
...
...
@@ -32,6 +32,8 @@ class _Environ:
def
has_key
(
self
,
key
):
value
=
riscos
.
getenv
(
key
)
return
value
<>
None
def
__contains__
(
self
,
key
):
return
riscos
.
getenv
(
key
)
is
not
None
def
update
(
self
,
dict
):
for
k
,
v
in
dict
.
items
():
riscos
.
putenv
(
k
,
v
)
...
...
Lib/xml/sax/xmlreader.py
View file @
0e449234
...
...
@@ -321,6 +321,9 @@ class AttributesImpl:
def
has_key
(
self
,
name
):
return
self
.
_attrs
.
has_key
(
name
)
def
__contains__
(
self
,
name
):
return
self
.
_attrs
.
has_key
(
name
)
def
get
(
self
,
name
,
alternative
=
None
):
return
self
.
_attrs
.
get
(
name
,
alternative
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment