From 4ff605d6c55fcf3e9b4777ffbcb0c24ef17ba4ca Mon Sep 17 00:00:00 2001 From: Arti Date: Mon, 28 Feb 2022 21:19:50 +0100 Subject: [PATCH] Rename instances of `collections.Iterable` into `collections.abc.Iterable` (#2956) --- horizons/ai/aiplayer/combat/unitmanager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/horizons/ai/aiplayer/combat/unitmanager.py b/horizons/ai/aiplayer/combat/unitmanager.py index 8449d5563c5..57db0d47061 100644 --- a/horizons/ai/aiplayer/combat/unitmanager.py +++ b/horizons/ai/aiplayer/combat/unitmanager.py @@ -151,7 +151,7 @@ def _ship_state_rule(self, state_dict, ship_states): """ Rule stating that ship has to be in any of given states. """ - if not isinstance(ship_states, collections.Iterable): + if not isinstance(ship_states, collections.abc.Iterable): ship_states = (ship_states,) return lambda ship: (state_dict[ship] in ship_states) @@ -178,7 +178,7 @@ def filter_ships(self, ships, rules): @param rules: conditions each ship has to meet (AND) @type rules: iterable of lambda(ship) or single lambda(ship) """ - if not isinstance(rules, collections.Iterable): + if not isinstance(rules, collections.abc.Iterable): rules = (rules,) return [ship for ship in ships if all((rule(ship) for rule in rules))] 9f32744d'>treecommitdiff
path: root/tests/records.scm
AgeCommit message (Collapse)Author
2022-12-27records: match-record supports specifying a different variable name.Attila Lendvai
An example: (match-record obj <my-type> (field1 (field2 custom-var-name) field3) ...) * guix/records.scm (match-record-inner): Add support for the new syntax. * tests/records.scm ("match-record, simple"): Add a simple test case for the new syntax. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-12-02records: 'match-record' checks fields at macro-expansion time.Ludovic Courtès
This allows 'match-record' to be more efficient (field offsets are computed at compilation time) and to report unknown fields at macro-expansion time. * guix/records.scm (map-fields): New macro. (define-record-type*)[rtd-identifier]: New procedure. Define TYPE as a macro and use a separate identifier for the RTD. (lookup-field, match-record-inner): New macros. (match-record): Rewrite in terms of 'match-error-inner'. * tests/records.scm ("match-record, simple") ("match-record, unknown field"): New tests. * gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file' local variable to 'main-log-file'. * gnu/services/getmail.scm (serialize-getmail-configuration-file): Move after <getmail-configuration-file> definition.
2022-07-01tests: Add sanitizer test.Ludovic Courtès
* tests/records.scm ("define-record-type* & sanitize without default value"): New test.
2021-08-12records: Support field sanitizers.Ludovic Courtès
* guix/records.scm (make-syntactic-constructor): Add #:sanitizers. [field-sanitizer]: New procedure. [wrap-field-value]: Honor F's sanitizer. (define-record-type*)[field-sanitizer]: New procedure. Pass #:sanitizer to 'make-syntactic-constructor'. * tests/records.scm ("define-record-type* & sanitize") ("define-record-type* & sanitize & thunked"): New tests.
2021-04-29diagnostics, ui: Adjust to 'read-error' and 'syntax-error' in Guile 3.0.6.Ludovic Courtès
* guix/diagnostics.scm (source-properties->location): Add clause for vectors. * guix/ui.scm (report-load-error): Tweak 'read-error' handling for 3.0.6. * tests/guix-package.sh: Relax regexp for the "unbound variable" diagnostic check. * tests/guix-system.sh: Adjust "missing closing paren" check for 3.0.6. * tests/records.scm (location-alist): New procedure. ("define-record-type* & wrong field specifier") ("define-record-type* & wrong field specifier, identifier") ("define-record-type* & duplicate initializers"): Use it.