Ethan Furman added the comment:
Jelle: the DirEntry patch looks good so far, but it needs a test for a bytes
path.
--
___
Python tracker
<http://bugs.python.org/issue27
Ethan Furman added the comment:
New changeset 00991aa5fdb5 by Ethan Furman in branch 'default':
issue27182: update fsencode and fsdecode for os.path(); patch by Dusty Phillips
https://hg.python.org/cpython/rev/00991aa5fdb5
(had wrong issue #
Changes by Ethan Furman :
--
Removed message: http://bugs.python.org/msg267280
___
Python tracker
<http://bugs.python.org/issue27182>
___
___
Python-bugs-list m
Ethan Furman added the comment:
Dusty: The pathlib tests looks like it's only testing the PurePath
implementation; while this /should/ be sufficient, please add tests for the
other classes as well.
--
___
Python tracker
<http://bugs.py
Ethan Furman added the comment:
The expected scenario, and the purpose of os.fspath(), is to enable high-level
libraries to not know or care if they receive a pathlib object or a string.
In other words, they already have os.path.join() and os.path.split() calls, and
currently break noisily if
Ethan Furman added the comment:
Sorry, Serhiy, I had my module names mixed up.
`nt` and `posix` are the same, but `ntpath` and `posixpath` are not (I may have
those first two names wrong again, but hopefully you get the idea).
--
___
Python tracker
Ethan Furman added the comment:
Note: My schedule changed -- I won't be at the sprints today, but tomorrow.
I'll finish reviewing these patches and commit this afternoon if no one beats
me to it.
--
___
Python tracker
<http://bu
Ethan Furman added the comment:
@Serhy: Isn't that backwards? I would think that by doing os.path first most
other libraries would not have to change.
--
___
Python tracker
<http://bugs.python.org/is
Ethan Furman added the comment:
One possible downside to the `classattribute` route is that we have a
descriptor whose only purpose is to shield the item from becoming a member; the
up-side is that it's simple to implement.
Another possibility is `skip`:
class skip:
""&quo
Ethan Furman added the comment:
Nope.
There is a posixpath.py and an ntpath.py, and they are not the same.
--
___
Python tracker
<http://bugs.python.org/issue27
Changes by Ethan Furman :
--
nosy: brett.cannon, ethan.furman, serhiy.storchaka
priority: normal
severity: normal
stage: test needed
status: open
title: add os.fspath()
type: enhancement
versions: Python 3.6
___
Python tracker
<h
Ethan Furman added the comment:
os.fspath(): issue27186
--
dependencies: +add os.fspath()
___
Python tracker
<http://bugs.python.org/issue27182>
___
___
Python-bug
Changes by Ethan Furman :
--
type: behavior -> enhancement
___
Python tracker
<http://bugs.python.org/issue27184>
___
___
Python-bugs-list mailing list
Un
Changes by Ethan Furman :
--
dependencies: +Support Path objects in the posix module, Support path objects
in the nt module, Update importlib to accept pathlib.Path objects
type: -> behavior
versions: +Python 3.6
___
Python tracker
&l
Changes by Ethan Furman :
--
type: behavior -> enhancement
___
Python tracker
<http://bugs.python.org/issue27182>
___
___
Python-bugs-list mailing list
Un
Ethan Furman added the comment:
nt module: issue27184
--
___
Python tracker
<http://bugs.python.org/issue27182>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: brett.cannon, ethan.furman, serhiy.storchaka
priority: normal
severity: normal
stage: test needed
status: open
title: Support path objects in the nt module
type: behavior
versions: Python 3.6
___
Python tracker
Ethan Furman added the comment:
importlib: issue26667
--
___
Python tracker
<http://bugs.python.org/issue27182>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
posix module: issue26027
--
___
Python tracker
<http://bugs.python.org/issue27182>
___
___
Python-bugs-list mailing list
Unsub
New submission from Ethan Furman:
Meta issue to track adding PEP 519 support in the various stdlib modules.
--
messages: 266891
nosy: brett.cannon, ethan.furman, serhiy.storchaka
priority: normal
severity: normal
status: open
title: PEP 519 support in the stdlib
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26027>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
title: Better stdlib support for Path objects -> Better stdlib support for Path
objects using .path attribute
___
Python tracker
<http://bugs.python.org/issu
Ethan Furman added the comment:
I think the request is to raise a single PathlibError instead of the broad
range of possible errors. Something like:
try:
blah blah
except TypeError as e:
raise PathlibError(str(e))
Since pathlib is a high level library this seems appropriate
Ethan Furman added the comment:
The BDFL would be the BDFL (Guido van Rossum ;) or whomever he asks to do the
job.
Don't worry too much about drafts. Pick one of the existing PEPs (409 is
fairly short), and follow the same type of layouts. Make your arguments for
what should be ch
Ethan Furman added the comment:
I'm not against them, but there are many diverse opinions.
A PEP will:
- broaden discussion, so all (or at least most) pros and cons can be
considered
- highlight any other pieces of Python that would need to change to
properly support proxies
-
Ethan Furman added the comment:
`issubclass` doesn't "do the right thing", as evidenced by another dev.
Continued complaining to this issue is not going to get you what you want, but
writing a PEP to address the issue might.
--
___
Ethan Furman added the comment:
To change this behavior at this point will require a PEP. The PEP should be
something along the lines of "Add proxy support to builtins" and should address
such things as callable, issubclass, and whatever else is is appropriate.
As for working a
Ethan Furman added the comment:
It's in _EnumDict.__getitem__; there's some duplication in __setitem__ for
supporting Python 2 (although with 2 you have to use either the empty tuple, or
some other handy thing that may go in the __doc__ attribute, f
Ethan Furman added the comment:
On the other hand, if you use aenum you can do:
class Color(AutoNumber):
red
green
blue
And isn't that better*? ;)
* For those in danger of swallowing their tongue over the magic involved: The
magic is turned off as soon as any descript
Changes by Ethan Furman :
--
nosy: +barry, eli.bendersky
___
Python tracker
<http://bugs.python.org/issue26988>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
For the standalone version I suggest a disclaimer about the `from ... import *`
ability. Something like:
`from ... import *` should not be used with packages that do not have an
__all__ unless they support that usage (check their docs
Ethan Furman added the comment:
It would, but that's not what we did.
Currently we have _name_ and _value_; the backport uses __order__ because I
didn't want the stdlib version having a hairball when someone tried to use a
2.7 Enum in 3.4 and it didn't occur to me at the time
New submission from Ethan Furman:
_sunder_ methods are reserved for internal Enum use, and if the user tries to
use any an exception is raised.
Consequently, the enum34 backport uses __order__ instead of _order_ to specify
a definition order for its members.
I would like to do two things:
1
Ethan Furman added the comment:
With the patch:
--> import enum
--> class Huh(enum.IntEnum):
... blah = 2
...
--> Huh.blah.from_bytes(b'\04', 'big')
Traceback (most recent call last):
File "", line 1, in
File "/home/ethan/sou
Ethan Furman added the comment:
I think the classmethod-as-constructor behavior is correct, so it's up to
IntEnum (or EnumMeta, or foo, or ...), to work around the issue.
--
___
Python tracker
<http://bugs.python.org/is
Ethan Furman added the comment:
'from_bytes' is a classmethod. As such, it should return the same type as the
class it is called on. If that wasn't the intent it would be a staticmethod
instead.
It is the responsibility of the subclass to override base class behavior, not
Changes by Ethan Furman :
--
Removed message: http://bugs.python.org/msg237891
___
Python tracker
<http://bugs.python.org/issue23640>
___
___
Python-bugs-list m
Changes by Ethan Furman :
--
Removed message: http://bugs.python.org/msg240053
___
Python tracker
<http://bugs.python.org/issue23640>
___
___
Python-bugs-list m
Changes by Ethan Furman :
--
Removed message: http://bugs.python.org/msg239619
___
Python tracker
<http://bugs.python.org/issue23640>
___
___
Python-bugs-list m
Ethan Furman added the comment:
Not sure what I was thinking at the time, but several of my comments were
supportive of `classmethod`s not calling subclass' __new__; I actually do not
think that, and am +1 on the patch.
--
nosy: +ethan.f
Ethan Furman added the comment:
Thanks for catching that.
--
___
Python tracker
<http://bugs.python.org/issue26893>
___
___
Python-bugs-list mailing list
Unsub
Ethan Furman added the comment:
I'm not clear on what you asking, but regardless we should have both the old
(by-index) tests and new by-attribute tests.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Ethan Furman :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue26879>
___
___
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26865>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
Quick review of patch looks good. I'll try to look it over more closely later.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26860>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Ethan Furman:
https://docs.python.org/3/reference/datamodel.html#creating-the-class-object
This section should mention that the final class is created with a new dict(),
and all key/value pairs from the dict used during creation are copied over.
--
assignee: docs
Changes by Ethan Furman :
--
nosy: +georg.brandl
___
Python tracker
<http://bugs.python.org/issue26823>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
If you can, give it a go. Make it a new patch, though -- don't delete the
existing one.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Ethan Furman :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue26823>
___
___
Python-bugs-list mailing list
Unsubscrib
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26823>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
Enum classes are now Truth-y in 3.4, 3.5, enum34, and aenum. :)
--
assignee: -> ethan.furman
resolution: -> fixed
stage: -> resolved
status: open -> closed
versions: -Python 2.7
___
Python tr
Ethan Furman added the comment:
EnumMeta /is/ a collection (at least in the same sense the dict class is a
collection). ;)
Fix is on it's way...
--
___
Python tracker
<http://bugs.python.org/is
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26667>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
Never mind.
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
New submission from Ethan Furman:
The methods .with_name() and .with_suffix() of pathlib.Path (and friends) do
not allow a name or suffix to be added to a path alone -- I get ValueError(...
has an empty name...).
This is the documented behavior, but it seems incredibly user-unfriendly
Ethan Furman added the comment:
Please discuss this idea on the Python-Ideas mailing list first; if that goes
well you can bring the idea to Python-Dev; if that also goes well feel free to
reopen this issue.
---
In the meantime you could probably do something with a custom descriptor/class
Ethan Furman added the comment:
Not a fan. :/
How about getting your own copy of the public decorator initialized with the
globals you pass in?
class Public:
def __init__(self, module):
"""
module should be the globals() dict from the
Ethan Furman added the comment:
def public(thing, value=None):
if isinstance(thing, str):
mdict = sys._getframe(1).f_globals
name = thing
mdict[name] = thing # no need for retyping! ;)
else:
mdict = sys.modules[thing.__module__].__dict__
name
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26632>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
False and True are subtypes of int, so the behaviour you are seeing is known
and expected.
https://docs.python.org/2/reference/datamodel.html?highlight=bool
In the future feel free to ask on Python-List about behaviour -- you'll be sure
to get a pletho
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26571>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
That particular use-case is easily handled by simply creating the correct
function/method based on the criterion:
if py_ver < 3.6:
def fribbletz():
# do something in a 3.0-3.5 compatible way
else:
def fribbletz():
# otherwise use 3.6 meth
Ethan Furman added the comment:
Barry: po-tay-to / po-tah-to ;)
Serhiy: The set is known and finite, just scattered over different
expensive-to-load modules.
Decision:
Since no one is jumping up and down with anticipation over this feature, I'll
let it stay on SO.
--
resol
New submission from Ethan Furman:
In this SO question [1] the OP has a need to generate an Enum lazily. I
created an `extend_enum` function to do so. By the time I was done I realized
I would not want anyone to have to create that function by hand, nor keep it up
to date (should we ever
Ethan Furman added the comment:
The following behaviour is from 3.5:
--> class Huh:
... def __eq__(self, other):
... return other == 'blah'
...
--> h = Huh()
--> h == 'ew'
False
--> h != 'ew'
True
--> h == 'blah'
True
--> h !=
Ethan Furman added the comment:
Short answer: rationale unknown, but any number of zeroes is still
unambiguously zero.
Closing as duplicate.
--
nosy: +ethan.furman
resolution: -> duplicate
stage: -> resolved
status: open -> closed
_
Ethan Furman added the comment:
I like those code snippets! Thanks, Serhiy!
Just to make sure I have understood correctly: every decimal char is also a
digit char, but some digit chars are not decimal chars.
--
___
Python tracker
<h
New submission from Ethan Furman:
The docs use different explanations for what constitutes a decimal verses a
digit character; consequently I can't tell if they are the same or different,
and if different what the differences are.
---
Ethan Furman added the comment:
I don't see the problem. Every Python platform that has `mktemp` has an
implementation to generate the names, and that implementation can become the
public face instead of `mktemp`. So no more of a burden than `mktemp` is;
likewise for the "cognit
Ethan Furman added the comment:
> The request is for a “get the next path generated by a
> ‘tempfile._get_candidate_names’ generator”, with an approved and
> documented public API.
I don't see any problem with this. Patches welcome.
--
stage:
Ethan Furman added the comment:
https://docs.python.org/3/library/stdtypes.html#str.strip
-
[...] The chars argument is not a prefix or suffix; rather, all combinations of
its values are stripped:
--
nosy: +ethan.furman
resolution
Ethan Furman added the comment:
I don't have a firm opinion at this point -- can you give a few examples of how
this will help in code?
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/is
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26362>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26352>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26331>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
If one is using sum on floats, and a list of -0.0's is a possibility, and the
sign matters... well, I would hope that one is using -0.0 as the start value.
I don't think this is worth "fixing".
--
New submission from Ethan Furman:
The rules for what objects in an Enum become members and which do not are
fairly straight-forward:
__double_underscore__ do not (but is reserved for Python)
_single_underscore_ do not (but is reserved for Enum itself)
any descriptored object (such as functions
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26252>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26186>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
I don't have much experience with the copy module, but I don't see any problems
with the code.
Does copy.copy suffer from the same problem? If yes, is it fixed with this
same patch, or is more work needed?
--
nosy: +et
Ethan Furman added the comment:
Victor, patch was already attached. ;)
--
___
Python tracker
<http://bugs.python.org/issue26202>
___
___
Python-bugs-list mailin
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26174>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
New changeset e4c22eadc25c:
use public 'value'
--
___
Python tracker
<http://bugs.python.org/issue24840>
___
___
Ethan Furman added the comment:
New changeset: 52dc28ee3c88
--
resolution: -> rejected
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Ethan Furman added the comment:
Not using Enum's __str__ was discussed (I think during the initial Enum threads
when PEP435 was being debated) and IIRC Guido was strongly against it as it
took away half the purpose of using an Enum.
--
___
P
Ethan Furman added the comment:
Mike, my apologies. In the future I'll make sure and read the docs before I go
through with changes.
In the docs (https://www.python.org/dev/peps/pep-0435/#id35):
The reason for defaulting to 1 as the starting number and
not 0 is that 0 is False
Ethan Furman added the comment:
These changes were made in issue21793.
--
___
Python tracker
<http://bugs.python.org/issue26123>
___
___
Python-bugs-list mailin
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26123>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
Nice work with the debugging. but what you have proved is that Python is
behaving exactly as designed [0].
While true that the current implementation does have the pitfall you have
discovered, removing it is not worth the cost in complexity.
The proper &quo
Ethan Furman added the comment:
As I recall, if the platform's DirEntry doesn't provide the cacheable
attributes when first called, those attributes will be looked up (and cached)
on first access.
--
nosy: +ethan.furman
___
Python trac
Ethan Furman added the comment:
The .replace() method is not recursive (it only makes one pass through the
string), so for example:
>>> example = ' ' # three spaces
>>> example = example.replace(' ', ' ') # replace two spaces wi
Changes by Ethan Furman :
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue26005>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ethan Furman added the comment:
lstrip() works by removing any of the characters in its argument, in any order;
for example:
'catchy'.lstrip('cat')
# 'hy'
'actchy'.lstrip('tac')
# 'hy'
is stripping, from the left, all 'c
Ethan Furman added the comment:
The enum34 backport has been fixed to not have 3.6 only features (assuming the
__bool__ change was the only one).
Was that your only objection, or do you not want this change in 3.6 either?
--
___
Python tracker
Ethan Furman added the comment:
+1 for sequences
+1 for subsequence_index instead of has_subsequence
+1 for returning None when not found ;)
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue25
Changes by Ethan Furman :
--
nosy: +rhettinger
___
Python tracker
<http://bugs.python.org/issue25898>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ethan Furman :
--
title:
unexpected-output-using-pythons-ternary-operator-in-combination-with-lambda ->
unexpected output using pythons ternary operator in combination with lambda
___
Python tracker
<http://bugs.python.org/issu
Ethan Furman added the comment:
Floating point calculations are not exact.
https://docs.python.org/3/tutorial/floatingpoint.html
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
--
nosy: +ethan.furman
resolution: -> not a bug
stage: -> resolved
status: open -&g
Ethan Furman added the comment:
Note for posterity: the current behavior of __getattr__ is what allows Enum to
work correctly.
--
nosy: +ethan.furman
___
Python tracker
<http://bugs.python.org/issue25
801 - 900 of 1868 matches
Mail list logo