On Wed, Apr 13, 2016, at 23:27, Nick Coghlan wrote:
> In this kind of case, inheritance tends to trump protocol. For
> example, int subclasses can't override operator.index:
...
> The reasons for that behaviour are more pragmatic than philosophical:
> builtins and their subclasses are extensively
On Wed, Apr 13, 2016, at 23:17, Nick Coghlan wrote:
> - os.fspath -> str (no coercion)
> - os.fsdecode -> str (with coercion from bytes)
> - os.fsencode -> bytes (with coercion from str)
> - os._raw_fspath -> str-or-bytes (no coercion)
>
> (with "coercion" referring to how the result of
On 14 April 2016 at 13:14, Ethan Furman wrote:
> On 04/13/2016 07:57 PM, Nikolaus Rath wrote:
>> Either I haven't understood your answer, or you haven't understood my
>> question. I'm concerned about this case:
>>
>>class Special(bytes):
>>def __fspath__(self):
>>
On 14 April 2016 at 12:49, Nick Coghlan wrote:
> The API could be something like:
>
> - os.fspath -> str-or-bytes
> - os.fsencode -> bytes (with coercion from str)
> - os.fsdecode -> str (with coercion from bytes)
> - os.strpath -> str (no coercion)
There seems to be fairly
On 04/13/2016 07:57 PM, Nikolaus Rath wrote:
On Apr 13 2016, Ethan Furman wrote:
On 04/13/2016 03:45 PM, Nikolaus Rath wrote:
When passing an object that is of type str and has a __fspath__
attribute, all approaches return the value of __fspath__().
However, when passing something of type
On 14 April 2016 at 08:26, Victor Stinner wrote:
> 2016-04-14 0:11 GMT+02:00 Ryan Gonzalez :
>> So code that depends on iterating through bytecode via HAS_ARG is going to
>> break...
>
> Sure. This change is backward incompatible for applications
On Apr 13 2016, Ethan Furman wrote:
> On 04/13/2016 03:45 PM, Nikolaus Rath wrote:
>
>> When passing an object that is of type str and has a __fspath__
>> attribute, all approaches return the value of __fspath__().
>>
>> However, when passing something of type bytes, the
On 14 April 2016 at 07:37, Victor Stinner wrote:
> Le mercredi 13 avril 2016, Brett Cannon a écrit :
>>
>> All of this is demonstrated in
>> https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1 by the
>> various possibilities. In the
On Apr 13, 2016 19:06, Brett Cannon wrote:
> On Wed, 13 Apr 2016 at 15:46 Nikolaus Rath wrote:
>> When passing an object that is of type str and has a __fspath__
>> attribute, all approaches return the value of __fspath__().
>>
>> However, when passing
On Apr 13, 2016 20:06, Chris Barker wrote:
>
> In this case, I don't know that we need to be tolerant of buggy __fspathname__() implementations -- they should be tested outside these checks, and not be buggy. So a buggy implementation may raise and may be ignored,
On 04/13/2016 05:06 PM, Chris Barker wrote:
In this case, I don't know that we need to be tolerant of buggy
__fspathname__() implementations -- they should be tested outside these
checks, and not be buggy. So a buggy implementation may raise and may be
ignored, depending on what Exception the
On Wed, Apr 13, 2016 at 1:47 PM, Random832 wrote:
> On Wed, Apr 13, 2016, at 16:39, Chris Barker wrote:
> > so are we worried that __fspath__ will exist and be callable, but might
> > raise an AttributeError somewhere inside itself? if so isn't it broken
> > anyway, so
On Wed, 13 Apr 2016 at 15:20 Victor Stinner
wrote:
> Oh, since others voted, I will also vote and explain my vote.
>
> I like choice 1, str only, because it's very well defined. In Python
> 3, Unicode is simply the native type for text. It's accepted by almost
> all
On Wed, 13 Apr 2016 at 15:46 Nikolaus Rath wrote:
> On Apr 13 2016, Brett Cannon wrote:
> > On Tue, 12 Apr 2016 at 22:38 Michael Mysinger via Python-Dev <
> > python-dev@python.org> wrote:
> >
> >> Ethan Furman stoneleaf.us> writes:
> >>
> >> > Do we allow
On 04/13/2016 03:45 PM, Nikolaus Rath wrote:
When passing an object that is of type str and has a __fspath__
attribute, all approaches return the value of __fspath__().
However, when passing something of type bytes, the second approach
returns the object, while the third returns the value of
On Apr 13 2016, Brett Cannon wrote:
> On Tue, 12 Apr 2016 at 22:38 Michael Mysinger via Python-Dev <
> python-dev@python.org> wrote:
>
>> Ethan Furman stoneleaf.us> writes:
>>
>> > Do we allow bytes to be returned from os.fspath()? If yes, then do we
>> > allow bytes from
On 2016-04-13 12:24 PM, Victor Stinner wrote:
Can someone please review the change?
+1 for the change. I can take a look at the patch in a few days.
Yury
___
Python-Dev mailing list
Python-Dev@python.org
2016-04-14 0:11 GMT+02:00 Ryan Gonzalez :
> So code that depends on iterating through bytecode via HAS_ARG is going to
> break...
Sure. This change is backward incompatible for applications parsing
bytecode in C or Python. That's why the patch also has to update the
dis module.
Oh, since others voted, I will also vote and explain my vote.
I like choice 1, str only, because it's very well defined. In Python
3, Unicode is simply the native type for text. It's accepted by almost
all functions. In other emails, I also explained that Unicode is fine
to store undecodable
So code that depends on iterating through bytecode via HAS_ARG is going to
break...
Darn it. :/
--
Ryan
[ERROR]: Your autotools build scripts are 200 lines longer than your
program. Something’s wrong.
http://kirbyfan64.github.io/
On Apr 13, 2016 4:44 PM, "Victor Stinner"
Le mercredi 13 avril 2016, Ryan Gonzalez a écrit :
> What is the value of HAS_ARG going to be now?
>
I asked Demur to keep HAS_ARG(). Not really for backward compatibility, but
for the dis module: to keep a nice assembler. There are also debug traces
in ceval.c which use it.
(Cross-posting to python-buildbots, discussion is probably best continued there)
On Wed, Apr 13, 2016 at 3:37 PM, Brett Cannon wrote:
> On Wed, 13 Apr 2016 at 13:17 Zachary Ware
> wrote:
>> After receiving a suggestion from koobs several months
Oops sorry, I forgot to add that I have no strong opinion on the type (I
only have a minor preference for str only).
Victor
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
Le mercredi 13 avril 2016, Brett Cannon a écrit :
>
> All of this is demonstrated in
> https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1 by
> the various possibilities. In the end it's not a corner case because the
> definition of __fspath__ will be such that
The EXTENDED_ARG is included in the multibyte ops, I treat it just like any
other operator. Here's a snippet of my hacked-dis.dis output, which made
it clear to me that I could just count them as an "operator with word
operand."
Line 3000: x = x if x or not x and x is None else x
0001dc83 7c 00
What is the value of HAS_ARG going to be now?
--
Ryan
[ERROR]: Your autotools build scripts are 200 lines longer than your
program. Something’s wrong.
http://kirbyfan64.github.io/
On Apr 13, 2016 11:26 AM, "Victor Stinner" wrote:
> Hi,
>
> In the middle of recent
2016-04-13 23:02 GMT+02:00 Eric Fahlgren :
> Percentage of 1-byte args= 96.80%
Yeah, I expected such high ratio. Good news that you confirm it.
> Non-argument ops =53,719
> One-byte args= 368,787
> Multi-byte args =
On Wednesday, April 13, 2016 09:25, Victor Stinner wrote:
> The side effect of wordcode is that arguments in 0..255 now uses 2 bytes per
> instruction instead of 3, so it also reduce the size of bytecode for the most
> common case.
>
> Larger argument, 16-bit argument (0..65,535), now uses 4
On Wed, Apr 13, 2016, at 16:39, Chris Barker wrote:
> so are we worried that __fspath__ will exist and be callable, but might
> raise an AttributeError somewhere inside itself? if so isn't it broken
> anyway, so should it be ignored?
Well, if you're going to say "ignore the protocol because it's
On Wed, 13 Apr 2016 at 13:40 Chris Barker wrote:
> so are we worried that __fspath__ will exist and be callable, but might
> raise an AttributeError somewhere inside itself? if so isn't it broken
> anyway, so should it be ignored?
>
It should propagate instead of
so are we worried that __fspath__ will exist and be callable, but might
raise an AttributeError somewhere inside itself? if so isn't it broken
anyway, so should it be ignored?
and I know it's asking poermission rather than forgiveness, but what's
wrong with:
if hasattr(path, "__fspath__"):
On Wed, 13 Apr 2016 at 13:17 Zachary Ware
wrote:
> [SNIP]
> ---
>
> After receiving a suggestion from koobs several months ago, I've been
> intermittently thinking about completely redoing our buildmaster setup
> such that instead of a single builder per version on
On Wed, Apr 13, 2016 at 6:40 AM, Victor Stinner
wrote:
> Hi,
>
> Last months, most 3.x buildbots failed randomly. Some of them were
> always failing. I spent some time to fix almost all Windows and Linux
> buildbots. There were a lot of different issues.
Thank you for
On Wed, Apr 13, 2016 at 5:56 AM, Stephen J. Turnbull wrote:
> The following is my opinion, as will become obvious, but it's based on
> over a decade of observing these lists, and other open source
> development lists. In a context where some core developers have
>
On Wed, 13 Apr 2016 at 12:39 Fred Drake wrote:
> On Wed, Apr 13, 2016 at 3:24 PM, Chris Angelico wrote:
> > Is that the intention, or should the exception catching be narrower? I
> > know it's clunky to write it in Python, but AIUI it's less so in C:
> >
> >
On Thu, Apr 14, 2016 at 5:46 AM, Random832 wrote:
> On Wed, Apr 13, 2016, at 15:24, Chris Angelico wrote:
>> Is that the intention, or should the exception catching be narrower? I
>> know it's clunky to write it in Python, but AIUI it's less so in C:
>
> How is it less so
On Wed, Apr 13, 2016, at 15:24, Chris Angelico wrote:
> Is that the intention, or should the exception catching be narrower? I
> know it's clunky to write it in Python, but AIUI it's less so in C:
How is it less so in C? You lose the ability to PyObject_CallMethod.
On 4/13/2016 13:49, Ethan Furman wrote:
Number 3: it allows bytes, but only when told it's okay to do so.
Having code get a bytes object when one is not expected is not a
headache we need to inflict on anyone.
This is an artifact of the other needless restrictions I said I wouldn't
rant
On Thu, Apr 14, 2016 at 5:30 AM, Brett Cannon wrote:
>
>
> On Wed, 13 Apr 2016 at 12:25 Chris Angelico wrote:
>>
>> On Thu, Apr 14, 2016 at 3:10 AM, Brett Cannon wrote:
>> >
On Wed, Apr 13, 2016 at 3:24 PM, Chris Angelico wrote:
> Is that the intention, or should the exception catching be narrower? I
> know it's clunky to write it in Python, but AIUI it's less so in C:
>
> try:
> callme = path.__fspath__
> except AttributeError:
> pass
>
On Wed, 13 Apr 2016 at 12:25 Chris Angelico wrote:
> On Thu, Apr 14, 2016 at 3:10 AM, Brett Cannon wrote:
> > https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1
> has the
> > four potential approaches implemented (although it doesn't follow
On Thu, Apr 14, 2016 at 3:10 AM, Brett Cannon wrote:
> https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1 has the
> four potential approaches implemented (although it doesn't follow the
> "separate functions" approach some are proposing and instead goes with
Brett Cannon python.org> writes:
> In the spirit of Python 3 I feel like bytes might not be needed in practice,
> but something like this with defaults of False will allow people to easily
> test all the various options.
>
>
>
>
On 04/13/2016 10:22 AM, Alexander Walters wrote:
On 4/13/2016 13:10, Brett Cannon wrote:
https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1
has the four potential approaches implemented (although it doesn't
follow the "separate functions" approach some are proposing and
On 4/13/2016 13:10, Brett Cannon wrote:
https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1 has
the four potential approaches implemented (although it doesn't follow
the "separate functions" approach some are proposing and instead goes
with the allow_bytes approach I
On Wed, 13 Apr 2016 at 09:52 Random832 wrote:
> On Wed, Apr 13, 2016, at 11:28, Ethan Furman wrote:
> > On 04/13/2016 08:17 AM, Random832 wrote:
> > > On Wed, Apr 13, 2016, at 10:21, Nick Coghlan wrote:
> >
> > >> I'd expect the main consumers to be os and os.path, and
On Tue, 12 Apr 2016 at 22:38 Michael Mysinger via Python-Dev <
python-dev@python.org> wrote:
> Ethan Furman stoneleaf.us> writes:
>
> > Do we allow bytes to be returned from os.fspath()? If yes, then do we
> > allow bytes from __fspath__()?
>
> De-lurking. Especially since the ultimate goal is
On 04/13/2016 09:58 AM, Brett Cannon wrote:> On Wed, 13 Apr 2016 at
09:19 Fred Drake wrote:
>> I do the same, but... this is one of those cases where a caller will
>> usually be passing a constant directly. If passed as a positional
>> argument, it'll just be confusing ("what's True?" is my
On Apr 13 2016, Ethan Furman wrote:
> (I'm not very good at keeping similar sounding functions separate --
> what's the difference between shutil.copy and shutil.copy2? I have to
> look it up every time).
Well, "2" is more than "" (or 1), so copy2() copies *more* than copy()
On Wed, 13 Apr 2016 at 09:19 Fred Drake wrote:
> On Wed, Apr 13, 2016 at 11:09 AM, Ethan Furman wrote:
> > - a single os.fspath() with an allow_bytes parameter
> > (mostly True in os and os.path, mostly False everywhere
> > else)
>
> -0
>
> > - a
On Wed, Apr 13, 2016, at 11:28, Ethan Furman wrote:
> On 04/13/2016 08:17 AM, Random832 wrote:
> > On Wed, Apr 13, 2016, at 10:21, Nick Coghlan wrote:
>
> >> I'd expect the main consumers to be os and os.path, and would honestly
> >> be surprised if we needed many explicit invocations above that
On Wed, 13 Apr 2016 at 06:14 Stefan Krah wrote:
> Victor Stinner gmail.com> writes:
> > Maybe it's time to move more 3.x buildbots to the "stable" category?
> > http://buildbot.python.org/all/waterfall?category=3.x.stable
>
> +1 I think anything that is actually stable
On 13 April 2016 at 17:31, Ethan Furman wrote:
> On 04/13/2016 09:27 AM, Paul Moore wrote:
>>
>> On 13 April 2016 at 17:18, Fred Drake wrote:
>
>
>>> Names like os.fspath() and os.fssyspath() seem good to me.
>>
>>
>> -1 on fssyspath - the "system" representation is bytes on
On Wed, 13 Apr 2016 at 05:57 Tim Golden wrote:
> On 13/04/2016 12:40, Victor Stinner wrote:
> > Last months, most 3.x buildbots failed randomly. Some of them were
> > always failing. I spent some time to fix almost all Windows and Linux
> > buildbots. There were a lot of
On 04/13/2016 09:27 AM, Paul Moore wrote:
On 13 April 2016 at 17:18, Fred Drake wrote:
Names like os.fspath() and os.fssyspath() seem good to me.
-1 on fssyspath - the "system" representation is bytes on POSIX, but
not on Windows. Let's be explicit and go with fsbytespath().
It will be
Nice work. I think that for CPython, speed is much more important than
memory use for the code. Disk space is practically free for anything
smaller than a video. :-)
On Wed, Apr 13, 2016 at 9:24 AM, Victor Stinner
wrote:
> Hi,
>
> In the middle of recent discussions
On 04/13/2016 09:18 AM, Fred Drake wrote:
On Wed, Apr 13, 2016 at 11:09 AM, Ethan Furman wrote:
- a single os.fspath() with an allow_bytes parameter
(mostly True in os and os.path, mostly False everywhere
else)
-0
- a str-only os.fspathname() and a str/bytes os.fspath()
+1 on using
On Wed, Apr 13, 2016 at 12:27 PM, Paul Moore wrote:
> -1 on fssyspath - the "system" representation is bytes on POSIX, but
> not on Windows. Let's be explicit and go with fsbytespath().
Depends on the semantics; if we're expecting it to return
str-or-bytes, os.fssyspath()
On 13 April 2016 at 17:18, Fred Drake wrote:
> Names like os.fspath() and os.fssyspath() seem good to me.
-1 on fssyspath - the "system" representation is bytes on POSIX, but
not on Windows. Let's be explicit and go with fsbytespath().
But agreed that always-constant boolean
Glad it's working again! And it was a combination or R. David Murray, Ezio
Melotti, Mark Mangoba (
http://pyfound.blogspot.com/2016/04/the-psf-has-hired-it-manager.html in
case you don't know who Mark is), and myself along with Upfront (b.p.o
hosting provider).
On Tue, 12 Apr 2016 at 21:40 Terry
Hi,
In the middle of recent discussions about Python performance, it was
discussed to change the Python bytecode. Serhiy proposed to reuse
MicroPython short bytecode to reduce the disk space and reduce the
memory footprint.
Demur Rumed proposes a different change to use a regular bytecode
using
On Wed, Apr 13, 2016 at 11:09 AM, Ethan Furman wrote:
> - a single os.fspath() with an allow_bytes parameter
> (mostly True in os and os.path, mostly False everywhere
> else)
-0
> - a str-only os.fspathname() and a str/bytes os.fspath()
+1 on using separate functions.
On 04/13/2016 08:17 AM, Random832 wrote:
On Wed, Apr 13, 2016, at 10:21, Nick Coghlan wrote:
I'd expect the main consumers to be os and os.path, and would honestly
be surprised if we needed many explicit invocations above that layer,
other than in pathlib itself.
I made a toy implementation
On Wed, Apr 13, 2016, at 10:21, Nick Coghlan wrote:
> I'd expect the main consumers to be os and os.path, and would honestly
> be surprised if we needed many explicit invocations above that layer,
> other than in pathlib itself.
I made a toy implementation to try this out, and making os.open
On 04/13/2016 07:21 AM, Nick Coghlan wrote:
On 14 April 2016 at 00:11, Paul Moore wrote:
On 13 April 2016 at 14:51, Nick Coghlan wrote:
The potential SE-strings only come back when you pass str, and the
operating system data isn't properly encoded according to the nominal
filesystem
On 14 April 2016 at 00:11, Paul Moore wrote:
> On 13 April 2016 at 14:51, Nick Coghlan wrote:
>> The potentially SE-strings only come back when you pass str, and the
>> operating system data isn't properly encoded according to the nominal
>> filesystem
On 13 April 2016 at 14:51, Nick Coghlan wrote:
> The potentially SE-strings only come back when you pass str, and the
> operating system data isn't properly encoded according to the nominal
> filesystem encoding. They round trip nicely to other operating system
> APIs, but can
On 13 April 2016 at 02:19, Chris Barker wrote:
> So: why use strings as the lingua franca of paths? i.e. the basis of the
> path protocol. maybe we should support only two path representations:
>
> 1) A "proper" path object -- i.e. pathlib.Path or anything else that
>
On 13 April 2016 at 02:15, Ethan Furman wrote:
> On 04/11/2016 04:43 PM, Victor Stinner wrote:
>>
>> Le 11 avr. 2016 11:11 PM, "Ethan Furman" a écrit :
>
>
>>> So my concern in such a case is what happens if we pass this SE
>>> string somewhere else: a UTF-8 file, or over a
Victor Stinner gmail.com> writes:
> Maybe it's time to move more 3.x buildbots to the "stable" category?
> http://buildbot.python.org/all/waterfall?category=3.x.stable
+1 I think anything that is actually stable should be in that category.
> By the way, I don't understand why "AMD64
On 13/04/2016 12:40, Victor Stinner wrote:
> Last months, most 3.x buildbots failed randomly. Some of them were
> always failing. I spent some time to fix almost all Windows and Linux
> buildbots. There were a lot of different issues.
Can I state the obvious and offer a huge vote of thanks for
On 4/13/2016 7:40 AM, Victor Stinner wrote:
> Last months, most 3.x buildbots failed randomly. Some of them were
> always failing. I spent some time to fix almost all Windows and Linux
> buildbots. There were a lot of different issues.
Thanks for all of your work on this, Victor. It's much
On Wed, Apr 13, 2016 at 9:40 PM, Victor Stinner
wrote:
> Maybe it's time to move more 3.x buildbots to the "stable" category?
> http://buildbot.python.org/all/waterfall?category=3.x.stable
Move the Bruces into stable, perhaps? The AMD64 Debian Root one. Been
fairly
Hi,
Last months, most 3.x buildbots failed randomly. Some of them were
always failing. I spent some time to fix almost all Windows and Linux
buildbots. There were a lot of different issues.
So please try to not break buildbots again and remind to watch them sometimes:
74 matches
Mail list logo