A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-May/024380.html below:

[Python-Dev] Allowing Unicode literals even without Unicode support?

[Python-Dev] Allowing Unicode literals even without Unicode support? [Python-Dev] Allowing Unicode literals even without Unicode support?Guido van Rossum guido@python.org
Fri, 24 May 2002 14:25:02 -0400
Many test modules fail because they use Unicode literals.  It's easy
enough to skip Unicode-related tests (just test for the existence of
'unicode'), but it's hard to avoid having Unicode literals in the text
at all.  Should we perhaps silently interpret Unicode literals as
regular string literals when compiling without Unicode support?

It's easy to do:

*** compile.c	26 Apr 2002 01:57:19 -0000	2.242
--- compile.c	24 May 2002 18:21:29 -0000
***************
*** 1135,1147 ****
  #endif
  	if (isalpha(quote) || quote == '_') {
  		if (quote == 'u' || quote == 'U') {
- #ifdef Py_USING_UNICODE
  			quote = *++s;
  			unicode = 1;
- #else
- 			com_error(com, PyExc_SyntaxError,
- 				  "Unicode literals not supported in this Python");
- 			return NULL;
  #endif
  		}
  		if (quote == 'r' || quote == 'R') {
--- 1135,1143 ----
  #endif
  	if (isalpha(quote) || quote == '_') {
  		if (quote == 'u' || quote == 'U') {
  			quote = *++s;
+ #ifdef Py_USING_UNICODE
  			unicode = 1;
  #endif
  		}
  		if (quote == 'r' || quote == 'R') {

--Guido van Rossum (home page: http://www.python.org/~guido/)




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4