fluently 0.9.0__py3-none-any.whl → 0.9.1__py3-none-any.whl

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.
fluently/list.py CHANGED
@@ -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
fluently/tuple.py CHANGED
@@ -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
fluently/version.txt CHANGED
@@ -1 +1 @@
1
- 0.9.0
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.
@@ -0,0 +1,12 @@
1
+ fluently/__init__.py,sha256=brCOQ_7IWzXc92bu7h6_zKgMyz4utBBiKdzyB4oRiQw,312
2
+ fluently/list.py,sha256=m7kPE6-oGUudpmm4QJKMDYVRjtXZnvKzKuUmAmxyTkU,11506
3
+ fluently/logging.py,sha256=E9dBqy_5Besj9Ngno2eRCbDS_5njOZtP5mloomPR5j0,55
4
+ fluently/set.py,sha256=fLwz60Y-9h1BpuLXa3-KeNfb2ilZMpOs3zjugg79OpQ,1953
5
+ fluently/tuple.py,sha256=fbqPSXKiEy2fwJsKVpciLfPx0qqFxGRoguQCfYwDhaU,10941
6
+ fluently/utilities.py,sha256=75URgJJwkxt_1LzFnQq72aGmS-hrXLmN7psaubM6RP4,648
7
+ fluently/version.txt,sha256=esMNbdj-JAOOt0qm_AbUTiB5w3fto5JB3sQXawAM-ME,5
8
+ fluently-0.9.1.dist-info/METADATA,sha256=6g6UdhCLwdB8BY6sIv6XOr3saKFQpyWxiB4RolllwQw,34554
9
+ fluently-0.9.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
10
+ fluently-0.9.1.dist-info/top_level.txt,sha256=XT045Ty_MBfLhYqEiO8gwN0gn9fPjiY1-0gkt9Cpv28,9
11
+ fluently-0.9.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
12
+ fluently-0.9.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,12 +0,0 @@
1
- fluently/__init__.py,sha256=brCOQ_7IWzXc92bu7h6_zKgMyz4utBBiKdzyB4oRiQw,312
2
- fluently/list.py,sha256=pKGsxKzaNGOhf3U2UzwoSqizryRJdUzfnL1YcIADhSM,11460
3
- fluently/logging.py,sha256=E9dBqy_5Besj9Ngno2eRCbDS_5njOZtP5mloomPR5j0,55
4
- fluently/set.py,sha256=fLwz60Y-9h1BpuLXa3-KeNfb2ilZMpOs3zjugg79OpQ,1953
5
- fluently/tuple.py,sha256=YW63pVd6zYzTVwPab3pEkjvgswcWIN2LzvEuBUc8CWg,10940
6
- fluently/utilities.py,sha256=75URgJJwkxt_1LzFnQq72aGmS-hrXLmN7psaubM6RP4,648
7
- fluently/version.txt,sha256=MMmeixA-rL5vbW4bVLBsptXzFktPUAlDNKUXrpXKj7o,5
8
- fluently-0.9.0.dist-info/METADATA,sha256=m-deELtxzeCNPLawRWnJ5fE0yY5bpYwxy-udSa1-_5o,34524
9
- fluently-0.9.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
- fluently-0.9.0.dist-info/top_level.txt,sha256=XT045Ty_MBfLhYqEiO8gwN0gn9fPjiY1-0gkt9Cpv28,9
11
- fluently-0.9.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
12
- fluently-0.9.0.dist-info/RECORD,,