Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dateutil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
dateutil
Commits
86bf652555ee
Commit
86bf652555ee
authored
7 years ago
by
Paul Ganssle
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Convert the factories to use a WeakValueDictionary"
This reverts commit 873c5971ebfdf3a10a81d192a6b095064bd7c01b.
parent
7c16a4a3ce30
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
dateutil/tz/_factories.py
+3
-3
3 additions, 3 deletions
dateutil/tz/_factories.py
dateutil/tz/tz.py
+1
-2
1 addition, 2 deletions
dateutil/tz/tz.py
with
4 additions
and
5 deletions
dateutil/tz/_factories.py
+
3
−
3
View file @
86bf6525
from
datetime
import
timedelta
import
weakref
class
_TzSingleton
(
type
):
def
__init__
(
cls
,
*
args
,
**
kwargs
):
...
...
@@ -19,7 +19,7 @@
class
_TzOffsetFactory
(
_TzFactory
):
def
__init__
(
cls
,
*
args
,
**
kwargs
):
cls
.
__instances
=
weakref
.
WeakValueDictionary
()
cls
.
__instances
=
{}
def
__call__
(
cls
,
name
,
offset
):
if
isinstance
(
offset
,
timedelta
):
...
...
@@ -36,7 +36,7 @@
class
_TzStrFactory
(
_TzFactory
):
def
__init__
(
cls
,
*
args
,
**
kwargs
):
cls
.
__instances
=
weakref
.
WeakValueDictionary
()
cls
.
__instances
=
{}
def
__call__
(
cls
,
s
,
posix_offset
=
False
):
key
=
(
s
,
posix_offset
)
...
...
This diff is collapsed.
Click to expand it.
dateutil/tz/tz.py
+
1
−
2
View file @
86bf6525
...
...
@@ -13,7 +13,6 @@
import
sys
import
os
import
bisect
import
weakref
import
six
from
six
import
string_types
...
...
@@ -1529,7 +1528,7 @@
"""
def
__init__
(
self
):
self
.
__instances
=
weakref
.
WeakValueDictionary
()
self
.
__instances
=
{}
self
.
_cache_lock
=
_thread
.
allocate_lock
()
def
__call__
(
self
,
name
=
None
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment