l only make sense if you have more
than one thing to do. The advantage of the new async stuff is it allows us to
write in a synchronous manner (making async calls instead of blocking calls)
and the underlying framework takes care of the hassle of using threads or
multiprocessing or whatever.
ception being a UI remaining responsive to the user while the
calculation is processing.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
Path) is a theoretical -- it's
still, basically, a string and hasn't been checked against the file system to
see if it actually exists (or to create it, etc.).
A WindowsPath (PosixPath) does actually have a tie-in to the actual file
system, and can only be instantiated on Windows (Posix)
quot;
...
class B(A):
... @property
... def foo(self): return super().foo.upper()
...
A().foo
'foo'
B().foo
'FOO'
Yes, the get part works. The set part is a pain, and a bit ugly:
super(B, B).foo.__set__(self, value)
There is an issue for this on the tracker: http
ine is, if not the path followed by a beam of light.
Beams of light can be bent by both matter and gravity.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
Lawrence D'Oliveiro is banned from Python List until the new year.
If his posts show up somewhere else (e.g. Usenet), please ignore them. If you
must respond to him please trim out his text so the rest of us don't have to
deal with him.
--
Python List Moderators
--
https://mail.python.org/mai
local changesets to remote repo
statusdisplay status for each repo
updateupdate active files to latest version
$ hgc pull
[mercurial] password:
...
===
It's available via pip. Feedback welcome. :)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
rching for 'float'. Assuming I understand what it's
saying. ;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
repr(), while the change I observed was in str().
But if __str__ is not defined, __repr__ is used. And I believe that is the
case with float. Too lazy to check, though. ;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
class; it could even put it's own __init__ in the class; but to affect things
like instance variables that are added in methods -- well, it is possible, but
it is *a lot* of work.
--
~Ethan~
* Okay, somebody prove me wrong! :)
--
https://mail.python.org/mailman/listinfo/python-list
called
- list(Wonderful) # metaclass called (e.g. SomeMetaClass.__iter__(cls) )
# where cls = Wonderful
Check out http://stackoverflow.com/a/35730545/208880 for a simple demonstration
of a metaclass.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ction and replacement of embedded images.
Has anyone had experience with this, or can point me in the right direction?
Thanks!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
year = ...
month = ...
day = ...
return cls(year, month, day)
If the goal is to make testing easier, one way to do that is:
def __init__(self, ..., queue=None):
if queue is None:
queue = Queue.Queue()
self.queue = queue
--
~Ethan~
--
https://mail.python.org/mailma
idioms in Python does not make good Python code.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 11/03/2016 07:45 AM, Ethan Furman wrote:
On 11/03/2016 01:50 AM, teppo.p...@gmail.com wrote:
The guide is written in c++ in mind, yet the concepts stands for any
programming language really. Read it through and think about it. If
you come back to this topic and say: "yeah, but i
On 11/07/2016 12:46 AM, teppo.p...@gmail.com wrote:
torstai 3. marraskuuta 2016 14.45.49 UTC Ethan Furman kirjoitti:
On 11/03/2016 01:50 AM, teppo wrote:
The guide is written in c++ in mind, yet the concepts stands for any
programming language really. Read it through and think about it. If
On 09/11/2016 21:25, breamore...@gmail.com wrote:
[...filtered...]
Mark, you do not need to be insulting nor condescending.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 11/09/2016 04:30 PM, Michael Torrie wrote:
On 11/09/2016 04:21 PM, Ethan Furman wrote:
On 09/11/2016 21:25, breamore...@gmail.com wrote:
[...filtered...]
Mark, you do not need to be insulting nor condescending.
Agreed. Is he still being filtered on the mailing list? He's still
On 11/09/2016 11:35 PM, breamore...@gmail.com wrote:
http://www.snarky.ca/why-i-took-october-off-from-oss-volunteering
Good article, Mark, thanks for sharing.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ommand added to subprocess,
that deals with it.
See https://mail.python.org/pipermail/python-ideas/2016-November/043620.html
for some good ideas on what would be needed for such a proposal.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
FAULT_SCHEME and forget all about it.
But that's globally global, and I actually want it to only be global to their
own module. Hence my question.
I think you stuck with the same solution Decimal uses: a context that you can
either set globally global, or one that can be used as a context manager.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
print(list(foo, bar))
[ham, eegs, cheese, bacon, toast]
How many items are in that list? (Hint: it isn't 5. ;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
im to your
personal kill-file so you don't have to see his posts.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
e the definition
order of the class attributes; now that Python 3.6 does this by default
it's probably obsolete).
__prepare__ is not obsolete. Enum uses it to set a custom dictionary which
tracks the new members, etc.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
`type.__init__`
wouldn't fail.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
There's a question over on SO [1] asking about an interaction between
SQLAlchemy and postgres which may be related to an SQLA upgrade from
1.0 to 1.1 and the generation of a check clause
Sadly, I don't have any experience with SQLAlchemy -- anybody here
want to take a crack at it?
referring to "einstein1410", who seems to be wasting time
and bandwidth on silly questions.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 01/02/2017 09:53 AM, Wildman via Python-list wrote:
[rude ascii art omitted]
That is a completely inappropriate response.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
7;s decent. He
walks through the problem, explains the rationale, and only has one line of code guarded by the
except clause.
--
~Ethan~
[1]
http://blog.pyspoken.com/2017/01/02/how-best-to-coerce-python-objects-to-integers/
--
https://mail.python.org/mailman/listinfo/python-list
On 01/03/2017 02:47 PM, Chris Angelico wrote:
On Wed, Jan 4, 2017 at 9:42 AM, Ethan Furman wrote:
Aside from calling "except Exception" a "naked except"
If you read the comments, you'll see that he originally had an actual
bare except clause, but then improved the
I think it's decent. He
walks through the problem, explains the rationale, and only has one line of
code guarded by the except clause.
--
~Ethan~
[1] http://blog.pyspoken.com/2017/01/02/how-best-to-coerce-python-objects-to-in
tegers/
--
https://mail.python.org/mailman/listinfo/python-list
On 01/03/2017 02:47 PM, Chris Angelico wrote:
> On Wed, Jan 4, 2017 at 9:42 AM, Ethan Furman wrote:
>> Aside from calling "except Exception" a "naked except"
>
> If you read the comments, you'll see that he originally had an actual
> bare except cla
I call XXX and YYY?
Looks like horizontal, vertical, and corner are as groups -- so I would call YYY "style" and XXX
"default", "bold", and "ascii".
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
quot;, "├─ ", "└─ "
BOLD = "┃ ", "┣━ ", "┗━ "
ASCII = "| ", "|- ", "+- "
def draw_tree(tree, theme=Theme.DEFAULT):
print(theme.v)
print(theme.vr)
print(theme.v)
print(theme.llc)
draw_tree(None)
-- 8< ---
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
iterator access.
In other words, what used to be a completely safe operation now is not.
Thoughts?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 01/07/2017 03:04 PM, Peter Otten wrote:
Ethan Furman wrote:
In Python 2 we have:
dict().keys() \
dict().items() --> separate list() of the results
dict().values() /
and
dict().iter_keys() \
dict().iter_items() --> integrated iter() of the results
id earlier, I admire your persistence -- but take some time and learn
the basic vocabulary as that will make it much easier for you to ask questions,
and for us to give you meaningful answers.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
y has only one item then sure, go for it!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
:-)
Or you can do globals().update(MarxBros.__members__).
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 01/09/2017 08:51 PM, Deborah Swanson wrote:
Ethan Furman wrote, on January 09, 2017 8:01 PM
As I said earlier, I admire your persistence -- but take some
time and learn the basic vocabulary as that will make it much
easier for you to ask questions, and for us to give you
meaningful answers
On 01/09/2017 10:22 PM, Steven D'Aprano wrote:
On Tuesday 10 January 2017 16:55, Ethan Furman wrote:
On 01/09/2017 09:18 PM, Steven D'Aprano wrote:
The docs say that enums can be iterated over, but it isn't clear to me
whether they are iterated over in definition order or val
there.
Agreed.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
Any time you have some base behaviour you want shared amongst multiple
Enum classes. ;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 01/10/2017 08:06 AM, Paul Moore wrote:
On Tuesday, 10 January 2017 15:47:20 UTC, Paul Moore wrote:
On Saturday, 7 January 2017 19:14:43 UTC, Ethan Furman wrote:
Ya know, that looks an /awful/ lot like a collection! Maybe even an Enum? ;)
-- 8
able base type
It doesn't have to be absolutely bulletproof, but anyone wanting to subclass my
class should need to work for it, which hopefully will tell them that they're
doing something unsupported.
Any hints?
Use a metaclass. Have the metaclass create the first one, and
--
Change the "should raise" to a raise, remove the other print()s, and away you
go.
Should work in any Python 3.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ss' iteration.
Subclassing a new data type, such as one with Yes, No, and Maybe, with lots of
code dealing explicitly with those three singletons, would be confusing if not
outright broken.
Both those cases are good candidates for disallowing subclassing.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 01/17/2017 11:05 PM, Steven D'Aprano wrote:
I've given a metaclass that disallows subclassing:
class MyClass(MyParent, metaclass=FinalMeta):
...
Ethan took that one step further by giving a class you inherit from to disallow
subclassing:
class MyClass(MyPar
On 01/18/2017 08:24 AM, Ethan Furman wrote:
On 01/17/2017 11:05 PM, Steven D'Aprano wrote:
I've given a metaclass that disallows subclassing:
class MyClass(MyParent, metaclass=FinalMeta):
...
Ethan took that one step further by giving a class you inherit from to disallow
s
On 01/23/2017 09:34 AM, Chris Angelico wrote:
On Tue, Jan 24, 2017 at 4:24 AM, wrote:
The article is here http://lenkaspace.net/index.php/blog/show/111
I would respond point-by-point if I thought the author had a clue.
Yeah, arguing with that person will be a waste of time.
--
~Ethan
le with Python, instead
using the tags Java, C++, and ActionScript.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
s not a /very/ good reason to make them
different, make them the same.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
k with a custom type (aka using a custom
metaclass) -- but that could be a bunch of work.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 01/24/2017 02:35 PM, Ethan Furman wrote:
On 01/24/2017 01:31 PM, This Wiederkehr wrote:
having a class definition:
class Test():
@classmethod
def __enter__(cls):
pass
@classmethod
def __exit__(cls, exception_type, execption_value, callback):
pass
now using this as a
On 01/27/2017 03:11 PM, Erik wrote:
On 27/01/17 21:36, MRAB wrote:
"loose"? Don't you mean "lose"? (Or possible "lack"?)
Don't you mean 'Or possibly "lack"'?
And this is why books should be reviewed and edited /before pub
On 01/31/2017 02:33 AM, Paul Wolf wrote:
I've created a command line utility for managing text files. It's written in
Python...
That sounds really cool!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
is. Also, a card is either
revealed or concealed, it can't be both and it can't be neither -- so set it in __init__.
As a side note: I find card_name easier to read than cardName. :)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
the production instance?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ursor over
them -- if automatic, there really should be a delay before they gobble up my view.
The new PyPI lists of projects wastes too much space, and the bright blue is
intolerable. I can't use it.
Are the little boxes replaceable by the package authors? That would be
interest
On 03/28/2018 07:50 AM, sumana.hariharesw...@gmail.com wrote:
[snip lots of actions]
Cool, thanks!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
good. :)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 03/29/2018 11:01 AM, Sumana Harihareswara wrote:
On Wednesday, March 28, 2018 at 10:48:52 AM UTC-4, Ethan Furman wrote:
The new PyPI lists of projects wastes too much space, and the bright blue
>> is intolerable. I can't use it.
When you say the bright blue is intolerable, I
us if that's what others see as well)
The python.org color scheme is tolerable. ;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
open that up and report back.
Downloaded, opened: I see the topics on the left, but the main frame is empty; it stays empty no matter which topic I
click on.
Windows 7 Pro, Service Pack 1
Windows 10 Pro
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
[redirecting to list]
On 04/24/2018 09:42 AM, Erik Martinson wrote:
CHM files have a long history of security issues. Windows blocks them by
default. To fix, right-click on the file and go
to properties. In the security section, click the box that says Unblock.
- Erik
--
https://mail.python
On 04/24/2018 12:38 PM, Brian Gibbemeyer wrote:
Thank you Ethan,,, that worked.
[redirecting thanks to Erik]
Thanks, Erik!
;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
27;
Coming from a still largely Python 2 perspective, did all attempts to apply
default encodings disappear in Python 3?
Pretty much, yup. There is no more guessing what encoding to use -- either specify it, or be made aware that you
printed a bytes object.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 05/26/2018 01:00 AM, Steven D'Aprano wrote:
I wish there was a simpler way to define symbols with identity but no
state or behaviour...
Check out the Constant class in aenum. You still might want to customize the
repr, though.
--
~Ethan~
--
https://mail.python.org/mailman/lis
(so I can't rely on current locale settings).
I'm sure this is a solved problem, but I'm not finding those solutions. Any
pointers?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 06/21/2018 10:36 AM, Peter Pearson wrote:
On Thu, 21 Jun 2018 10:12:27 -0700, Ethan Furman wrote:
I need to translate numeric data in a string format into a binary
format. I know there are at least two different methods of
representing parts less that 1, such as "10.5" and &q
On 06/21/2018 12:07 PM, codewiz...@gmail.com wrote:
On Thursday, June 21, 2018 at 1:08:35 PM UTC-4, Ethan Furman wrote:
I need to translate numeric data in a string format into a binary format. I
know there are at least two different
methods of representing parts less that 1, such as "
On 06/21/2018 01:20 PM, Ben Bacarisse wrote:
Ethan Furman writes:
I need to translate numeric data in a string format into a binary
format. I know there are at least two different methods of
representing parts less that 1, such as "10.5" and "10,5". The data
is encoded u
not be members.
Thanks!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 06/28/2018 01:11 AM, Steven D'Aprano wrote:
On Wed, 27 Jun 2018 07:48:53 -0700, Ethan Furman wrote:
[Note: there is a similar thread on Python-Ideas, if you would like to
respond there.]
Consider the following Enum definition:
class Color(Enum):
RED = 1
GREE
ls.year(date.year))
years.add(date.year)
if Weekday(date.isoweekday()) in (Weekday.SATURDAY, Weekday.SUNDAY)
or date in holidays:
continue
days -= 1
return date
@classmethod
def year(cls, year):
"""
Return a list of
On 06/28/2018 10:52 PM, Steven D'Aprano wrote:
On Thu, 28 Jun 2018 18:33:31 -0700, Ethan Furman wrote:
Perhaps I am using Enum incorrectly, but here is my FederalHoliday Enum.
Note that date(), next_business_day, and year() are all callables. The
AutoEnum parent assigns values from 1
On 06/29/2018 05:51 PM, Steven D'Aprano wrote:
So not especially complimentary (sorry Ethan, but that was my first
impression) but not *necessarily* a bad thing either.
No worries! :)
The Jargon File adjective that comes closest is probably gnarly:
Wow, I haven't heard that
x27;t
>> already there?
>
D.setdefault('c', None)
This is how Enum avoids race conditions when setting up the re.RegexType
enumeration.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
t;If you're not part of the solution, you're part of the problem."
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 07/13/2018 11:52 AM, Rhodri James wrote:
I should point out that the number of people I have killfiled in all my
> Internet dealings can be counted on the fingers of one hand.
Your left one? *
--
~Ethan~
* Bonus points for getting the reference. ;)
--
https://mail.python.org/mail
From the Python List sign-up page:
About Python-list: This mailing list is a general discussion list
for the Python programming language.
---
From the Python CoC
A member of the Python community is: Open, Considerate, Respectful
---
There is only a handful of volunteer list moderators, and
On 07/16/2018 06:22 AM, Rhodri James wrote:
On 13/07/18 20:46, Ethan Furman wrote:
On 07/13/2018 11:52 AM, Rhodri James wrote:
I should point out that the number of people I have killfiled in all my
> Internet dealings can be counted on the fingers of one hand.
Your left one? *
* Bo
on the language: in Spanish, "ch" is it's own letter (at least it was when I grew up), so any word containing
it should still contain it when reversed: "chica" would be "acich".
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
nder, or change your
subscription options enter your subscription email address"
So how about you try that?
Reto, your response is inappropriate. If you can't be kind and/or respectful,
let someone else respond.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
list is not the place to be condescending nor mean-spirited. If the urge strikes, pass it up and move to
the next post.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 09/06/2018 07:40 PM, Steven D'Aprano wrote:
On Thu, 06 Sep 2018 13:06:22 -0700, Ethan Furman wrote:
On 09/06/2018 12:42 PM, Reto Brunner wrote:
What do you think the link, which is attached to every email you
receive from the list, is for? Listinfo sounds very promising, doesn'
On 09/10/2018 05:23 AM, Chris Angelico wrote:
On Mon, Sep 10, 2018 at 10:03 PM, Ethan Furman wrote:
Actually, you did say something at the time:
https://mail.python.org/pipermail/python-list
Not sure what this link is stating. Did you intend to link directly to
a post? Or are you saying
On 09/07/2018 05:07 PM, Steven D'Aprano wrote:
On Fri, 07 Sep 2018 07:39:33 +0300, Marko Rauhamaa wrote:
I'm with Ethan on this one.
There was nothing in the original posting that merited ridicule.
Then its a good thing there was nothing in the response that was ridicule.
Ri
oth, satisfying experience, and
I'm considering treating them the same way as methods (they will no
longer be converted into members).
So if you use that functionality, tell me now! :)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
This thread is closed.
--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list
This thread is closed.
--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list
e
to ignore the ban, the two-month period restarts now.
--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list
On 10/01/2018 04:26 PM, Ben Finney wrote:
> Ethan Furman writes:
>> This thread is closed.
>
> Coming from a moderator of this forum, I don't know how that statement
> is to be interpreted.
It should be interpreted as:
- No further discussion should take place on this t
at
your reply belongs to.
Yes. It is extremely annoying when someone top posts and leaves the
entire rest of the discussion still attached at the bottom.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 10/02/2018 03:46 AM, Rhodri James wrote:
On 02/10/18 01:02, Ethan Furman wrote:
It should be interpreted as:
- No further discussion should take place on this thread.
- I've done what I can with the primitive tools at hand to block
any further discussion.
- Continued considerate
On 10/02/2018 02:24 PM, Mark Lawrence wrote:
I fully support Steven D'Aprano. This disgraceful behaviour by the
moderators has been perpetuated by Ethan Thurman who doesn't have the
guts to say things online but has instead sent me a message to my
personal inbox. Please can we
ted, other than the common ML?
On StackOverflow, we would take this to Meta; do we have our Meta?
Sadly, there is not, and we do not.
--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list
ave
your support (and everyone's). Either way, we are not changing our
minds about them.
--
~Ethan~
Python List Moderator
[1] Please correct me if I'm wrong.
[2] If one is needed: his posts can contain profanity, personal attacks,
condescension, and completely inappropriate language.
--
https://mail.python.org/mailman/listinfo/python-list
On 10/10/2018 11:07 AM, Rhodri James wrote:
Now I've had a chance to go back through the archive (it's been that
kind of day at work), I'm going to have to recant. I can't find
anything that Rick wrote in the week or two before the ban
Where are you looking?
x27;s no change, it doesn't show up.
Ergo, if you accidentally replace a tab with spaces, it's a change,
and it shows up.
Unless you have your diff tool set to ignore whitespace-only changes. :(
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
501 - 600 of 1941 matches
Mail list logo