fluently 0.9.0__tar.gz → 0.9.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {fluently-0.9.0 → fluently-0.9.1}/PKG-INFO +13 -13
  2. {fluently-0.9.0 → fluently-0.9.1}/README.md +12 -12
  3. {fluently-0.9.0 → fluently-0.9.1}/source/fluently/list.py +2 -2
  4. {fluently-0.9.0 → fluently-0.9.1}/source/fluently/tuple.py +1 -0
  5. fluently-0.9.1/source/fluently/version.txt +1 -0
  6. {fluently-0.9.0 → fluently-0.9.1}/source/fluently.egg-info/PKG-INFO +13 -13
  7. {fluently-0.9.0 → fluently-0.9.1}/tests/test_list.py +1 -0
  8. {fluently-0.9.0 → fluently-0.9.1}/tests/test_set.py +2 -0
  9. {fluently-0.9.0 → fluently-0.9.1}/tests/test_tuple.py +0 -2
  10. fluently-0.9.0/source/fluently/version.txt +0 -1
  11. {fluently-0.9.0 → fluently-0.9.1}/pyproject.toml +0 -0
  12. {fluently-0.9.0 → fluently-0.9.1}/requirements.development.txt +0 -0
  13. {fluently-0.9.0 → fluently-0.9.1}/requirements.distribution.txt +0 -0
  14. {fluently-0.9.0 → fluently-0.9.1}/requirements.txt +0 -0
  15. {fluently-0.9.0 → fluently-0.9.1}/setup.cfg +0 -0
  16. {fluently-0.9.0 → fluently-0.9.1}/source/fluently/__init__.py +0 -0
  17. {fluently-0.9.0 → fluently-0.9.1}/source/fluently/logging.py +0 -0
  18. {fluently-0.9.0 → fluently-0.9.1}/source/fluently/set.py +0 -0
  19. {fluently-0.9.0 → fluently-0.9.1}/source/fluently/utilities.py +0 -0
  20. {fluently-0.9.0 → fluently-0.9.1}/source/fluently.egg-info/SOURCES.txt +0 -0
  21. {fluently-0.9.0 → fluently-0.9.1}/source/fluently.egg-info/dependency_links.txt +0 -0
  22. {fluently-0.9.0 → fluently-0.9.1}/source/fluently.egg-info/requires.txt +0 -0
  23. {fluently-0.9.0 → fluently-0.9.1}/source/fluently.egg-info/top_level.txt +0 -0
  24. {fluently-0.9.0 → fluently-0.9.1}/source/fluently.egg-info/zip-safe +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fluently
3
- Version: 0.9.0
3
+ Version: 0.9.1
4
4
  Summary: Fluent data type container implementations for Python.
5
5
  Author: Daniel Sissman
6
6
  License-Expression: MIT
@@ -55,7 +55,7 @@ using `pip` via the `pip install` command by entering the following into your sh
55
55
 
56
56
  To use the Fluently library, import the library and the data type or data types you
57
57
  need and use them just like their regular counterparts, with the knowledge that they
58
- support setting and getting values without regard to the casing of any string keys:
58
+ support fluent interfaces which can often be more convenient and expressive to use:
59
59
 
60
60
  #### Fluent List
61
61
 
@@ -125,16 +125,16 @@ from fluently import fluenttuple, flutuple, ftuple
125
125
  # Create a new fluenttuple instance
126
126
  data = fluenttuple(["A", "B", "C"])
127
127
 
128
- # Assert that the set has the expected class identity, aliases and superclass
128
+ # Assert that the tuple has the expected class identity, aliases and superclass
129
129
  assert isinstance(data, fluenttuple)
130
130
  assert isinstance(data, flutuple)
131
131
  assert isinstance(data, ftuple)
132
132
  assert isinstance(data, tuple)
133
133
 
134
- # Assert that the set has the expected length
134
+ # Assert that the tuple has the expected length
135
135
  assert data.length() == len(data) == 3
136
136
 
137
- # Assert that the set has the expected contents
137
+ # Assert that the tuple has the expected contents
138
138
  assert "A" in data
139
139
  assert "B" in data
140
140
  assert "C" in data
@@ -169,7 +169,7 @@ by the `list` superclass:
169
169
  further chaining, but can be used as the last call on chain of other `fluentlist` methods
170
170
  that do support chaining.
171
171
 
172
- * `clone()` (`fluentlist`) – The `clone()` method supports creating a cloned copy of the
172
+ * `clone()` 🔗 (`fluentlist`) – The `clone()` method supports creating a cloned copy of the
173
173
  current list, that contains the same items, in a separate `fluentlist` instance.
174
174
 
175
175
  * `prepend(item: object)` 🔗 (`fluentlist`) – The `prepend()` method supports prepending
@@ -289,10 +289,10 @@ by the `list` superclass:
289
289
  * `filter(predicate: callable = None, **filters: dict[str, object])` 🔗 (`fluentlist`)
290
290
  – The `filter()` method supports filtering the contents of the current list in the two
291
291
  ways noted below, and returns the filtered results as a new list:
292
- - filtering can be performed via a `predicate` callable method that takes as input the
292
+ - filtering can be performed via a `predicate` callable method that takes as input the
293
293
  current item as the list is iterated over, where the `predicate` must return `True` for
294
294
  items that should remain in the output, and `False` otherwise;
295
- - alternatively, filtering can be performed via one or more keyword arguments, excepting
295
+ - alternatively, filtering can be performed via one or more keyword arguments, excepting
296
296
  the reserved `predicate` keyword, which define the names and values of object attributes
297
297
  that the item objects held in the list must match to be included in the output. Each item
298
298
  in the list will be inspected to see if has the specified attribute (as per the keyword
@@ -399,7 +399,7 @@ by the `set` superclass:
399
399
  further chaining, but can be used as the last call on chain of other `fluentset` methods
400
400
  that do support chaining.
401
401
 
402
- * `clone()` (`fluentset`) – The `clone()` method supports creating a cloned copy of the
402
+ * `clone()` 🔗 (`fluentset`) – The `clone()` method supports creating a cloned copy of the
403
403
  current set, that contains the same items, in a separate `fluentset` instance.
404
404
 
405
405
  * `add(item: object)` 🔗 (`fluentset`) – The `add()` method supports adding the specified
@@ -438,7 +438,7 @@ by the `tuple` superclass:
438
438
  further chaining, but can be used as the last call on chain of other `fluenttuple` methods
439
439
  that do support chaining.
440
440
 
441
- * `clone()` (`fluenttuple`) – The `clone()` method supports creating a cloned copy of
441
+ * `clone()` 🔗 (`fluenttuple`) – The `clone()` method supports creating a cloned copy of
442
442
  the current tuple, that contains the same items, in a separate `fluenttuple` instance.
443
443
 
444
444
  * `add(item: object)` 🔗 (`fluenttuple`) – The `add()` method supports appending the
@@ -544,10 +544,10 @@ by the `tuple` superclass:
544
544
  * `filter(predicate: callable = None, **filters: dict[str, object])` 🔗 (`fluenttuple`)
545
545
  – The `filter()` method supports filtering the contents of the current tuple in the two
546
546
  ways noted below, and returns the filtered results as a new tuple:
547
- - filtering can be performed via a `predicate` callable method that takes as input the
547
+ - filtering can be performed via a `predicate` callable method that takes as input the
548
548
  current item as the tuple is iterated over, where the `predicate` must return `True` for
549
549
  items that should remain in the output, and `False` otherwise;
550
- - alternatively, filtering can be performed via one or more keyword arguments, excepting
550
+ - alternatively, filtering can be performed via one or more keyword arguments, excepting
551
551
  the reserved `predicate` keyword, which define the names and values of object attributes
552
552
  that the item objects held in the tuple must match to be included in the output. Each item
553
553
  in the tuple will be inspected to see if has the specified attribute (as per the keyword
@@ -667,4 +667,4 @@ See the documentation for [PyTest](https://docs.pytest.org/en/latest/) regarding
667
667
 
668
668
  ### Copyright & License Information
669
669
 
670
- Copyright © 2025 Daniel Sissman; licensed under the MIT License.
670
+ Copyright © 2025-2026 Daniel Sissman; licensed under the MIT License.
@@ -24,7 +24,7 @@ using `pip` via the `pip install` command by entering the following into your sh
24
24
 
25
25
  To use the Fluently library, import the library and the data type or data types you
26
26
  need and use them just like their regular counterparts, with the knowledge that they
27
- support setting and getting values without regard to the casing of any string keys:
27
+ support fluent interfaces which can often be more convenient and expressive to use:
28
28
 
29
29
  #### Fluent List
30
30
 
@@ -94,16 +94,16 @@ from fluently import fluenttuple, flutuple, ftuple
94
94
  # Create a new fluenttuple instance
95
95
  data = fluenttuple(["A", "B", "C"])
96
96
 
97
- # Assert that the set has the expected class identity, aliases and superclass
97
+ # Assert that the tuple has the expected class identity, aliases and superclass
98
98
  assert isinstance(data, fluenttuple)
99
99
  assert isinstance(data, flutuple)
100
100
  assert isinstance(data, ftuple)
101
101
  assert isinstance(data, tuple)
102
102
 
103
- # Assert that the set has the expected length
103
+ # Assert that the tuple has the expected length
104
104
  assert data.length() == len(data) == 3
105
105
 
106
- # Assert that the set has the expected contents
106
+ # Assert that the tuple has the expected contents
107
107
  assert "A" in data
108
108
  assert "B" in data
109
109
  assert "C" in data
@@ -138,7 +138,7 @@ by the `list` superclass:
138
138
  further chaining, but can be used as the last call on chain of other `fluentlist` methods
139
139
  that do support chaining.
140
140
 
141
- * `clone()` (`fluentlist`) – The `clone()` method supports creating a cloned copy of the
141
+ * `clone()` 🔗 (`fluentlist`) – The `clone()` method supports creating a cloned copy of the
142
142
  current list, that contains the same items, in a separate `fluentlist` instance.
143
143
 
144
144
  * `prepend(item: object)` 🔗 (`fluentlist`) – The `prepend()` method supports prepending
@@ -258,10 +258,10 @@ by the `list` superclass:
258
258
  * `filter(predicate: callable = None, **filters: dict[str, object])` 🔗 (`fluentlist`)
259
259
  – The `filter()` method supports filtering the contents of the current list in the two
260
260
  ways noted below, and returns the filtered results as a new list:
261
- - filtering can be performed via a `predicate` callable method that takes as input the
261
+ - filtering can be performed via a `predicate` callable method that takes as input the
262
262
  current item as the list is iterated over, where the `predicate` must return `True` for
263
263
  items that should remain in the output, and `False` otherwise;
264
- - alternatively, filtering can be performed via one or more keyword arguments, excepting
264
+ - alternatively, filtering can be performed via one or more keyword arguments, excepting
265
265
  the reserved `predicate` keyword, which define the names and values of object attributes
266
266
  that the item objects held in the list must match to be included in the output. Each item
267
267
  in the list will be inspected to see if has the specified attribute (as per the keyword
@@ -368,7 +368,7 @@ by the `set` superclass:
368
368
  further chaining, but can be used as the last call on chain of other `fluentset` methods
369
369
  that do support chaining.
370
370
 
371
- * `clone()` (`fluentset`) – The `clone()` method supports creating a cloned copy of the
371
+ * `clone()` 🔗 (`fluentset`) – The `clone()` method supports creating a cloned copy of the
372
372
  current set, that contains the same items, in a separate `fluentset` instance.
373
373
 
374
374
  * `add(item: object)` 🔗 (`fluentset`) – The `add()` method supports adding the specified
@@ -407,7 +407,7 @@ by the `tuple` superclass:
407
407
  further chaining, but can be used as the last call on chain of other `fluenttuple` methods
408
408
  that do support chaining.
409
409
 
410
- * `clone()` (`fluenttuple`) – The `clone()` method supports creating a cloned copy of
410
+ * `clone()` 🔗 (`fluenttuple`) – The `clone()` method supports creating a cloned copy of
411
411
  the current tuple, that contains the same items, in a separate `fluenttuple` instance.
412
412
 
413
413
  * `add(item: object)` 🔗 (`fluenttuple`) – The `add()` method supports appending the
@@ -513,10 +513,10 @@ by the `tuple` superclass:
513
513
  * `filter(predicate: callable = None, **filters: dict[str, object])` 🔗 (`fluenttuple`)
514
514
  – The `filter()` method supports filtering the contents of the current tuple in the two
515
515
  ways noted below, and returns the filtered results as a new tuple:
516
- - filtering can be performed via a `predicate` callable method that takes as input the
516
+ - filtering can be performed via a `predicate` callable method that takes as input the
517
517
  current item as the tuple is iterated over, where the `predicate` must return `True` for
518
518
  items that should remain in the output, and `False` otherwise;
519
- - alternatively, filtering can be performed via one or more keyword arguments, excepting
519
+ - alternatively, filtering can be performed via one or more keyword arguments, excepting
520
520
  the reserved `predicate` keyword, which define the names and values of object attributes
521
521
  that the item objects held in the tuple must match to be included in the output. Each item
522
522
  in the tuple will be inspected to see if has the specified attribute (as per the keyword
@@ -636,4 +636,4 @@ See the documentation for [PyTest](https://docs.pytest.org/en/latest/) regarding
636
636
 
637
637
  ### Copyright & License Information
638
638
 
639
- Copyright © 2025 Daniel Sissman; licensed under the MIT License.
639
+ Copyright © 2025-2026 Daniel Sissman; licensed under the MIT License.
@@ -292,7 +292,7 @@ class fluentlist(list):
292
292
  ) -> object | None:
293
293
  """Supports returning the first element or None if the list is empty."""
294
294
 
295
- if len(filters) > 0:
295
+ if callable(predicate) or len(filters) > 0:
296
296
  items = self.filter(predicate=predicate, **filters)
297
297
  else:
298
298
  items = self
@@ -304,7 +304,7 @@ class fluentlist(list):
304
304
  ) -> object | None:
305
305
  """Supports returning the last element or None if the list is empty."""
306
306
 
307
- if len(filters) > 0:
307
+ if callable(predicate) or len(filters) > 0:
308
308
  items = self.filter(predicate=predicate, **filters)
309
309
  else:
310
310
  items = self
@@ -282,5 +282,6 @@ class fluenttuple(tuple):
282
282
 
283
283
  return self.remove(item)
284
284
 
285
+
285
286
  # Shorthand aliases
286
287
  ftuple = flutuple = fluenttuple
@@ -0,0 +1 @@
1
+ 0.9.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fluently
3
- Version: 0.9.0
3
+ Version: 0.9.1
4
4
  Summary: Fluent data type container implementations for Python.
5
5
  Author: Daniel Sissman
6
6
  License-Expression: MIT
@@ -55,7 +55,7 @@ using `pip` via the `pip install` command by entering the following into your sh
55
55
 
56
56
  To use the Fluently library, import the library and the data type or data types you
57
57
  need and use them just like their regular counterparts, with the knowledge that they
58
- support setting and getting values without regard to the casing of any string keys:
58
+ support fluent interfaces which can often be more convenient and expressive to use:
59
59
 
60
60
  #### Fluent List
61
61
 
@@ -125,16 +125,16 @@ from fluently import fluenttuple, flutuple, ftuple
125
125
  # Create a new fluenttuple instance
126
126
  data = fluenttuple(["A", "B", "C"])
127
127
 
128
- # Assert that the set has the expected class identity, aliases and superclass
128
+ # Assert that the tuple has the expected class identity, aliases and superclass
129
129
  assert isinstance(data, fluenttuple)
130
130
  assert isinstance(data, flutuple)
131
131
  assert isinstance(data, ftuple)
132
132
  assert isinstance(data, tuple)
133
133
 
134
- # Assert that the set has the expected length
134
+ # Assert that the tuple has the expected length
135
135
  assert data.length() == len(data) == 3
136
136
 
137
- # Assert that the set has the expected contents
137
+ # Assert that the tuple has the expected contents
138
138
  assert "A" in data
139
139
  assert "B" in data
140
140
  assert "C" in data
@@ -169,7 +169,7 @@ by the `list` superclass:
169
169
  further chaining, but can be used as the last call on chain of other `fluentlist` methods
170
170
  that do support chaining.
171
171
 
172
- * `clone()` (`fluentlist`) – The `clone()` method supports creating a cloned copy of the
172
+ * `clone()` 🔗 (`fluentlist`) – The `clone()` method supports creating a cloned copy of the
173
173
  current list, that contains the same items, in a separate `fluentlist` instance.
174
174
 
175
175
  * `prepend(item: object)` 🔗 (`fluentlist`) – The `prepend()` method supports prepending
@@ -289,10 +289,10 @@ by the `list` superclass:
289
289
  * `filter(predicate: callable = None, **filters: dict[str, object])` 🔗 (`fluentlist`)
290
290
  – The `filter()` method supports filtering the contents of the current list in the two
291
291
  ways noted below, and returns the filtered results as a new list:
292
- - filtering can be performed via a `predicate` callable method that takes as input the
292
+ - filtering can be performed via a `predicate` callable method that takes as input the
293
293
  current item as the list is iterated over, where the `predicate` must return `True` for
294
294
  items that should remain in the output, and `False` otherwise;
295
- - alternatively, filtering can be performed via one or more keyword arguments, excepting
295
+ - alternatively, filtering can be performed via one or more keyword arguments, excepting
296
296
  the reserved `predicate` keyword, which define the names and values of object attributes
297
297
  that the item objects held in the list must match to be included in the output. Each item
298
298
  in the list will be inspected to see if has the specified attribute (as per the keyword
@@ -399,7 +399,7 @@ by the `set` superclass:
399
399
  further chaining, but can be used as the last call on chain of other `fluentset` methods
400
400
  that do support chaining.
401
401
 
402
- * `clone()` (`fluentset`) – The `clone()` method supports creating a cloned copy of the
402
+ * `clone()` 🔗 (`fluentset`) – The `clone()` method supports creating a cloned copy of the
403
403
  current set, that contains the same items, in a separate `fluentset` instance.
404
404
 
405
405
  * `add(item: object)` 🔗 (`fluentset`) – The `add()` method supports adding the specified
@@ -438,7 +438,7 @@ by the `tuple` superclass:
438
438
  further chaining, but can be used as the last call on chain of other `fluenttuple` methods
439
439
  that do support chaining.
440
440
 
441
- * `clone()` (`fluenttuple`) – The `clone()` method supports creating a cloned copy of
441
+ * `clone()` 🔗 (`fluenttuple`) – The `clone()` method supports creating a cloned copy of
442
442
  the current tuple, that contains the same items, in a separate `fluenttuple` instance.
443
443
 
444
444
  * `add(item: object)` 🔗 (`fluenttuple`) – The `add()` method supports appending the
@@ -544,10 +544,10 @@ by the `tuple` superclass:
544
544
  * `filter(predicate: callable = None, **filters: dict[str, object])` 🔗 (`fluenttuple`)
545
545
  – The `filter()` method supports filtering the contents of the current tuple in the two
546
546
  ways noted below, and returns the filtered results as a new tuple:
547
- - filtering can be performed via a `predicate` callable method that takes as input the
547
+ - filtering can be performed via a `predicate` callable method that takes as input the
548
548
  current item as the tuple is iterated over, where the `predicate` must return `True` for
549
549
  items that should remain in the output, and `False` otherwise;
550
- - alternatively, filtering can be performed via one or more keyword arguments, excepting
550
+ - alternatively, filtering can be performed via one or more keyword arguments, excepting
551
551
  the reserved `predicate` keyword, which define the names and values of object attributes
552
552
  that the item objects held in the tuple must match to be included in the output. Each item
553
553
  in the tuple will be inspected to see if has the specified attribute (as per the keyword
@@ -667,4 +667,4 @@ See the documentation for [PyTest](https://docs.pytest.org/en/latest/) regarding
667
667
 
668
668
  ### Copyright & License Information
669
669
 
670
- Copyright © 2025 Daniel Sissman; licensed under the MIT License.
670
+ Copyright © 2025-2026 Daniel Sissman; licensed under the MIT License.
@@ -371,6 +371,7 @@ def test_fluent_list_unique(numbers: fluentlist[int]):
371
371
  # values appeared in the original list:
372
372
  assert numbers.unique() == newnumbers
373
373
 
374
+
374
375
  def test_fluent_list_sort(numbers: fluentlist[int]):
375
376
  """Test the 'sort' method of the 'fluentlist' class."""
376
377
 
@@ -134,6 +134,7 @@ def test_fluent_set_remove():
134
134
 
135
135
  assert not "D" in letters
136
136
 
137
+
137
138
  def test_fluent_set_discard():
138
139
  """Test the 'discard' method of the 'fluentset' class."""
139
140
 
@@ -160,6 +161,7 @@ def test_fluent_set_discard():
160
161
 
161
162
  assert not "D" in letters
162
163
 
164
+
163
165
  def test_fluent_set_clear():
164
166
  """Test the 'clear' method of the 'fluentset' class."""
165
167
 
@@ -447,7 +447,6 @@ def test_fluent_tuple_all():
447
447
  assert newletters.count("D") == 2
448
448
 
449
449
 
450
-
451
450
  def test_fluent_tuple_map(numbers: fluenttuple[int]):
452
451
  """Test the 'map' method of the 'fluenttuple' class."""
453
452
 
@@ -762,4 +761,3 @@ def test_fluent_tuple_last_with_empty_tuple(things: fluenttuple[Thing]):
762
761
 
763
762
  # When the tuple is empty, we expect .last() to return None
764
763
  assert thing is None
765
-
@@ -1 +0,0 @@
1
- 0.9.0
File without changes
File without changes
File without changes