unicodedata-reader 1.3.0__tar.gz → 1.3.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 (17) hide show
  1. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/PKG-INFO +2 -2
  2. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/README.md +1 -1
  3. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/pyproject.toml +1 -1
  4. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/entry.py +4 -1
  5. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/set.py +1 -1
  6. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/LICENSE +0 -0
  7. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/__init__.py +0 -0
  8. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/__main__.py +0 -0
  9. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/bidi_brackets.py +0 -0
  10. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/cli.py +0 -0
  11. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/compressor.py +0 -0
  12. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/east_asian_width.py +0 -0
  13. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/emoji.py +0 -0
  14. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/general_category.py +0 -0
  15. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/line_break.py +0 -0
  16. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/reader.py +0 -0
  17. {unicodedata_reader-1.3.0 → unicodedata_reader-1.3.1}/unicodedata_reader/vertical_orientation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unicodedata-reader
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary:
5
5
  Home-page: https://github.com/kojiishi/unicodedata-reader
6
6
  License: Apache-2.0
@@ -68,7 +68,7 @@ import unicodedata_reader
68
68
 
69
69
  reader = unicodedata_reader.UnicodeDataReader.default
70
70
  lb = reader.line_break()
71
- print(lb.value(0x41))
71
+ print(lb[0x41])
72
72
  ```
73
73
  The example above prints `AL`,
74
74
  the [Line_Break property] value for U+0041.
@@ -48,7 +48,7 @@ import unicodedata_reader
48
48
 
49
49
  reader = unicodedata_reader.UnicodeDataReader.default
50
50
  lb = reader.line_break()
51
- print(lb.value(0x41))
51
+ print(lb[0x41])
52
52
  ```
53
53
  The example above prints `AL`,
54
54
  the [Line_Break property] value for U+0041.
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "unicodedata-reader"
7
- version = "1.3.0"
7
+ version = "1.3.1"
8
8
  description = ""
9
9
  authors = ["Koji Ishii <kojii@chromium.org>"]
10
10
  readme = "README.md"
@@ -218,6 +218,9 @@ class UnicodeDataEntries(object):
218
218
  self._ensure_multi_iterable()
219
219
  return len(self._entries)
220
220
 
221
+ def __getitem__(self, code: int) -> Any:
222
+ return self.value(code)
223
+
221
224
  def missing_value(self, code: int):
222
225
  if self._missing_entries:
223
226
  # `_missing_entries` can overlap, iterate all entries.
@@ -251,7 +254,7 @@ class UnicodeDataEntries(object):
251
254
  self._ensure_multi_iterable()
252
255
  return itertools.chain(*(e.range() for e in self._entries))
253
256
 
254
- def value(self, code: int):
257
+ def value(self, code: int) -> Any:
255
258
  """Returns the value for the given code point."""
256
259
  self._ensure_multi_iterable()
257
260
  for entry in self._entries:
@@ -17,7 +17,7 @@ class Set(object):
17
17
  if entries:
18
18
  self.add_entries(entries, pred)
19
19
 
20
- def __contains__(self, code_point: int) -> bool:
20
+ def contains(self, code_point: int) -> bool:
21
21
  return code_point in self.set
22
22
 
23
23
  def __iter__(self) -> Iterable[int]: