Commit Graph

235 Commits

Author SHA1 Message Date
Noah
2e06e167d6 Merge pull request #1807 from youknowone/str-expandtabs
Fix str.expandtab() for newlines
2020-03-12 17:02:31 -05:00
Jeong YunWon
6cb8b665a2 Fix str.expandtab() for newlines 2020-03-11 05:11:25 +09:00
Jeong YunWon
e66e9b1121 Use binding for str.zfill sign matching
Co-Authored-By: Noah <33094578+coolreader18@users.noreply.github.com>
2020-03-09 13:43:28 +09:00
Jeong YunWon
dd8bef4334 Fix str.zfill 2020-03-09 03:22:43 +09:00
Jeong YunWon
6bfd349ef6 char_indices() -> chars()
Co-Authored-By: Noah <33094578+coolreader18@users.noreply.github.com>
2020-03-08 06:42:53 +09:00
Jeong YunWon
6ca457932b Fix str.{capitalize,split,rsplit} and optional args 2020-03-08 06:33:13 +09:00
Jeong YunWon
9bbdbb6b3b Remove test warnings 2020-02-18 08:14:48 +00:00
Jeong YunWon
6ddb690e09 Remove _vm parameter when it is not required 2020-02-06 11:07:51 +09:00
Jeong YunWon
7d0d313aa5 &str::to_string -> &str::to_owned for variables 2020-02-05 22:55:34 +09:00
Jeong YunWon
1bac582921 &str::to_string -> &str::to_owned for literals 2020-02-05 22:55:33 +09:00
Jeong YunWon
7fd92fcc71 Py_TPFLAGS_BASETYPE 2020-01-30 16:32:09 +09:00
Aviv Palivoda
d2a3ff8096 Fix clippy warning 2020-01-25 10:32:46 +02:00
Aviv Palivoda
8bf0d93bb2 Refactor string.splitlines 2020-01-24 22:53:44 +02:00
Aviv Palivoda
4a9e87b80d Support keepends in Str.splitlines 2020-01-24 12:58:51 +02:00
Alvin Lindstam
9203eda6c6 Skip string char traversal on each next in python str iterator
Previosly, each call to `__next__` on a str iterator did a `chars().count()`
to find the length of the full string and traversed the chars of the string
until the expected char position from the start.

This approach ignores the char position and only cares about the byte position,
allowing it to only act on the specific part of the string binary it's interested
in.
2020-01-19 15:49:14 +01:00
Jeong YunWon
8c7e01b4f6 pyslot guess slot name from function name 2020-01-15 10:28:39 +09:00
Jeong YunWon
a11ccc462a refactor byteinner cmp 2020-01-13 11:20:42 +09:00
Noah
156e6e1555 Merge pull request #1654 from youknowone/clone-value
objstr::get_value -> objstr::clone_value
2020-01-08 18:24:38 -06:00
Jeong YunWon
9f4f8ad0ec PyTuple::elements into private 2020-01-06 02:34:56 +09:00
coolreader18
98211a34de Try to cut down on the # of unicode crates we use 2020-01-05 00:19:56 -06:00
Jeong YunWon
13914e0739 objstr::get_value -> objstr::clone_value
because the previous naming gives unclear performance estimation to
users especially comparing to objstr::borrow_value
2020-01-02 20:51:10 +09:00
Jeong YunWon
b7eeba24db Refactor PyString 2019-12-26 22:17:29 +09:00
Abe
325fb4c3a3 Add str.format_map method 2019-12-23 16:29:24 -07:00
coolreader18
2a03a6df44 Add encoding arg to str, fix bytes.__add__ return type 2019-11-28 13:33:25 -06:00
coolreader18
37db627317 Add properties to Unicode errors 2019-11-28 13:33:25 -06:00
coolreader18
4c0ba7b1bd Set up the machinery behind the codecs module 2019-11-28 13:33:24 -06:00
Noah
576d89fdcf Merge pull request #1563 from yanganto/byte.mod
bytes.mod implement with CFormat
2019-11-18 08:49:14 -06:00
yanganto
10ef5e56af bytes.mod implement mod
implement byte formatting with CFormat
2019-11-18 08:39:36 +08:00
Aviv Palivoda
aebc0a42d8 Update format to Rust version 1.39 2019-11-08 23:03:24 +02:00
J Regex
0f1b337d28 check code style 2019-10-31 10:42:55 +09:00
J Regex
84999557cb add some tests 2019-10-31 09:27:14 +09:00
J Regex
b4958bc029 check formet and remove unuesd commnet 2019-10-30 15:26:25 +09:00
J Regex
06ccf59172 #1575 use is_cased function 2019-10-30 14:46:43 +09:00
J Regex
71c7c61bf6 #1575 distinguish between 'cased' and 'non-cased' characters 2019-10-29 15:27:38 +09:00
coolreader18
368fe7294d Fix underscores for isupper 2019-10-27 22:52:01 -05:00
Aviv Palivoda
ea5381db10 Fix format 2019-10-17 23:38:52 +03:00
Aviv Palivoda
a6514ac546 Raise IndexError when int overflow in str.__getitem__ 2019-10-17 22:21:17 +03:00
Aviv Palivoda
3d24635b42 Simplify str.getitem 2019-10-17 17:15:24 +03:00
Aviv Palivoda
70a22ab196 Use isize directly 2019-10-17 17:11:34 +03:00
Robert Berglund
81302ce6c2 impl __sizeof__ for bytearray, int, list, str, dict and set (#1426) 2019-10-16 23:24:36 +09:00
Jeong YunWon
6c0f852b62 Refactor pymethod return types to be smaller as possible 2019-10-11 03:27:23 +09:00
Jeong YunWon
1fc5dcb5bf Result<T, PyObjectRef> -> PyResult<T> 2019-10-11 02:59:47 +09:00
Timur Makarchuk
027a25c123 Merge branch 'master' into string.__repr__ 2019-10-05 22:14:34 +03:00
Timur Makarchuk
4b962b89d7 Implement some __ne__ methods (#1446)
* Implement some __ne__ methods

Added test snippets from `__ne__` methods

* Fix incompatability in str.__eq__ befaviour

Previously "".__eq__(1) returned "False", which is not the case in
cpython.
Not it's returning 'NotImplemented', as it should
2019-10-06 00:50:02 +09:00
Timur
70fb3f69ef cpython compatible "".__repr__
Fixes #1390
2019-10-05 01:17:17 +03:00
Noah
d9cdb32e49 Merge pull request #1441 from dralley/fix-strings
Handle unicode indexing by character, not by grapheme
2019-10-01 19:01:41 -05:00
Daniel Alley
02ea0b629f Handle unicode indexing by character, not by grapheme
Python isn't grapheme aware, so for compatibility sake, we shouldn't be
either.

closes #1417
2019-10-01 12:37:16 -04:00
Noah
d22cac2dd8 Rename new slots to tp_new 2019-09-29 23:14:37 -05:00
coolreader18
c46b5b50bd Fix weirdness with type.__new__()/type()/metaclass.__new__() 2019-09-29 23:14:31 -05:00
j30ng
b056044b5a Fix CI Build in Rust 1.38.0 2019-09-28 03:24:47 +09:00