Numworks Epsilon  1.4.1
Graphing Calculator Operating System
objstr.c File Reference
#include <string.h>
#include <assert.h>
#include "py/unicode.h"
#include "py/objstr.h"
#include "py/objlist.h"
#include "py/runtime.h"
#include "py/stackctrl.h"

Go to the source code of this file.

Classes

struct  _mp_obj_str8_it_t
 

Typedefs

typedef struct _mp_obj_str8_it_t mp_obj_str8_it_t
 

Enumerations

enum  { LSTRIP, RSTRIP, STRIP }
 

Functions

STATIC mp_obj_t str_modulo_format (mp_obj_t pattern, size_t n_args, const mp_obj_t *args, mp_obj_t dict)
 
STATIC mp_obj_t mp_obj_new_bytes_iterator (mp_obj_t str, mp_obj_iter_buf_t *iter_buf)
 
STATIC NORETURN void bad_implicit_conversion (mp_obj_t self_in)
 
void mp_str_print_quoted (const mp_print_t *print, const byte *str_data, size_t str_len, bool is_bytes)
 
STATIC void str_print (const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind)
 
mp_obj_t mp_obj_str_make_new (const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
STATIC mp_obj_t bytes_make_new (const mp_obj_type_t *type_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
const bytefind_subbytes (const byte *haystack, size_t hlen, const byte *needle, size_t nlen, int direction)
 
mp_obj_t mp_obj_str_binary_op (mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_in)
 
const bytestr_index_to_ptr (const mp_obj_type_t *type, const byte *self_data, size_t self_len, mp_obj_t index, bool is_slice)
 
STATIC mp_obj_t bytes_subscr (mp_obj_t self_in, mp_obj_t index, mp_obj_t value)
 
STATIC mp_obj_t str_join (mp_obj_t self_in, mp_obj_t arg)
 
 MP_DEFINE_CONST_FUN_OBJ_2 (str_join_obj, str_join)
 
mp_obj_t mp_obj_str_split (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_split_obj, 1, 3, mp_obj_str_split)
 
STATIC mp_obj_t str_rsplit (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_rsplit_obj, 1, 3, str_rsplit)
 
STATIC mp_obj_t str_finder (size_t n_args, const mp_obj_t *args, int direction, bool is_index)
 
STATIC mp_obj_t str_find (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_find_obj, 2, 4, str_find)
 
STATIC mp_obj_t str_rfind (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_rfind_obj, 2, 4, str_rfind)
 
STATIC mp_obj_t str_index (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_index_obj, 2, 4, str_index)
 
STATIC mp_obj_t str_rindex (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_rindex_obj, 2, 4, str_rindex)
 
STATIC mp_obj_t str_startswith (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_startswith_obj, 2, 3, str_startswith)
 
STATIC mp_obj_t str_endswith (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_endswith_obj, 2, 3, str_endswith)
 
STATIC mp_obj_t str_uni_strip (int type, size_t n_args, const mp_obj_t *args)
 
STATIC mp_obj_t str_strip (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_strip_obj, 1, 2, str_strip)
 
STATIC mp_obj_t str_lstrip (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_lstrip_obj, 1, 2, str_lstrip)
 
STATIC mp_obj_t str_rstrip (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_rstrip_obj, 1, 2, str_rstrip)
 
STATIC const char * str_to_int (const char *str, const char *top, int *num)
 
STATIC bool isalignment (char ch)
 
STATIC bool istype (char ch)
 
STATIC bool arg_looks_integer (mp_obj_t arg)
 
STATIC bool arg_looks_numeric (mp_obj_t arg)
 
STATIC mp_obj_t arg_as_int (mp_obj_t arg)
 
STATIC NORETURN void terse_str_format_value_error (void)
 
STATIC vstr_t mp_obj_str_format_helper (const char *str, const char *top, int *arg_i, size_t n_args, const mp_obj_t *args, mp_map_t *kwargs)
 
mp_obj_t mp_obj_str_format (size_t n_args, const mp_obj_t *args, mp_map_t *kwargs)
 
 MP_DEFINE_CONST_FUN_OBJ_KW (str_format_obj, 1, mp_obj_str_format)
 
STATIC mp_obj_t str_replace (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_replace_obj, 3, 4, str_replace)
 
STATIC mp_obj_t str_count (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (str_count_obj, 2, 4, str_count)
 
STATIC mp_obj_t str_caseconv (unichar(*op)(unichar), mp_obj_t self_in)
 
STATIC mp_obj_t str_lower (mp_obj_t self_in)
 
 MP_DEFINE_CONST_FUN_OBJ_1 (str_lower_obj, str_lower)
 
STATIC mp_obj_t str_upper (mp_obj_t self_in)
 
 MP_DEFINE_CONST_FUN_OBJ_1 (str_upper_obj, str_upper)
 
STATIC mp_obj_t str_uni_istype (bool(*f)(unichar), mp_obj_t self_in)
 
STATIC mp_obj_t str_isspace (mp_obj_t self_in)
 
 MP_DEFINE_CONST_FUN_OBJ_1 (str_isspace_obj, str_isspace)
 
STATIC mp_obj_t str_isalpha (mp_obj_t self_in)
 
 MP_DEFINE_CONST_FUN_OBJ_1 (str_isalpha_obj, str_isalpha)
 
STATIC mp_obj_t str_isdigit (mp_obj_t self_in)
 
 MP_DEFINE_CONST_FUN_OBJ_1 (str_isdigit_obj, str_isdigit)
 
STATIC mp_obj_t str_isupper (mp_obj_t self_in)
 
 MP_DEFINE_CONST_FUN_OBJ_1 (str_isupper_obj, str_isupper)
 
STATIC mp_obj_t str_islower (mp_obj_t self_in)
 
 MP_DEFINE_CONST_FUN_OBJ_1 (str_islower_obj, str_islower)
 
mp_int_t mp_obj_str_get_buffer (mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags)
 
STATIC MP_DEFINE_CONST_DICT (str8_locals_dict, str8_locals_dict_table)
 
STATIC mp_obj_t mp_obj_new_str_iterator (mp_obj_t str, mp_obj_iter_buf_t *iter_buf)
 
mp_obj_t mp_obj_new_str_of_type (const mp_obj_type_t *type, const byte *data, size_t len)
 
mp_obj_t mp_obj_new_str_from_vstr (const mp_obj_type_t *type, vstr_t *vstr)
 
mp_obj_t mp_obj_new_str (const char *data, size_t len, bool make_qstr_if_not_already)
 
mp_obj_t mp_obj_str_intern (mp_obj_t str)
 
mp_obj_t mp_obj_new_bytes (const byte *data, size_t len)
 
bool mp_obj_str_equal (mp_obj_t s1, mp_obj_t s2)
 
qstr mp_obj_str_get_qstr (mp_obj_t self_in)
 
const char * mp_obj_str_get_str (mp_obj_t self_in)
 
const char * mp_obj_str_get_data (mp_obj_t self_in, size_t *len)
 
const bytemp_obj_str_get_data_no_check (mp_obj_t self_in, size_t *len)
 
STATIC mp_obj_t str_it_iternext (mp_obj_t self_in)
 
STATIC mp_obj_t bytes_it_iternext (mp_obj_t self_in)
 

Variables

STATIC const mp_rom_map_elem_t str8_locals_dict_table []
 
const mp_obj_type_t mp_type_str
 
const mp_obj_type_t mp_type_bytes
 
const mp_obj_str_t mp_const_empty_bytes_obj = {{&mp_type_bytes}, 0, 0, (const byte*)""}
 

Typedef Documentation

◆ mp_obj_str8_it_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LSTRIP 
RSTRIP 
STRIP 

Definition at line 766 of file objstr.c.

Function Documentation

◆ arg_as_int()

STATIC mp_obj_t arg_as_int ( mp_obj_t  arg)

Definition at line 906 of file objstr.c.

◆ arg_looks_integer()

STATIC bool arg_looks_integer ( mp_obj_t  arg)

Definition at line 894 of file objstr.c.

◆ arg_looks_numeric()

STATIC bool arg_looks_numeric ( mp_obj_t  arg)

Definition at line 898 of file objstr.c.

◆ bad_implicit_conversion()

STATIC void bad_implicit_conversion ( mp_obj_t  self_in)

Definition at line 2069 of file objstr.c.

◆ bytes_it_iternext()

STATIC mp_obj_t bytes_it_iternext ( mp_obj_t  self_in)

Definition at line 2160 of file objstr.c.

◆ bytes_make_new()

STATIC mp_obj_t bytes_make_new ( const mp_obj_type_t type_in,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 184 of file objstr.c.

◆ bytes_subscr()

STATIC mp_obj_t bytes_subscr ( mp_obj_t  self_in,
mp_obj_t  index,
mp_obj_t  value 
)

Definition at line 407 of file objstr.c.

◆ find_subbytes()

const byte* find_subbytes ( const byte haystack,
size_t  hlen,
const byte needle,
size_t  nlen,
int  direction 
)

Definition at line 263 of file objstr.c.

◆ isalignment()

STATIC bool isalignment ( char  ch)

Definition at line 886 of file objstr.c.

◆ istype()

STATIC bool istype ( char  ch)

Definition at line 890 of file objstr.c.

◆ MP_DEFINE_CONST_DICT()

STATIC MP_DEFINE_CONST_DICT ( str8_locals_dict  ,
str8_locals_dict_table   
)

◆ MP_DEFINE_CONST_FUN_OBJ_1() [1/7]

MP_DEFINE_CONST_FUN_OBJ_1 ( str_lower_obj  ,
str_lower   
)

◆ MP_DEFINE_CONST_FUN_OBJ_1() [2/7]

MP_DEFINE_CONST_FUN_OBJ_1 ( str_upper_obj  ,
str_upper   
)

◆ MP_DEFINE_CONST_FUN_OBJ_1() [3/7]

MP_DEFINE_CONST_FUN_OBJ_1 ( str_isspace_obj  ,
str_isspace   
)

◆ MP_DEFINE_CONST_FUN_OBJ_1() [4/7]

MP_DEFINE_CONST_FUN_OBJ_1 ( str_isalpha_obj  ,
str_isalpha   
)

◆ MP_DEFINE_CONST_FUN_OBJ_1() [5/7]

MP_DEFINE_CONST_FUN_OBJ_1 ( str_isdigit_obj  ,
str_isdigit   
)

◆ MP_DEFINE_CONST_FUN_OBJ_1() [6/7]

MP_DEFINE_CONST_FUN_OBJ_1 ( str_isupper_obj  ,
str_isupper   
)

◆ MP_DEFINE_CONST_FUN_OBJ_1() [7/7]

MP_DEFINE_CONST_FUN_OBJ_1 ( str_islower_obj  ,
str_islower   
)

◆ MP_DEFINE_CONST_FUN_OBJ_2()

MP_DEFINE_CONST_FUN_OBJ_2 ( str_join_obj  ,
str_join   
)

◆ MP_DEFINE_CONST_FUN_OBJ_KW()

MP_DEFINE_CONST_FUN_OBJ_KW ( str_format_obj  ,
,
mp_obj_str_format   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [1/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_split_obj  ,
,
,
mp_obj_str_split   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [2/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_rsplit_obj  ,
,
,
str_rsplit   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [3/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_find_obj  ,
,
,
str_find   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [4/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_rfind_obj  ,
,
,
str_rfind   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [5/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_index_obj  ,
,
,
str_index   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [6/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_rindex_obj  ,
,
,
str_rindex   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [7/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_startswith_obj  ,
,
,
str_startswith   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [8/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_endswith_obj  ,
,
,
str_endswith   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [9/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_strip_obj  ,
,
,
str_strip   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [10/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_lstrip_obj  ,
,
,
str_lstrip   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [11/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_rstrip_obj  ,
,
,
str_rstrip   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [12/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_replace_obj  ,
,
,
str_replace   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN() [13/13]

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( str_count_obj  ,
,
,
str_count   
)

◆ mp_obj_new_bytes()

mp_obj_t mp_obj_new_bytes ( const byte data,
size_t  len 
)

Definition at line 2046 of file objstr.c.

◆ mp_obj_new_bytes_iterator()

mp_obj_t mp_obj_new_bytes_iterator ( mp_obj_t  str,
mp_obj_iter_buf_t iter_buf 
)

Definition at line 2172 of file objstr.c.

◆ mp_obj_new_str()

mp_obj_t mp_obj_new_str ( const char *  data,
size_t  len,
bool  make_qstr_if_not_already 
)

Definition at line 2025 of file objstr.c.

◆ mp_obj_new_str_from_vstr()

mp_obj_t mp_obj_new_str_from_vstr ( const mp_obj_type_t type,
vstr_t vstr 
)

Definition at line 1998 of file objstr.c.

◆ mp_obj_new_str_iterator()

STATIC mp_obj_t mp_obj_new_str_iterator ( mp_obj_t  str,
mp_obj_iter_buf_t iter_buf 
)

Definition at line 2149 of file objstr.c.

◆ mp_obj_new_str_of_type()

mp_obj_t mp_obj_new_str_of_type ( const mp_obj_type_t type,
const byte data,
size_t  len 
)

Definition at line 1981 of file objstr.c.

◆ mp_obj_str_binary_op()

mp_obj_t mp_obj_str_binary_op ( mp_binary_op_t  op,
mp_obj_t  lhs_in,
mp_obj_t  rhs_in 
)

Definition at line 291 of file objstr.c.

◆ mp_obj_str_equal()

bool mp_obj_str_equal ( mp_obj_t  s1,
mp_obj_t  s2 
)

Definition at line 2050 of file objstr.c.

◆ mp_obj_str_format()

mp_obj_t mp_obj_str_format ( size_t  n_args,
const mp_obj_t args,
mp_map_t kwargs 
)

Definition at line 1364 of file objstr.c.

◆ mp_obj_str_format_helper()

STATIC vstr_t mp_obj_str_format_helper ( const char *  str,
const char *  top,
int *  arg_i,
size_t  n_args,
const mp_obj_t args,
mp_map_t kwargs 
)

Definition at line 924 of file objstr.c.

◆ mp_obj_str_get_buffer()

mp_int_t mp_obj_str_get_buffer ( mp_obj_t  self_in,
mp_buffer_info_t bufinfo,
mp_uint_t  flags 
)

Definition at line 1883 of file objstr.c.

◆ mp_obj_str_get_data()

const char* mp_obj_str_get_data ( mp_obj_t  self_in,
size_t len 
)

Definition at line 2105 of file objstr.c.

◆ mp_obj_str_get_data_no_check()

const byte* mp_obj_str_get_data_no_check ( mp_obj_t  self_in,
size_t len 
)

Definition at line 2116 of file objstr.c.

◆ mp_obj_str_get_qstr()

qstr mp_obj_str_get_qstr ( mp_obj_t  self_in)

Definition at line 2082 of file objstr.c.

◆ mp_obj_str_get_str()

const char* mp_obj_str_get_str ( mp_obj_t  self_in)

Definition at line 2095 of file objstr.c.

◆ mp_obj_str_intern()

mp_obj_t mp_obj_str_intern ( mp_obj_t  str)

Definition at line 2041 of file objstr.c.

◆ mp_obj_str_make_new()

mp_obj_t mp_obj_str_make_new ( const mp_obj_type_t type,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 133 of file objstr.c.

◆ mp_obj_str_split()

mp_obj_t mp_obj_str_split ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 484 of file objstr.c.

◆ mp_str_print_quoted()

void mp_str_print_quoted ( const mp_print_t print,
const byte str_data,
size_t  str_len,
bool  is_bytes 
)

Definition at line 45 of file objstr.c.

◆ str_caseconv()

STATIC mp_obj_t str_caseconv ( unichar(*)(unichar op,
mp_obj_t  self_in 
)

Definition at line 1774 of file objstr.c.

◆ str_count()

STATIC mp_obj_t str_count ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 1678 of file objstr.c.

◆ str_endswith()

STATIC mp_obj_t str_endswith ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 751 of file objstr.c.

◆ str_find()

STATIC mp_obj_t str_find ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 714 of file objstr.c.

◆ str_finder()

STATIC mp_obj_t str_finder ( size_t  n_args,
const mp_obj_t args,
int  direction,
bool  is_index 
)

Definition at line 674 of file objstr.c.

◆ str_index()

STATIC mp_obj_t str_index ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 724 of file objstr.c.

◆ str_index_to_ptr()

const byte* str_index_to_ptr ( const mp_obj_type_t type,
const byte self_data,
size_t  self_len,
mp_obj_t  index,
bool  is_slice 
)

Definition at line 399 of file objstr.c.

◆ str_isalpha()

STATIC mp_obj_t str_isalpha ( mp_obj_t  self_in)

Definition at line 1833 of file objstr.c.

◆ str_isdigit()

STATIC mp_obj_t str_isdigit ( mp_obj_t  self_in)

Definition at line 1838 of file objstr.c.

◆ str_islower()

STATIC mp_obj_t str_islower ( mp_obj_t  self_in)

Definition at line 1848 of file objstr.c.

◆ str_isspace()

STATIC mp_obj_t str_isspace ( mp_obj_t  self_in)

Definition at line 1828 of file objstr.c.

◆ str_isupper()

STATIC mp_obj_t str_isupper ( mp_obj_t  self_in)

Definition at line 1843 of file objstr.c.

◆ str_it_iternext()

STATIC mp_obj_t str_it_iternext ( mp_obj_t  self_in)

Definition at line 2137 of file objstr.c.

◆ str_join()

STATIC mp_obj_t str_join ( mp_obj_t  self_in,
mp_obj_t  arg 
)

Definition at line 433 of file objstr.c.

◆ str_lower()

STATIC mp_obj_t str_lower ( mp_obj_t  self_in)

Definition at line 1785 of file objstr.c.

◆ str_lstrip()

STATIC mp_obj_t str_lstrip ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 844 of file objstr.c.

◆ str_modulo_format()

STATIC mp_obj_t str_modulo_format ( mp_obj_t  pattern,
size_t  n_args,
const mp_obj_t args,
mp_obj_t  dict 
)

Definition at line 1374 of file objstr.c.

◆ str_print()

STATIC void str_print ( const mp_print_t print,
mp_obj_t  self_in,
mp_print_kind_t  kind 
)

Definition at line 110 of file objstr.c.

◆ str_replace()

STATIC mp_obj_t str_replace ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 1572 of file objstr.c.

◆ str_rfind()

STATIC mp_obj_t str_rfind ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 719 of file objstr.c.

◆ str_rindex()

STATIC mp_obj_t str_rindex ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 729 of file objstr.c.

◆ str_rsplit()

STATIC mp_obj_t str_rsplit ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 607 of file objstr.c.

◆ str_rstrip()

STATIC mp_obj_t str_rstrip ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 849 of file objstr.c.

◆ str_startswith()

STATIC mp_obj_t str_startswith ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 735 of file objstr.c.

◆ str_strip()

STATIC mp_obj_t str_strip ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 839 of file objstr.c.

◆ str_to_int()

STATIC const char* str_to_int ( const char *  str,
const char *  top,
int *  num 
)

Definition at line 874 of file objstr.c.

◆ str_uni_istype()

STATIC mp_obj_t str_uni_istype ( bool(*)(unichar f,
mp_obj_t  self_in 
)

Definition at line 1795 of file objstr.c.

◆ str_uni_strip()

STATIC mp_obj_t str_uni_strip ( int  type,
size_t  n_args,
const mp_obj_t args 
)

Definition at line 768 of file objstr.c.

◆ str_upper()

STATIC mp_obj_t str_upper ( mp_obj_t  self_in)

Definition at line 1790 of file objstr.c.

◆ terse_str_format_value_error()

STATIC NORETURN void terse_str_format_value_error ( void  )

Definition at line 916 of file objstr.c.

Variable Documentation

◆ mp_const_empty_bytes_obj

const mp_obj_str_t mp_const_empty_bytes_obj = {{&mp_type_bytes}, 0, 0, (const byte*)""}

Definition at line 1977 of file objstr.c.

◆ mp_type_bytes

const mp_obj_type_t mp_type_bytes
Initial value:
= {
.name = MP_QSTR_bytes,
.print = str_print,
.make_new = bytes_make_new,
.binary_op = mp_obj_str_binary_op,
.subscr = bytes_subscr,
.buffer_p = { .get_buffer = mp_obj_str_get_buffer },
.locals_dict = (mp_obj_dict_t*)&str8_locals_dict,
}
mp_obj_t mp_obj_str_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_in)
Definition: objstr.c:291
STATIC mp_obj_t bytes_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value)
Definition: objstr.c:407
STATIC mp_obj_t mp_obj_new_bytes_iterator(mp_obj_t str, mp_obj_iter_buf_t *iter_buf)
Definition: objstr.c:2172
STATIC void str_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind)
Definition: objstr.c:110
mp_int_t mp_obj_str_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags)
Definition: objstr.c:1883
const mp_obj_type_t mp_type_type
Definition: objtype.c:969
qstr name
Definition: obj.h:478
STATIC mp_obj_t bytes_make_new(const mp_obj_type_t *type_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
Definition: objstr.c:184

Definition at line 1964 of file objstr.c.

◆ mp_type_str

const mp_obj_type_t mp_type_str
Initial value:
= {
.name = MP_QSTR_str,
.print = str_print,
.make_new = mp_obj_str_make_new,
.binary_op = mp_obj_str_binary_op,
.subscr = bytes_subscr,
.buffer_p = { .get_buffer = mp_obj_str_get_buffer },
.locals_dict = (mp_obj_dict_t*)&str8_locals_dict,
}
mp_obj_t mp_obj_str_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_in)
Definition: objstr.c:291
STATIC mp_obj_t bytes_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value)
Definition: objstr.c:407
STATIC void str_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind)
Definition: objstr.c:110
mp_int_t mp_obj_str_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags)
Definition: objstr.c:1883
const mp_obj_type_t mp_type_type
Definition: objtype.c:969
mp_obj_t mp_obj_str_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args)
Definition: objstr.c:133
qstr name
Definition: obj.h:478
STATIC mp_obj_t mp_obj_new_str_iterator(mp_obj_t str, mp_obj_iter_buf_t *iter_buf)
Definition: objstr.c:2149

Definition at line 1950 of file objstr.c.

◆ str8_locals_dict_table

STATIC const mp_rom_map_elem_t str8_locals_dict_table[]

Definition at line 1899 of file objstr.c.