> The last point is correct: if you get bytes from a file system API, you
should be able to pass them back in without losing information. CP_ACP
(a.k.a. the *A API) does not allow this, so I'm proposing using the *W API
everywhere and encoding to utf-8 when the user wants/gives bytes.
You get
Hello,
I'm in holiday and I'm writing on a phone, so sorry in advance for the
short answer.
In short: we should drop support for the bytes API. Just use Unicode on all
platforms, especially for filenames.
Sorry but most of these changes look like very bad ideas. Or maybe I
misunderstood
Hi,
I created the following poll on Twitter with a duration of 7 days:
"""
Is it Python 3 yet?
https://mail.python.org/pipermail/python-ideas/2017-January/01.html
I proposed to hide Python 2 by default from the http://python.org download page.
( ) It's Python 3 O'Clock!
( ) Have some legacy
Hi,
The download button of https://www.python.org/ currently gives the
choice between Python 2.7 and 3.6. I read more and more articles
saying that we reached a point where Python 3 became more popular than
Python 2, Python 3 has now enough new features to convince developers,
etc.
Is it time to
If you only want to vote +1 or -1 with no rationale, you may prefer to
vote on my Twitter poll:
https://twitter.com/VictorStinner/status/824654597235040257
Otherwise, please explain a little bit.
Victor
___
Python-ideas mailing list
2017-01-26 17:21 GMT+01:00 Paul Moore :
> On a similar note, I always get caught out by the fact that the
> Windows default download is the 32-bit version. Are we not yet at a
> point where a sufficient majority of users have 64-bit machines, and
> 32-bit should be seen as a
Yeah, I had a similar issue in a previous company. A colleague wrote a
script using a regex to remove these debug logs in the .py code.
IHMO the clean design for that would be to support officially preprocessors
in Python. My PEP opens the gate for that:
https://www.python.org/dev/peps/pep-0511/
2017-01-15 18:25 GMT+01:00 Juraj Sukop :
> C99 includes `fma` function to `math.h` [6] and emulates the calculation if
> the FMA instruction is not present on the host CPU [7].
If even the libc function has a fallback on x*y followed by +z, it's
fine to add such function to
2017-02-28 13:17 GMT+01:00 Michel Desmoulin :
> We have the immutable frozenset for sets and and tuples for lists.
>
> But we also have something to manipulate dict as immutable datastructures:
>
from types import MappingProxyType as idict
d = idict({'a':1,
Hi,
For technical reasons, many functions of the Python standard libraries
implemented in C have positional-only parameters. Example:
---
$ ./python
Python 3.7.0a0 (default, Feb 25 2017, 04:30:32)
>>> help(str.replace)
replace(self, old, new, count=-1, /) # <== notice "/" at the end
...
Le 30 août 2016 02:05, "INADA Naoki" a écrit :
> How should the option be set?
I propose to add a new -X utf8 option. Maybe if the use case is important,
we might add an PYTHONUTF8 environment variable.
The problem is that I'm not sure that an env var is the right way to
Similar or related issue recently open and quickly closed:
http://bugs.python.org/issue28776
"Duplicate method names should be an error"
In short, such job should be done by linters. I'm quite sure that many
of them already implement such check.
Victor
Hi,
Python is optimized for performance. Formatting an error message has a
cost on performances.
I suggest you to teach your student to use the REPL and use a custom
exception handler: sys.excepthook:
https://docs.python.org/2/library/sys.html#sys.excepthook
Using a custom exception handler,
George requested this feature on the bug tracker:
http://bugs.python.org/issue29223
George was asked to start a discusson on this list. I posted the
following comment before closing the issue:
You are not the first one to propose the idea.
2012: "make decimal the default non-integer instead of
2017-01-12 1:23 GMT+01:00 INADA Naoki :
> I'm ±0 to surrogateescape by default. I feel +1 for stdout and -1 for stdin.
The use case is to be able to write a Python 3 program which works
work UNIX pipes without failing with encoding errors:
2017-01-12 9:45 GMT+01:00 INADA Naoki :
> When using en_US.UTF-8 as fallback, pleas override only LC_CTYPE,
> instead of LC_ALL.
> As I described in other thread, LC_COLLATE may cause unintentional performance
> regression and behavior changes.
Does it work to use a locale
ot;real world" example instead of a long list of theorical
things :-)
Read the PEP 540 online (HTML):
https://www.python.org/dev/peps/pep-0540/
Full text below.
Victor
PEP: 540
Title: Add a new UTF-8 mode
Version: $Revision$
Last-Modified: $Date$
Author: Victor Stinner <victor.stin...@gmail.
2017-01-06 10:50 GMT+01:00 M.-A. Lemburg :
> Victor: I think you are taking the UTF-8 idea a bit too far.
> Nick was trying to address the situation where the locale is
> set to "C", or rather not set at all (in which case the lib C
> defaults to the "C" locale). The latter is a
The topic (switching to UTF-8 on UNIX) is actively discussed on:
http://bugs.python.org/issue28180
Read the PEP online (HTML):
https://www.python.org/dev/peps/pep-0540/
Victor
PEP: 540
Title: Add a new UTF-8 mode
Version: $Revision$
Last-Modified: $Date$
Author: Victor Stinner <victor.stin
2017-01-06 22:20 GMT+01:00 Barry Warsaw :
>>Because I have the impression that nowadays all Linux distributions are UTF-8
>>by default and you have to show some bloody-mindedness to end up with a POSIX
>>locale.
>
> It can still happen in some corner cases, even on Debian and
Ok, I modified my PEP: the POSIX locale now enables the UTF-8 mode.
2017-01-05 18:10 GMT+01:00 Victor Stinner <victor.stin...@gmail.com>:
> A common request is that "Python just works" without having to pass a
> command line option or set an environment variable. Maybe t
2017-01-06 3:10 GMT+01:00 Stephen J. Turnbull
:
> The point of this, I suppose, is that piping to xargs works by
> default.
Please read the second version (latest) version of my PEP 540 which
contains a new "Use Cases" section which helps to define issues and
2017-01-06 2:15 GMT+01:00 INADA Naoki :
>>> Always use UTF-8 (...)
>>Please don't! (...)
>
> For stdio (including console), PYTHONIOENCODING can be used for
> supporting legacy system.
> e.g. `export PYTHONIOENCODING=$(locale charmap)`
The problem with ignoring the
2017-01-07 1:06 GMT+01:00 Barry Warsaw :
> For some reason it's not configured: (...)
Ok, thanks for the information.
> I'm not sure why that's the default inside a chroot.
I found at least one good reason to use the POSIX locale to build a
package: it helps to get
2017-01-06 7:22 GMT+01:00 Stephan Houben :
> How common is this problem?
Last 2 or 3 years, I don't recall having be bitten by such issue.
On the bug tracker, new issues are opened infrequently.
* http://bugs.python.org/issue19977 opened at 2013-12-13, closed at 2014-04-27
2017-01-06 10:50 GMT+01:00 M.-A. Lemburg :
> Victor: I think you are taking the UTF-8 idea a bit too far.
Hum, sorry, the PEP is still a draft, the rationale is far from
perfect yet. Let me try to simplify the issue: users are unable to
configure a locale for various reasons and
> https://www.python.org/dev/peps/pep-0540/
I read the PEP 538, PEP 540, and issues related to switching to UTF-8. At
least, I can say one thing: people have different points of view :-)
To understand why people disagree, I tried to categorize the different point of
views and Python
Le 24 déc. 2016 8:42 PM, "Neil Girdhar" a écrit :
> Usually, when an exception is hit that will (probably) crash the program,
no one cares about less than a microsecond of performance.
Just one example. By design, hasattr(obj, name) raises an exception to
return False.
So
2017-03-22 2:14 GMT+01:00 Victor Stinner <victor.stin...@gmail.com>:
>> Python documentation GitHub organization: https://github.com/python-docs/
>
> I tried to create a team in the GitHub Python organization. It works.
> But then I don't have the right to add ne
*If* we change something, I would prefer to modify sys.stdout. The
following issue proposes to add
sys.stdout.set_encoding(errors='replace'):
http://bugs.python.org/issue15216
You can already set the PYTHONIOENCODING environment variable to
":replace" to use "replace" on sys.stdout (and
as shown in a previous
email.
Victor
Le 25 mars 2017 8:50 PM, "Michel Desmoulin" <desmoulinmic...@gmail.com> a
écrit :
Le 24/03/2017 à 17:37, Victor Stinner a écrit :
> *If* we change something, I would prefer to modify sys.stdout. The
> following issue proposes to add
> sys.s
I assigned the number 545 to the PEP. It should be online in less than
2 hours (I don't know what and how PEPs are rendered on python.org)
at:
https://www.python.org/dev/peps/pep-0545/
Victor
___
Python-ideas mailing list
Python-ideas@python.org
> Python documentation GitHub organization: https://github.com/python-docs/
I tried to create a team in the GitHub Python organization. It works.
But then I don't have the right to add new members, since "I'm not an
organization owner". IMHO the Python organization is too strict for
such
> Contributor Agreement
> '
>
> Contributions to translated documentation will be requested to sign the
> Python Contributor Agreement (CLA):
>
> https://www.python.org/psf/contrib/contrib-form/
I'm not sure about this requirement, but I'm not a lawyer. I guess
that in case of
Thread safety is very complex and has an impact on performance. I dislike
the idea of providing such property to generators which can have a complex
next method.
IMHO it's better to put a generator in wrapper which adds thread safety.
What do you think?
Victor
Le 14 avr. 2017 18:48, "Serhiy
Would it be possible to create a PyPI project to experiement the API and
wait until we collected enough user feedback first?
Currently socket is low level. Not sure if I like the idea of putting more
high level features in it? Asyncio is a good place for high level features,
but is limited to
2017-03-03 6:13 GMT+01:00 Mike Miller :
> Agreed, I've rarely found a need for a "second None" or sentinel either, but
> once every few years I do. So, this use case doesn't seem to be common
> enough to devote special syntax or a keyword to from my perspective.
The
Since yet another sentinel singleton sounds like a dead end, I suggest
to use [arg=value] syntax and require a default value in the
prototype, as currently required for *optional keyword* arguments.
"[...]" syntax for optional parameter is commonly used in Python
documentation (but the exact
In my code, I commonly use a NOT_SET singleton used as default value. I
like this name for the test:
if arg is NOT_SET: ...
;-)
I use that when I want to behave differently when None is passed. And yes,
I have such code.
Victor
Le 2 mars 2017 9:36 AM, "M.-A. Lemburg" a écrit
PEP. Are you up for writing it, Victor, or is someone else going to write
> it?
>
> On Tue, 28 Feb 2017 at 13:18 Victor Stinner <victor.stin...@gmail.com>
> wrote:
>
>> Hi,
>>
>> For technical reasons, many functions of the Python standard libraries
>> implemente
2017-03-01 21:52 GMT+01:00 Terry Reedy :
> + 1 also. When people write a Python equivalent of a built-in function for
> documentation or teaching purposes, they should be able to exactly mimic the
> API.
Yeah, Serhiy said basically the same thing: it's doable, but complex
2017-03-02 14:23 GMT+01:00 Steven D'Aprano :
>> Replace "replace(self, old, new, count=-1, /)" with "replace(self,
>> old, new[, count=-1])" (or maybe even not document the default
>> value?).
>
> That isn't right. It would have to be:
>
> replace([self, old, new, count=-1])
>
2017-07-13 15:21 GMT+02:00 Nick Coghlan :
> As far as I know, this isn't really why folks find the stable ABI hard
> to switch to. Rather, I believe it's because switching to the stable
> ABI means completely changing how you define classes to be closer to
> the way you define
> Step 3: first pass of implementation detail removal
> ---
>
> Modify the ``python`` API:
>
> * Add a new ``API`` subdirectory in the Python source code which will
> "implement" the Python C API
> * Replace macros with functions. The
2017-07-12 20:51 GMT+02:00 Brett Cannon :
> I also think the motivation doesn't have to be performance but simply
> cleaning up how we expose our C APIs to users as shown by the fact we have
> messed up the stable API by making it opt-out instead of opt-in.
It's hard to sell a
For me, namedtuple was first used to upgrade an old API from returning a
tuple to a "named" tuple. There was a hard requirement on backward
compatibility: namedtuple API is a superset of the tuple API.
For new code, there is no such backward compatibility issue. If you don't
need a type,
Supporting a new kind of string storage would require a lot of efforts.
There are a lot of C code specialized for each Unicode kind
Victor
Le 19 juil. 2017 12:43 AM, "Jim J. Jewett" a écrit :
> Ronald Oussoren came up with a concrete use case for wanting the
> interpreter
Le 20 juil. 2017 3:49 AM, "INADA Naoki" a écrit :
> I'm +1 with your idea in performance point of view.
(...)
But ABC is too heavy to use only for checking abstract methods.
It uses three inefficient WeakSet [1] and it overrides isinstance and
issubclass
with slow Python
2017-07-19 4:34 GMT+02:00 Nick Coghlan :
> 2. Indicate that it's a "lazily rendered" subclass that should hold
> off on calling PyUnicode_Ready for as long as possible, but still do
> so when necessary (akin to creating strings via the old Py_UNICODE
> APIs and then calling
2017-06-30 1:33 GMT+02:00 Soni L. :
> Step 3. add decimal concatenation operator for numbers: 2 cat 3 == 23, 22
> cat 33 = 2233, etc. if you need bitwise concatenation, you're already in
> bitwise "hack" land so do it yourself. (no idea why bitwise is considered
> hacky as I
2017-06-30 17:09 GMT+02:00 Soni L. :
> CPython should get a tracing JIT that turns slow bytecode into fast
> bytecode.
>
> A JIT doesn't have to produce machine code. bytecode-to-bytecode compilation
> is still compilation. bytecode-to-bytecode compilation works on iOS, and
>
2017-07-02 14:13 GMT+02:00 Steven D'Aprano :
> That only solves the problem of mysum being modified, not whether the
> arguments are ints. You still need to know whether it is safe to call
> some low-level (fast) integer addition routine, or whether you have to
> go through
Let's say that you have a function "def mysum (x; y): return x+y", do you
always want to use your new IADD instruction here? What if I call mysum
("a", "b")?
Victor
___
Python-ideas mailing list
Python-ideas@python.org
> In python 3.6+ this is better since the dictionary is insertion-ordered,
but is still not really what one would probably want.
Be careful: ordered dict is an implementation detail. You must use
explicitly collections.OrderedDict() to avoid bad surprises.
In CPython 3.7, dict might change
2017-06-20 4:05 GMT+02:00 INADA Naoki :
> Namedtuple in Python make startup time slow.
> So I'm very conservative to convert tuple to namedtuple in Python.
> INADA Naoki
While we are talking about startup time, I would be curious of seeing
the
Hi,
2017-06-13 22:13 GMT+02:00 Thomas Güttler :
> AFAIK the socket module returns plain tuples in Python3:
>
> https://docs.python.org/3/library/socket.html
>
> Why not use named tuples?
For technical reasons: the socket module is mostly implemented in the
C
n create a PR?
> (First open an issue stating that you're interested; point to this email
> from me to prevent that some other core dev just closes it again.)
>
> On Mon, Jun 19, 2017 at 2:24 PM, Victor Stinner <victor.stin...@gmail.com>
> wrote:
>
>> Hi,
>>
2017-06-02 9:12 GMT+02:00 Greg Ewing :
> Why do you want to change it?
To make Python more secure. To prevent untrusted modules hijacking
stdlib modules on purpose to inject code for example.
Victor
___
Python-ideas mailing
> (AIUI, the *current directory* is never on Python's path, but the
*script directory* is. They're the same thing a lot of the time.)
Oh, it's very common that I run a script from its directory, so yeah script
directory = current directory on such case. Sorry for the confusion. You
are right,
Le 5 juin 2017 00:52, "Guido van Rossum" a écrit :
I really don't want people to start using the "from . import foo" idiom for
their first steps into programming. It seems a reasonable "defensive
programming" maneuver to put in scripts and apps made by professional
Python
Hi,
Perl 5.26 succeeded to remove the current working directory from the
default include path (our Python sys.path):
https://metacpan.org/pod/release/XSAWYERX/perl-5.26.0/pod/perldelta.pod#Removal-of-the-current-directory-(%22.%22)-from-@INC
Would it technically possible to make this change in
2017-06-01 8:47 GMT+02:00 Serhiy Storchaka :
> What you are think about adding Unicode aliases for some mathematic names in
> the math module? ;-)
>
> math.π = math.pi
How do you write π (pi) with a keyboard on Windows, Linux or macOS?
Victor
A stricter mock object cannot be a bad idea :-) I am not sure about your
proposed API: some random code may already use this attribute. Maybe it can
be a seal (mock) function which sets a secret attribute with a less common
name?
Yeah, please open an issue on bugs.python.org ;-)
Victor
Le 29
2017-05-05 0:20 GMT+02:00 Greg Ewing :
> While most uses would probably be for short strings, I can
> think of uses cases involving large ones. For example, to
> format a hex dump into lines with 8 bytes per line and spaces
> between the lines:
For such specialized
Instead of modifying the Python grammar, the alternative is to enhance
float(str) to support it:
k = float("0x1.2492492492492p-3") # 1/7
Victor
2017-09-08 8:57 GMT+02:00 Serhiy Storchaka :
> The support of hexadecimal floating literals (like 0xC.68p+2) is included in
> just
Antoine:
>> * skip a test if it allocates too much memory, command line argument
>> to specify how many memory a test is allowed to allocate (ex:
>> --memlimit=2G for 2 GB of memory)
>
> That would be suitable for a plugin if unittest had a plugin
> architecture, but not as a core functionality
>> * --timeout: watchdog killing the test if the run time exceed the
>> timeout in seconds (use faulthandler.dump_traceback_later)
>
> This feature looks functionally similar to limiting memory usage.
Hum, I don't think so. Limiting the memory usage doesn't catch
deadlocks for example.
Victor
2017-09-21 3:53 GMT+02:00 Steven D'Aprano :
> float.fromhex(s) if s.startswith('0x') else float(s)
My vote is now -1 on extending the Python syntax to add hexadecimal
floating literals.
While I was first in favor of extending the Python syntax, I changed
my mind. Float
Le 14 sept. 2017 01:01, "Eric Snow" a écrit :
In the case of
sys.modules, the problem is that assigning a bogus value (e.g. []) can
cause the interpreter to crash. It wasn't a problem until recently
when I removed PyInterpreterState.modules and made sys.modules
> Might it make more sense to have a parallel *module* that works with a
different base data type rather than parallel functions within the existing
API?
I asked about adding new functions to 4 different modules: os, resource,
signal, time.
For example, I dislike the idea of having os and os_ns
APIs are expensive and we'd like to be future-proof, why not
> move to picoseconds? That would be safe until clocks reach the THz
> barrier, which is quite far away from us.
>
> Regards
>
> Antoine.
>
>
> On Fri, 13 Oct 2017 16:12:39 +0200
> Victor Stinner <victor.st
2017-10-16 3:19 GMT+02:00 Juancarlo Añez :
> It could be: time.time(ns=True)
Please read my initial message:
"""
[PEP 410] was rejected for different reasons:
(...)
* Guido van Rossum rejected the idea of adding a new optional
parameter to change the result type: it's an
Hi,
> What if we had a class, say time.time_base. The user could specify the base
> units (such as "s", "ns", 1e-7, etc) and the data type ('float', 'int',
> 'decimal', etc.) when the class is initialized. (...)
It's easy to invent various funny new types for arbitrary precision.
But I prefer
2017-10-16 9:46 GMT+02:00 Stephan Houben :
> Hi all,
>
> I realize this is a bit of a pet peeve of me, since
> in my day job I sometimes get people complaining that
> numerical data is "off" in the sixteenth significant digit
> (i.e. it was stored as a double).
> (...)
Oh.
Hi,
FYI I proposed the PEP 564 directly on python-dev.
The paragraph about "picosecond":
https://www.python.org/dev/peps/pep-0564/#sub-nanosecond-resolution
Let's move the discussion on python-dev ;-)
Victor
___
Python-ideas mailing list
2017-10-16 18:13 GMT+02:00 Todd :
> I am not suggesting implementing a new numeric data type. People wouldn't
> use the class directly like they would an int or float, they would simply
> use it to define the the precision and numeric type (float, int, decimal).
> Then they
Hi,
I would like to add new functions to return time as a number of
nanosecond (Python int), especially time.time_ns().
It would enhance the time.time() clock resolution. In my experience,
it decreases the minimum non-zero delta between two clock by 3 times,
new "ns" clock versus current clock:
2017-10-13 16:57 GMT+02:00 Stefan Behnel :
> I might have missed it while skipping through your post, but could you
> quickly explain why improving the precision of time.time() itself wouldn't
> help already? Would double FP precision not be accurate enough here?
80-bit
Hi,
FYI I proposed the PEP 564 on python-dev.
"PEP 564 -- Add new time functions with nanosecond resolution"
https://www.python.org/dev/peps/pep-0564/
Victor
___
Python-ideas mailing list
Python-ideas@python.org
2017-09-07 23:57 GMT-07:00 Serhiy Storchaka :
> The support of hexadecimal floating literals (like 0xC.68p+2) is included in
> just released C++17 standard. Seems this becomes a mainstream.
Floating literal using base 2 (or base 2^n, like hexadecimal, 2^4) is
the only way to
Another example is PyPI showing a bold "Latest version: x.x.x".
Example: https://pypi.python.org/pypi/requests/2.17.0
Victor
2017-09-07 0:52 GMT+02:00 Ryan Gonzalez :
> Right now, many Google searches for Python modules return the Python 2
> documentation. IMO since 2 will be
2017-09-12 1:27 GMT+02:00 Neil Schemenauer :
>> k = float("0x1.2492492492492p-3") # 1/7
>
> Making it a different function from float() would avoid backwards
> compatibility issues. I.e. float() no longer returns errors on some
> inputs.
In that case, I suggest float.fromhex() to
2017-09-12 3:48 GMT+02:00 Steven D'Aprano :
>> k = float("0x1.2492492492492p-3") # 1/7
>
> Why wouldn't you just write 1/7?
1/7 is irrational, so it's not easy to get the "exact value" for a
64-bit IEEE 754 double float.
I chose it because it's easy to write. Maybe math.pi
Hi,
tl; dr How can we extend unittest module to plug new checks
before/after running tests?
The CPython project has a big test suite in the Lib/test/ directory.
While all tests are written with the unittest module and the
unittest.TestCase class, tests are not run directly by unittest, but
run
> 2) Added a new command line option N that allows you to specify
> any number of individual optimization flags.
>
> For example:
>
> python -N nodebug -N noassert -N nodocstring
You may want to look at my PEP 511 which proposes to add a new "-o"
option to specify a list of
> Title: Core support for generic types
Would it be possible to mention "typing" somewhere in the title? If
you don't know the context, it's hard to understand that the PEP is
related to type annotation and type checks. At least just from the
title.
Victor
2017-11-29 18:30 GMT+01:00 Asen Bozhilov :
> I'd like to propose also literaling syntax for immutable dictionaries.
>
> immutable_dict = (
> 'key1' : 'value1',
> 'key2' : 'value2'
> )
Since Python 3.3, you can write:
vstinner@apu$ python3
Python 3.6.3 (default,
I don't think that we need more than space (U+0020) and Unix newline
(U+000A) ;-)
Victor
2017-11-16 11:23 GMT+01:00 Serhiy Storchaka :
> Currently the re module ignores only 6 ASCII whitespaces in the re.VERBOSE
> mode:
>
> U+0009 CHARACTER TABULATION
> U+000A LINE
2017-11-21 7:33 GMT+01:00 Saeed Baig :
> Hey guys I am thinking of perhaps writing a PEP to introduce user-defined
> constants to Python. Something along the lines of Swift’s “let” syntax (e.g.
> “let pi = 3.14”).
If you want to work on a PEP, you will have to write a
Hi,
While it may shock you, using bytes for "text" makes sense in some
areas. Please read the Motivation of the PEP 461:
https://www.python.org/dev/peps/pep-0461/#motivation
Victor
2017-11-21 15:37 GMT+01:00 Kirill Balunov :
> Currently, __repr__ and __str__
Hi francis,
Le 20 oct. 2017 18:42, "francismb" <franci...@email.de> a écrit :
Hi Victor,
On 10/13/2017 04:12 PM, Victor Stinner wrote:
> I would like to add:
>
> * time.time_ns()
> * time.monotonic_ns()
> * time.perf_counter_ns()
> * time.clock_gettime_ns()
&g
Antoine Pitrou:
> Given the implementation costs, hardware decimal128 will only become
> mainstream if there's a strong incentive for it, which I'm not sure
> exists or will ever exist ;-)
Stefan Behnel:
> Then we shouldn't implement the new nanosecond API at all, in order to keep
> pressure on
+1
The idea is not new and I like it.
Naoki created https://bugs.python.org/issue32677
Victor
2018-01-26 11:22 GMT+01:00 Antoine Pitrou :
> On Fri, 26 Jan 2018 17:42:31 +0900
> INADA Naoki
> wrote:
>>
>> If str has str.isascii() method, it can be
2018-01-26 13:39 GMT+01:00 Steven D'Aprano :
> I have no objection to isascii, but I don't think it goes far enough.
> Sometimes I want to know whether a string is compatible with Latin-1 or
> UCS-2 as well as ASCII. For that, I used a function that exposes the
> size of code
2018-01-26 12:17 GMT+01:00 INADA Naoki :
>> No, because you can pass in maxchar to PyUnicode_New() and
>> the implementation will take this as hint to the max code point
>> used in the string. There is no check done whether maxchar
>> is indeed the minimum upper bound to
2018-01-26 14:43 GMT+01:00 M.-A. Lemburg :
> If that's indeed being used as assumption, the docs must be
> fixed and PyUnicode_New() should verify this assumption as
> well - not only in debug builds using C asserts() :-)
As PyUnicode_FromStringAndSize(NULL, size),
Hi,
Well, I wrote https://faster-cpython.readthedocs.io/ website to answer
to such question.
See for example https://faster-cpython.readthedocs.io/mutable.html
"Everything in Python is mutable".
Victor
2018-01-26 22:35 GMT+01:00 Pau Freixes :
> Hi,
>
> This mail is the
I like the idea of having a fully qualified name that "works" (can be
resolved).
I don't think that repr() should change, right?
Can this change break the backward compatibility somehow?
Victor
Le 11 janv. 2018 21:00, "Serhiy Storchaka" a écrit :
> Currently the classes
I like the idea of str.isdigit(ascii=True): would behave as
str.isdigit() and str.isascii(). It's easy to implement and likely to
be very efficient. I'm just not sure that it's so commonly required?
At least, I guess that some users can be surprised that str.isdigit()
is "Unicode aware", accept
Hi,
There is "blockdiag" which is Sphinx friendly:
http://blockdiag.com/en/blockdiag/sphinxcontrib.html
Look also at:
* http://asciiflow.com/
* http://ditaa.sourceforge.net/
* http://asciidoctor.org/news/2014/02/18/plain-text-diagrams-in-asciidoctor/
* etc.
I like ASCII Art since it doesn't
1 - 100 of 104 matches
Mail list logo