| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 06eeee9 commit 02b6003
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2060,8 +2060,8 @@ def __init__(self, language, printer=None, *, verify=True, filename=None): | |||
| 2060 | 2060 | self.printer = printer or BlockPrinter(language) | |
| 2061 | 2061 | self.verify = verify | |
| 2062 | 2062 | self.filename = filename | |
| 2063 | - self.modules = collections.OrderedDict() | ||
| 2064 | - self.classes = collections.OrderedDict() | ||
| 2063 | + self.modules = {} | ||
| 2064 | + self.classes = {} | ||
| 2065 | 2065 | self.functions = [] | |
| 2066 | 2066 | ||
| 2067 | 2067 | self.line_prefix = self.line_suffix = '' | |
@@ -2074,18 +2074,18 @@ def __init__(self, language, printer=None, *, verify=True, filename=None): | |||
| 2074 | 2074 | self.add_destination("file", "file", "{dirname}/clinic/{basename}.h") | |
| 2075 | 2075 | ||
| 2076 | 2076 | d = self.get_destination_buffer | |
| 2077 | - self.destination_buffers = collections.OrderedDict(( | ||
| 2078 | - ('cpp_if', d('file')), | ||
| 2079 | - ('docstring_prototype', d('suppress')), | ||
| 2080 | - ('docstring_definition', d('file')), | ||
| 2081 | - ('methoddef_define', d('file')), | ||
| 2082 | - ('impl_prototype', d('file')), | ||
| 2083 | - ('parser_prototype', d('suppress')), | ||
| 2084 | - ('parser_definition', d('file')), | ||
| 2085 | - ('cpp_endif', d('file')), | ||
| 2086 | - ('methoddef_ifndef', d('file', 1)), | ||
| 2087 | - ('impl_definition', d('block')), | ||
| 2088 | - )) | ||
| 2077 | + self.destination_buffers = { | ||
| 2078 | + 'cpp_if': d('file'), | ||
| 2079 | + 'docstring_prototype': d('suppress'), | ||
| 2080 | + 'docstring_definition': d('file'), | ||
| 2081 | + 'methoddef_define': d('file'), | ||
| 2082 | + 'impl_prototype': d('file'), | ||
| 2083 | + 'parser_prototype': d('suppress'), | ||
| 2084 | + 'parser_definition': d('file'), | ||
| 2085 | + 'cpp_endif': d('file'), | ||
| 2086 | + 'methoddef_ifndef': d('file', 1), | ||
| 2087 | + 'impl_definition': d('block'), | ||
| 2088 | + } | ||
| 2089 | 2089 | ||
| 2090 | 2090 | self.destination_buffers_stack = [] | |
| 2091 | 2091 | self.ifndef_symbols = set() | |
@@ -2098,7 +2098,7 @@ def __init__(self, language, printer=None, *, verify=True, filename=None): | |||
| 2098 | 2098 | continue | |
| 2099 | 2099 | name, value, *options = line.split() | |
| 2100 | 2100 | if name == 'preset': | |
| 2101 | - self.presets[value] = preset = collections.OrderedDict() | ||
| 2101 | + self.presets[value] = preset = {} | ||
| 2102 | 2102 | continue | |
| 2103 | 2103 | ||
| 2104 | 2104 | if len(options): | |
@@ -2301,8 +2301,8 @@ def __init__( | |||
| 2301 | 2301 | self.name = name | |
| 2302 | 2302 | self.module = self.parent = module | |
| 2303 | 2303 | ||
| 2304 | - self.modules: ModuleDict = collections.OrderedDict() | ||
| 2305 | - self.classes: ClassDict = collections.OrderedDict() | ||
| 2304 | + self.modules: ModuleDict = {} | ||
| 2305 | + self.classes: ClassDict = {} | ||
| 2306 | 2306 | self.functions: list[Function] = [] | |
| 2307 | 2307 | ||
| 2308 | 2308 | def __repr__(self) -> str: | |
@@ -2327,7 +2327,7 @@ def __init__( | |||
| 2327 | 2327 | self.type_object = type_object | |
| 2328 | 2328 | self.parent = cls or module | |
| 2329 | 2329 | ||
| 2330 | - self.classes: ClassDict = collections.OrderedDict() | ||
| 2330 | + self.classes: ClassDict = {} | ||
| 2331 | 2331 | self.functions: list[Function] = [] | |
| 2332 | 2332 | ||
| 2333 | 2333 | def __repr__(self) -> str: | |
@@ -2428,7 +2428,7 @@ def __init__(self, parameters=None, *, name, | |||
| 2428 | 2428 | return_converter, return_annotation=inspect.Signature.empty, | |
| 2429 | 2429 | docstring=None, kind=CALLABLE, coexist=False, | |
| 2430 | 2430 | docstring_only=False): | |
| 2431 | - self.parameters = parameters or collections.OrderedDict() | ||
| 2431 | + self.parameters = parameters or {} | ||
| 2432 | 2432 | self.return_annotation = return_annotation | |
| 2433 | 2433 | self.name = name | |
| 2434 | 2434 | self.full_name = full_name | |
@@ -2489,12 +2489,10 @@ def copy(self, **overrides): | |||
| 2489 | 2489 | } | |
| 2490 | 2490 | kwargs.update(overrides) | |
| 2491 | 2491 | f = Function(**kwargs) | |
| 2492 | - | ||
| 2493 | - parameters = collections.OrderedDict() | ||
| 2494 | - for name, value in f.parameters.items(): | ||
| 2495 | - value = value.copy(function=f) | ||
| 2496 | - parameters[name] = value | ||
| 2497 | - f.parameters = parameters | ||
| 2492 | + f.parameters = { | ||
| 2493 | + name: value.copy(function=f) | ||
| 2494 | + for name, value in f.parameters.items() | ||
| 2495 | + } | ||
| 2498 | 2496 | return f | |
| 2499 | 2497 | ||
| 2500 | 2498 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments