Skip to content

Commit e662c37

Browse files
committed
-
1 parent 1f73be4 commit e662c37

File tree

9 files changed

+10
-16
lines changed

9 files changed

+10
-16
lines changed

docs/topics/caching/cached_type.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ preventing more than one of them from being created:
1919

2020
>>> from python_toolbox import caching
2121
>>>
22-
>>> class A(object):
23-
... __metaclass__ = caching.CachedType
22+
>>> class A(metaclass=caching.CachedType):
2423
... def __init__(self, a=1, b=2):
2524
... self.a = a
2625
... self.b = b

source_py3/python_toolbox/wx_tools/event_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ def navigate_from_key_event(key_event):
5858
return False
5959

6060

61-
class ObjectWithId(object):
61+
class ObjectWithId:
6262
Id = caching.CachedProperty(lambda object: wx.NewId())

source_py3/python_toolbox/wx_tools/keyboard/key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import wx
55

66

7-
class Key(object):
7+
class Key:
88
'''A key combination.'''
99

1010
def __init__(self, key_code, cmd=False, alt=False, shift=False):

source_py3/python_toolbox/wx_tools/timing/cute_base_timer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This program is distributed under the MIT license.
33

44

5-
class CuteBaseTimer(object):
5+
class CuteBaseTimer:
66
'''A base class for timers, allowing easy central stopping.'''
77
__timers = [] # todo: change to weakref list
88

source_py3/python_toolbox/wx_tools/widgets/cute_dialog.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from .cute_dialog_type import CuteDialogType
1414

1515

16-
class CuteDialog(wx.Dialog, CuteTopLevelWindow):
16+
class CuteDialog(wx.Dialog, CuteTopLevelWindow, metaclass=CuteDialogType):
1717
'''
1818
An improved `wx.Dialog`.
1919
@@ -27,8 +27,6 @@ class CuteDialog(wx.Dialog, CuteTopLevelWindow):
2727
2828
'''
2929

30-
__metaclass__ = CuteDialogType
31-
3230

3331
def __init__(self, *args, **kwargs):
3432
if not kwargs.pop('skip_wx_init', False):

source_py3/python_toolbox/wx_tools/widgets/cute_window/bind_savvy_evt_handler/bind_savvy_evt_handler.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from . import name_parser
1111

1212

13-
class BindSavvyEvtHandler(wx.EvtHandler):
13+
class BindSavvyEvtHandler(wx.EvtHandler, metaclass=BindSavvyEvtHandlerType):
1414
'''
1515
Event handler type that allows binding events automatically by method name.
1616
@@ -20,8 +20,6 @@ class BindSavvyEvtHandler(wx.EvtHandler):
2020
of `BindSavvyEvtHandlerType`'s methods and attributes for more details.
2121
'''
2222

23-
__metaclass__ = BindSavvyEvtHandlerType
24-
2523

2624
_BindSavvyEvtHandlerType__name_parser = name_parser.NameParser(
2725
(name_parser.LowerCase,),

source_py3/python_toolbox/wx_tools/widgets/cute_window/bind_savvy_evt_handler/name_parser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ class CaseStyleType(abc.ABCMeta):
2121
'''
2222

2323

24-
class BaseCaseStyle(object):
24+
class BaseCaseStyle(metaclass=CaseStyleType):
2525
'''Base class for case styles.'''
26-
__metaclass__ = CaseStyleType
2726

2827
@abc_tools.AbstractStaticMethod
2928
def parse(name):
@@ -74,7 +73,7 @@ def parse(name):
7473
return words
7574

7675

77-
class NameParser(object):
76+
class NameParser:
7877
'''
7978
Parser that parses an event handler name.
8079

source_py3/python_toolbox/wx_tools/widgets/knob/snap_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'''
2020

2121

22-
class SnapMap(object):
22+
class SnapMap:
2323
'''
2424
Map for deciding which angle the knob will have when mouse-dragging.
2525

source_py3/python_toolbox/wx_tools/window_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def thaw_handler(self):
2323
self.window.Thaw()
2424

2525

26-
class FlagRaiser(object): # todo: rename?
26+
class FlagRaiser: # todo: rename?
2727
'''When called, raises a flag of a window and then calls some function.'''
2828
def __init__(self, window, attribute_name=None, function=None, delay=None):
2929
'''

0 commit comments

Comments
 (0)