Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Pythonwin/Scintilla/win32/DepGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def Generate():

# Create the dependencies file for g++
deps = Dependencies.FindDependencies(
["../win32/*.cxx"] + sources, ["../win32"] + includes, ".o", "../win32/"
["../win32/*.cxx", *sources], ["../win32", *includes], ".o", "../win32/"
)

# Add ScintillaBaseL as the same as ScintillaBase
Expand Down
2 changes: 1 addition & 1 deletion Pythonwin/pywin/Demos/ocx/ocxserialtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def OnComm(self):

class TestSerDialog(dialog.Dialog):
def __init__(self, *args):
dialog.Dialog.__init__(*(self,) + args)
dialog.Dialog.__init__(self, *args)
self.olectl = None

def OnComm(self):
Expand Down
2 changes: 1 addition & 1 deletion Pythonwin/pywin/docking/DockingBar.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def CreateWindow(
self._obj_.CreateWindow(wndClass, title, style, (0, 0, 0, 0), parent, id)

# Create the child dialog
self.dialog = childCreator(*(self,) + childCreatorArgs)
self.dialog = childCreator(self, *childCreatorArgs)

# use the dialog dimensions as default base dimensions
assert self.dialog.IsWindow(), (
Expand Down
5 changes: 3 additions & 2 deletions Pythonwin/pywin/framework/editor/color/coloreditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,9 @@ def GetPythonPropertyPages(self):
"""Returns a list of property pages"""
from pywin.scintilla import configui

return EditorTemplateBase.GetPythonPropertyPages(self) + [
configui.ScintillaFormatPropertyPage()
return [
*EditorTemplateBase.GetPythonPropertyPages(self),
configui.ScintillaFormatPropertyPage(),
]


Expand Down
2 changes: 1 addition & 1 deletion Pythonwin/pywin/framework/interact.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def ExtractCommand(self, lines):
while end >= start:
thisLine = self.DoGetLine(end)
promptLen = len(GetPromptPrefix(thisLine))
retList = [thisLine[promptLen:]] + retList
retList = [thisLine[promptLen:], *retList]
end -= 1
return retList

Expand Down
4 changes: 2 additions & 2 deletions Pythonwin/pywin/scintilla/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def configure(self, editor, subsections=None):
# First, we "recursively" connect any we are based on.
if subsections is None:
subsections = []
subsections = [""] + subsections
subsections = ["", *subsections]
general = self.get_data("general")
if general:
parents = general.get("based on", [])
Expand Down Expand Up @@ -224,7 +224,7 @@ def configure(self, editor, subsections=None):
def get_key_binding(self, event, subsections=None):
if subsections is None:
subsections = []
subsections = [""] + subsections
subsections = ["", *subsections]

subsection_keymap = self.get_data("keys")
for subsection in subsections:
Expand Down
2 changes: 1 addition & 1 deletion Pythonwin/pywin/tools/TraceCollector.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def CollectorThread(stopEvent, file):

class WindowOutput(winout.WindowOutput):
def __init__(self, *args):
winout.WindowOutput.__init__(*(self,) + args)
winout.WindowOutput.__init__(self, *args)
self.hStopThread = win32event.CreateEvent(None, 0, 0, None)
_thread.start_new(CollectorThread, (self.hStopThread, self))

Expand Down
2 changes: 1 addition & 1 deletion com/win32com/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def __setattr__(self, attr, value):
args, defArgs = self._prop_map_put_[attr]
except KeyError:
raise AttributeError(f"'{self!r}' object has no attribute '{attr}'")
self._oleobj_.Invoke(*(args + (value,) + defArgs))
self._oleobj_.Invoke(*args, value, *defArgs)

def _get_good_single_object_(self, obj, obUserName=None, resultCLSID=None):
return _get_good_single_object_(obj, obUserName, resultCLSID)
Expand Down
10 changes: 5 additions & 5 deletions com/win32com/client/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def __call__(self, *args):
pythoncom.DISPID_VALUE,
)
if invkind is not None:
allArgs = (dispid, LCID, invkind, 1) + args
allArgs = (dispid, LCID, invkind, 1, *args)
return self._get_good_object_(
self._oleobj_.Invoke(*allArgs), self._olerepr_.defaultDispatchName, None
)
Expand Down Expand Up @@ -331,7 +331,7 @@ def __setitem__(self, index, *args):
pythoncom.DISPID_VALUE,
)
if invkind is not None:
allArgs = (dispid, LCID, invkind, 0, index) + args
allArgs = (dispid, LCID, invkind, 0, index, *args)
return self._get_good_object_(
self._oleobj_.Invoke(*allArgs), self._olerepr_.defaultDispatchName, None
)
Expand All @@ -354,7 +354,7 @@ def _find_dispatch_type_(self, methodName):

def _ApplyTypes_(self, dispid, wFlags, retType, argTypes, user, resultCLSID, *args):
result = self._oleobj_.InvokeTypes(
*(dispid, LCID, wFlags, retType, argTypes) + args
dispid, LCID, wFlags, retType, argTypes, *args
)
return self._get_good_object_(result, user, resultCLSID)

Expand Down Expand Up @@ -447,7 +447,7 @@ def _proc_(self, name, *args):
item = self._olerepr_.mapFuncs[name]
dispId = item.dispid
return self._get_good_object_(
self._oleobj_.Invoke(*(dispId, LCID, item.desc[4], 0) + (args))
self._oleobj_.Invoke(dispId, LCID, item.desc[4], 0, *args)
)
except KeyError:
raise AttributeError(name)
Expand Down Expand Up @@ -505,7 +505,7 @@ def _LazyAddAttr_(self, attr):
r = olerepr._AddVar_(typeinfo, t, 0)
else: # not found or TYPEDESC/IMPLICITAPP
r = None
if not r is None:
if r is not None:
key, map = r[0], r[1]
item = map[key]
if map == olerepr.propMapPut:
Expand Down
5 changes: 3 additions & 2 deletions com/win32com/demos/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

class ConnectableServer(win32com.server.connect.ConnectableServer):
_public_methods_ = [
"DoIt"
] + win32com.server.connect.ConnectableServer._public_methods_
"DoIt",
*win32com.server.connect.ConnectableServer._public_methods_,
]
_connect_interfaces_ = [IID_IConnectDemoEvents]

# The single public method that the client can call on us
Expand Down
2 changes: 1 addition & 1 deletion com/win32com/demos/ietoolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def toparam(self):
val = default
vals.append(val)
full_fmt += fmt
return struct.pack(*(full_fmt,) + tuple(vals))
return struct.pack(full_fmt, *vals)


class TBBUTTON(WIN32STRUCT):
Expand Down
2 changes: 1 addition & 1 deletion com/win32com/server/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _BroadcastNotify(self, broadcaster, extraArgs):
# Ignores clients that fail.
for interface in self.connections.values():
try:
broadcaster(*(interface,) + extraArgs)
broadcaster(interface, *extraArgs)
except pythoncom.com_error as details:
self._OnNotifyFail(interface, details)

Expand Down
2 changes: 1 addition & 1 deletion com/win32com/server/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def RegisterServer(
if addPyComCat is None:
addPyComCat = pythoncom.frozen == 0
if addPyComCat:
catids = catids + [CATID_PythonCOMServer]
catids = [*catids, CATID_PythonCOMServer]

# Set up the implemented categories
if catids:
Expand Down
2 changes: 1 addition & 1 deletion com/win32com/test/testIterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ def suite():


if __name__ == "__main__":
unittest.main(argv=sys.argv + ["suite"])
unittest.main(argv=[*sys.argv, "suite"])
2 changes: 1 addition & 1 deletion com/win32comext/axdebug/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def BuildModule(module, built_nodes, rootNode, create_node_fn, create_node_args)
# print("keeping", module.__name__)
node = ModuleTreeNode(module)
built_nodes[module] = node
realNode = create_node_fn(*(node,) + create_node_args)
realNode = create_node_fn(node, *create_node_args)
node.realNode = realNode

# Split into parent nodes.
Expand Down
2 changes: 1 addition & 1 deletion com/win32comext/axdebug/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class EnumDebugPropertyInfo(ListEnumeratorGateway):

"""

_public_methods_ = ListEnumeratorGateway._public_methods_ + ["GetCount"]
_public_methods_ = [*ListEnumeratorGateway._public_methods_, "GetCount"]
_com_interfaces_ = [axdebug.IID_IEnumDebugPropertyInfo]

def GetCount(self):
Expand Down
19 changes: 11 additions & 8 deletions com/win32comext/axdebug/gateways.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ def GetDocumentClassId(self):


class DebugDocumentProvider(DebugDocumentInfo):
_public_methods_ = DebugDocumentInfo._public_methods_ + ["GetDocument"]
_com_interfaces_ = DebugDocumentInfo._com_interfaces_ + [
axdebug.IID_IDebugDocumentProvider
_public_methods_ = [*DebugDocumentInfo._public_methods_, "GetDocument"]
_com_interfaces_ = [
*DebugDocumentInfo._com_interfaces_,
axdebug.IID_IDebugDocumentProvider,
]

def GetDocument(self):
Expand All @@ -92,8 +93,9 @@ class DebugApplicationNode(DebugDocumentProvider):
+ DebugDocumentProvider._public_methods_
)
_com_interfaces_ = [
axdebug.IID_IDebugDocumentProvider
] + DebugDocumentProvider._com_interfaces_
axdebug.IID_IDebugDocumentProvider,
*DebugDocumentProvider._com_interfaces_,
]

def __init__(self):
DebugDocumentProvider.__init__(self)
Expand Down Expand Up @@ -153,13 +155,13 @@ class DebugDocument(DebugDocumentInfo):
"""The base interface to all debug documents."""

_public_methods_ = DebugDocumentInfo._public_methods_
_com_interfaces_ = [axdebug.IID_IDebugDocument] + DebugDocumentInfo._com_interfaces_
_com_interfaces_ = [axdebug.IID_IDebugDocument, *DebugDocumentInfo._com_interfaces_]


class DebugDocumentText(DebugDocument):
"""The interface to a text only debug document."""

_com_interfaces_ = [axdebug.IID_IDebugDocumentText] + DebugDocument._com_interfaces_
_com_interfaces_ = [axdebug.IID_IDebugDocumentText, *DebugDocument._com_interfaces_]
_public_methods_ = [
"GetDocumentAttributes",
"GetSize",
Expand All @@ -168,7 +170,8 @@ class DebugDocumentText(DebugDocument):
"GetText",
"GetPositionOfContext",
"GetContextOfPosition",
] + DebugDocument._public_methods_
*DebugDocument._public_methods_,
]

def __init__(self):
pass
Expand Down
2 changes: 1 addition & 1 deletion com/win32comext/axscript/client/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def profile(fn, *args):
try:
# roll on 1.6 :-)
# return prof.runcall(fn, *args)
return prof.runcall(*(fn,) + args)
return prof.runcall(fn, *args)
finally:
import pstats

Expand Down
3 changes: 2 additions & 1 deletion com/win32comext/shell/demos/servers/column_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from win32com.shell import shell, shellcon

IPersist_Methods = ["GetClassID"]
IColumnProvider_Methods = IPersist_Methods + [
IColumnProvider_Methods = [
*IPersist_Methods,
"Initialize",
"GetColumnInfo",
"GetItemData",
Expand Down
10 changes: 6 additions & 4 deletions com/win32comext/shell/shellcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,10 +1210,11 @@ def EIRESID(x):
"ContextSensitiveHelp",
] # XXX - this should be somewhere in win32com
IPersist_Methods = ["GetClassID"]
IPersistFolder_Methods = IPersist_Methods + ["Initialize"]
IPersistFolder2_Methods = IPersistFolder_Methods + ["GetCurFolder"]
IPersistFolder_Methods = [*IPersist_Methods, "Initialize"]
IPersistFolder2_Methods = [*IPersistFolder_Methods, "GetCurFolder"]
IShellExtInit_Methods = ["Initialize"]
IShellView_Methods = IOleWindow_Methods + [
IShellView_Methods = [
*IOleWindow_Methods,
"TranslateAccelerator",
"EnableModeless",
"UIActivate",
Expand All @@ -1239,7 +1240,8 @@ def EIRESID(x):
"GetDisplayNameOf",
"SetNameOf",
]
IShellFolder2_Methods = IShellFolder_Methods + [
IShellFolder2_Methods = [
*IShellFolder_Methods,
"GetDefaultSearchGUID",
"EnumSearches",
"GetDefaultColumn",
Expand Down
2 changes: 1 addition & 1 deletion isapi/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def CheckLoaderModule(dll_name):
def _CallHook(ob, hook_name, options, *extra_args):
func = getattr(ob, hook_name, None)
if func is not None:
args = (ob, options) + extra_args
args = (ob, options, *extra_args)
func(*args)


Expand Down
5 changes: 3 additions & 2 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ select = [
"C4", # flake8-comprehensions
"F811", # redefined-while-unused
"I", # isort
"PIE800", # unnecessary-spread
"PLC", # Pylint Convention
"PLE", # Pylint Error
"RUF005", # collection-literal-concatenation
"RSE", # flake8-raise
"W", # pycodestyle Warning
"YTT", # flake8-2020
Expand Down Expand Up @@ -51,8 +53,7 @@ extend-ignore = [
# TODO: Make adodbapi changes in their own PRs
"adodbapi/*" = [
"C4",
"UP031",
"UP032",
"RUF005",
# Dropping Python 3.8 support
"UP005",
"UP006",
Expand Down
Loading
Loading