Corey Richardson wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/17/2011 02:47 PM, Ethan Furman wrote:
In Python 3 one can say
--> huh = bytes(5)
Since the bytes type is actually a list of integers, I would have
expected this to have huh being a bytestring with one element --
Ian Kelly wrote:
On Tue, May 17, 2011 at 2:20 PM, Ethan Furman wrote:
The big question, though, is would you do it this way:
some_var = bytes(23).replace(b'\x00', b'a')
or this way?
some_var = bytes(b'a' * 23)
Actually, I would just do it this way:
some_var
Ian Kelly wrote:
On Tue, May 17, 2011 at 2:20 PM, Ethan Furman wrote:
The big question, though, is would you do it this way:
some_var = bytes(23).replace(b'\x00', b'a')
or this way?
some_var = bytes(b'a' * 23)
Actually, I would just do it this way:
some_var
Andrew Berg wrote:
ElementTree doesn't seem to have been updated in a long time, so I'll
assume it won't work with Python 3.
I don't know how to use it, but you'll find ElementTree as xml.etree in
Python 3.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
d[three] = '3'
--> d
{: '1',
: '3',
: '2'}
--> d[1] = '1.0'
--> d[2] = '2.0'
--> d[3] = '3.0'
--> d
{: '3',
1: '1.0',
2: '2.0',
3: '3.0',
: '2',
: '1'}
--> d[2]
'2.0'
--> d[two]
'2'
All information greatly appreciated!
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
Chris Rebert wrote:
On Thu, May 19, 2011 at 10:43 PM, Ethan Furman wrote:
Several folk have said that objects that compare equal must hash equal, and
the docs also state this
http://docs.python.org/dev/reference/datamodel.html#object.__hash__
I'm hoping somebody can tell me what hor
Peter Otten wrote:
Ethan Furman wrote:
Several folk have said that objects that compare equal must hash equal,
and the docs also state this
http://docs.python.org/dev/reference/datamodel.html#object.__hash__
I'm hoping somebody can tell me what horrible thing will happen if this
isn&
Ulrich Eckhardt wrote:
Ethan Furman wrote:
Several folk have said that objects that compare equal must hash equal,
and the docs also state this
http://docs.python.org/dev/reference/datamodel.html#object.__hash__
I'm hoping somebody can tell me what horrible thing will happen if this
isn&
Ethan Furman wrote:
Several folk have said that objects that compare equal must hash equal,
and the docs also state this
http://docs.python.org/dev/reference/datamodel.html#object.__hash__
Two things I didn't make clear originally:
I'm using Python3.
My objects (of type Wierd
Peter Otten wrote:
Ethan Furman wrote:
Peter Otten wrote:
Ethan Furman wrote:
Several folk have said that objects that compare equal must hash equal,
and the docs also state this
http://docs.python.org/dev/reference/datamodel.html#object.__hash__
--> class Wierd():
... def __ini
fits Perl
(or vice versa) better than most. So enjoy it. Ignore anyone who says
otherwise.
+1
If everybody's brain worked the same, we wouldn't have so many different
languages to choose from.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
;t support the buffer API
You are trying to split a bytes object with a str object -- the two are
not compatible. Try splitting with the bytes object b'\t'.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
objects' rather than 'bytestrings' as they are really lists of integers.
Accessing a single element of a bytes object does not return a bytes
object, but rather the integer at that location; i.e.
--> b'xyz'[1]
121
Contrast that with the str type where
--> 'xyz'[1]
'y'
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
ative posts -- please don't
resort to this tactic.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
stop
comparing string at that position
str.endswith(suffix[, start[, end]])
Return True if the string ends with the specified suffix, otherwise
return False. suffix can also be a tuple of suffixes to look for. With
optional start, test beginning at that position. With optional end, stop
compar
sorry - dumb[1]
question?
He asked the question not once, but multiple times (IIRC at least three,
possible more) -- after a while it stops being rhetorical.
I would say also, if you don't want an answer, don't ask the question.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
Ethan Furman wrote:
Any reason this is not a bug?
Looks like someone else beat me to filing:
http://bugs.python.org/issue11828
Looks like they fixed it as well.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
**kwargs)
TypeError: bar() got multiple values for keyword argument 'y'
And the above error is exactly why you don't want to use named arguments
in MI -- because you don't know in what order the methods will be
called, you cannot know which named arguments to supply to the me
Miki Tebeka wrote:
https://docs.google.com/present/view?id=ah82mvnssv5d_162dbgx78gw ;)
+1
That was hilarious.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
raise
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
need to
stay with 2.7.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
that, at least, would be one
less bug waiting to happen.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
on the other "code that can cross-execute on either version"?
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
Henry Olders wrote:
[...] what I want is a function that is free of side effects [...]
Shoot, that's easy! Just write your function to not have any!
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
Henry Olders wrote:
Clearly, making a copy within the function eliminates the possibility of
the side effects caused by passing in mutable objects. Would having the
compiler/interpreter do this automatically make python so much
different?
It would be a different language.
~Ethan~
--
http
raise TypeError (or any exception), the
second object would not get the chance to try.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
bject was buggy -- for __eq__ we'd end up with a False result,
instead of getting the exception propagated. (!)
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
utes now.
Is it just incredibly slow?
Any enlightenment appreciated!
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
sm such as an Event.
--
~Ethan~
* https://docs.python.org/3/library/threading.html
--
https://mail.python.org/mailman/listinfo/python-list
tors* also motivated by the
numerical/scientific community?
--
~Ethan~
* __le__, __gt__, etc.
--
https://mail.python.org/mailman/listinfo/python-list
- (give a dollar back) $5.00
- (give a five back) and $10.00!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
as large as wxPython would not magically make it so the same target dates were hit -- it's not like we have
core-devs sitting idly by waiting for something to do.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
t teaching is hard, but please don't make learning harder than it already is. One does not need to
understand fluid dynamics nor specific gravity in order to swim.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
your messages will be auto-discarded at the Usenet/mailing list
boundary.
Everyone else, please do not quote Stefan's messages as they may then end up on the mailing list possibly violating his
copyright.
--
~Ethan~
[1] https://mail.python.org/mailman/listinfo/python-list
--
https://mail.python.org/mailman/listinfo/python-list
On 12/05/2017 09:27 PM, km wrote:
[snip]
Many things in this world are frustrating, but being hateful will not solve
anything. Please control yourself.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
05/2017 09:27 PM, km wrote:
> You people can Google and watch movies / songs online and you can't find
> how to download and install python ? That's ridiculous!
Really, Steve?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
pam')
'spam'
--> identity('spam', 'eggs', 7)
('spam', 'eggs', 7)
Of the five answers to that SO question, mine is the only one that will correctly handle those three examples. If you
agree with my contention feel free to up-vote my answer.
On 12/07/2017 10:53 AM, Peter Otten wrote:
Ethan Furman wrote:
The simple answer is No, and all the answers agree on that point.
It does beg the question of what an identity function is, though.
My contention is that an identity function is a do-nothing function that
simply returns what it
On 12/07/2017 11:23 AM, Ned Batchelder wrote:
On 12/7/17 1:28 PM, Ethan Furman wrote:
--> identity('spam', 'eggs', 7)
('spam', 'eggs', 7)
I don't see why this last case should hold. Why does the function take more
than one argument? An
On 12/07/2017 11:46 AM, Paul Moore wrote:
On 7 December 2017 at 18:28, Ethan Furman wrote:
The simple answer is No, and all the answers agree on that point.
It does beg the question of what an identity function is, though.
My contention is that an identity function is a do-nothing function
hrows away the information about the number of arguments it was
called with. I would expect an identity() function to be lossless
("bijective") and I think that is possible only if you restrict it to a
single argument.
Thanks for exposing/clarifying that flaw. I have removed my ans
On 12/07/2017 10:28 AM, Ethan Furman wrote:
The simple answer is No, and all the answers agree on that point.
It does beg the question of what an identity function is, though.
Thankfully, Paul answered that question with a good explanation*.
Thanks, everyone, for the discussion.
--
~Ethan
On 12/05/2017 09:27 PM, km wrote:
[snip]
Many things in this world are frustrating, but being hateful will not solve
anything. Please control yourself.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
as added
at the behest of the scientific/numerical community.
--
~Ethan~
* Yeah, I can't remember the cool name for those six operators at the moment.
:(
--
https://mail.python.org/mailman/listinfo/python-list
On 01/07/2018 04:31 PM, breamore...@gmail.com wrote:
On Monday, January 8, 2018 at 12:02:09 AM UTC, Ethan Furman wrote:
On 01/07/2018 12:33 PM, Chris Angelico wrote:
On Mon, Jan 8, 2018 at 7:13 AM, Thomas Jollans wrote:
On 07/01/18 20:55, Chris Angelico wrote:
Under what circumstances
not
existed for years, its addition could be justified?
Considering we just recently added a matrix-multiplication operator, yes.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
em off and leave the internet
forever.)
What's a... modem?
Its the component of the router that actually handles the
telecommunications side of things. Legend has it that once upon a time
they were a stand alone device.
Mine was never stand-alone. I always had to prop it up with some bo
ctice, not for what should happen in theory. ;-)
And of course, no one using enums that way means we can change how that bit
works fairly easily.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 4/22/22 12:36, Michael F. Stemper wrote:
Tells caller whether or not a permutation is even.
Determines if a permutation is even. (Alternative is that it's odd.)
Returns True if permutation is even, False if it is odd.
Third option.
--
~Ethan~
--
https://mail.python.org/ma
/archives/list/async-...@python.org/
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ould be the right answer.
>
> Is this worth a bug report?
I would say yes.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
Happy Pythoning, and happy holidays!
--
~Ethan~
Moderator
--
https://mail.python.org/mailman/listinfo/python-list
ng.
It's not a bug, it's a change in behaviour to bring it more into line with
other regex implementations in other languages.
The new behavior makes no sense to me, but better to be consistent with the other regex engines than not -- I still get
thrown off by vim's regex.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
o
mutate `arr1` instead of reassigning it:
arr1[:] = [10, 11, 12]
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
uth
[okay, falling for the troll bait]
Those two things do not say the same thing; further, in Python at least, and depending on the situation, aesthetics may
/not/ be more important than efficiency.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
This thread has run its course and seems to now be generating more heat than
light.
It is now closed (at least on the Python List side).
Thank you everyone for your participation and understanding.
--
~Ethan~
Moderator
--
https://mail.python.org/mailman/listinfo/python-list
eceived no emails from the list. To my
knowledge I have done nothing to warrant
> removal.
>
> Can you please check and see what I need to do to start receiving emails once
more.
It doesn't look like that address is subscribed. I tried inviting you, let's
see if that works.
-
Greetings, all!
As has been stated, Hen Hanna is posting through Google Groups, over which the
Python List moderators have zero control.
The only thing we can do, and which has now been done, is not allow those posts
in to the Python List.
--
~Ethan~
Moderator
--
https://mail.python.org
important matters."
>
> Somehow I don't think we would get along very well. I'm a little on the
> opinionated side myself.
I personally cannot stand Black. It feels like every major choice it makes (and some minor ones) are exactly the
opposite of the choice I make.
--
~Ethan~
--
same.
When writing classes and subclasses, I use `obj.__class__`, `isinstance` otherwise, and rarely `type(obj)` (and then
mostly with `tuple`s, as they're special).
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
you.
Any time. ;-)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
math.sqrt(x)
Plus the ** operation ("root = x ** 0.5"), that's now three ways.
Yes, but which of those is obvious?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
Thank you to those who pointed out this individual to the moderators.
As Mr. Flibble accurately noted, he is not on the mailing list -- so his
posts won't be here either.
--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list
On 2/15/21 2:02 PM, Grant Edwards wrote:
On 2021-02-15, Ben Bacarisse wrote:
You said you used Usenet (and your reply here was via Usenet).
Usenet posts to comp.lang.python don't go to the mailing list (the
"here" that Ethan is talking about). Mails to the list /are/ sent
her
are those scripts being run? Microsoft Windows or Unix/Linux/BSD?
Typically, the first line of a script will say which version of Python
is needed. For example, on a *nix type system:
#!/usr/bin/python2
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
I too was expecting users to type:
python my_Script.py!
I'm afraid I have no experience with the above, hopefully somebody else
on the list does.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
dy to describe that concept?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 2/24/21 8:28 AM, 2qdxy4rzwzuui...@potatochowder.com wrote:
Entangled?
Hey, I like that one! ;-)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 2/24/21 12:40 PM, Alan Gauld via Python-list wrote:
On 24/02/2021 16:12, Ethan Furman wrote:
I'm looking for a name for a group of options that, when one is specified, all
of them must be specified.
For contrast,
- radio buttons: a group of options where only one can be spec
7;d be two separate mandatory text fields, both
controlled (i.e., enabled or disabled) by one checkbox.)
I didn't say it was a good example. ;-) Hopefully it gets the idea across.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 2/24/21 1:54 PM, 2qdxy4rzwzuui...@potatochowder.com wrote:
Ethan Furman wrote:
I didn't say it was a good example. ;-) Hopefully it gets the idea across.
Ditto. ;-)
IMO, the whole idea of "my program has two options, and the user has to
specify both or neither," isn&
On 2/25/21 7:06 PM, Joe Pfeiffer wrote:
Ethan Furman writes:
Like I said, at this moment I don't have a good example, only an awareness that
such a thing could exist and I don't know the name for it (if it has one).
So far I have seen that there are even fewer good use-cases th
black background is only for the text-editing portion which
leaves large portions of screen real-estate with a bright background, which is
hard on my eyes.
So, what's the state-of-the-art with regards to editors supporting dark color
themes?
TIA.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
during testing and QA, turn off double-checks for production for best
performance possible.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
lass__` is there to provide metaclass power without needing a
full-blown metaclass.
I vote elegant hack. :)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
o, Jaime
# keyed
`hello, %(a_name)s` % {'a_name': 'Ethan'} # hello, Ethan
What you are seeing is the keyed version. So, if the module had, for example:
version = 1.3
author = 'GvR'
date = '2021-04-12'
and the doc string was
__
On 4/19/21 11:22 AM, Unbreakable Disease wrote:
[offensive drivel]
List, my apologies -- not sure how that one got through.
--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list
appen with all my messages? I'm reading the mailing list via
> news.gmaneio.
I see your messages twice (occasionally with other posters as well). I have no
idea how to fix it. :(
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 5/5/21 7:39 AM, Peter Otten wrote:
> On 05/05/2021 16:10, Ethan Furman wrote:
>> I see your messages twice (occasionally with other posters as well). I have
no idea how to fix it. :(
>
> OK, I'll try another option from Thunderbird's context menu: Followup to
converting to multiple files simply because there is so much (10k lines for me, YMMV).
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
tion that
> Mailman 3 cannot be used while a gateway is involved is untrue:
> https://mailman.readthedocs.io/en/latest/src/mailman/handlers/docs/nntp.html
Interesting. I know the NNTP gateway wasn't there a couple years ago, and I do not see a date as to when that became
possible.
Here's a question on SO about typing, enum, and ABC:
https://stackoverflow.com/q/67610562/208880
No answers so far.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
hen the programmer thinks it's appropriate... but
I have no idea what to call it.
Any nominations?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
of just
returning the eggs object
> (as it would for any other attribute) it will call the __get__ method (since
we were doing lookup)
> and return whatever that method returns.
Feel free to use that however you like. :)
--
~Ethan~
[1] https://stackoverflow.com/a/7377013/208880
--
https://mail.python.org/mailman/listinfo/python-list
th a file if you wanted to.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
then in my code:
logger.info('failure converting %r to %r', target_bmp_file, target_png_file)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
From Tim Peters:
> `secrets` is just a wrapper around `random.SystemRandom`, so the
> presence or absence of `secrets` doesn't matter.
>
> As to SystemRandom, all answers depend on the quality of the platform
> os.urandom(), which Python has no control over. See my answer here,
> and the comments
PEP: 663
Title: Improving and Standardizing Enum str(), repr(), and format() behaviors
Version: $Revision$
Last-Modified: $Date$
Author: Ethan Furman
Discussions-To: python-...@python.org
Status: Draft
Type: Informational
Content-Type: text/x-rst
Created: 23-Feb-2013
Python-Version: 3.11
Post
t:
https://nestedtext.org/en/stable/
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
gmane stop sending posts).
I am unaware of a change in the newsgroup <--> mailing list policy, and other newsgroup posts were coming through last
week (it's been a light weekend).
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 9/26/21 10:34 AM, Grant Edwards wrote:
> On 2021-09-26, Ethan Furman wrote:
>> I am unaware of a change in the newsgroup <--> mailing list policy,
>> and other newsgroup posts were coming through last week (it's been a
>> light weekend).
>
> We're n
other options didn't make it back to
the PEP. Nevertheless, I recall the decision to start simple, and expand later if needed.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
a very good name. So if someone has a good idea for a
> name …
>
> The class starts a thread where every by the user defined interval a
> by the user define function is called.
How about `timed_repeat` or `repeat_timer`?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
it wouldn't surprise me if some
>> sort of caching proxy system is deployed.
>
> Or the internet acquires a new protocol that's designed
> for very-long-latency connections.
RocketNet -- a massive store-and-forward protocol. ;-)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
useful, people would have to be diligent about setting them,
which, quite frankly, I don't see happening -- some don't even set a useful subject line.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 3/3/22 5:32 PM, Rob Cliffe via Python-list wrote:
> There are three types of programmer: those that can count, and those that
can't.
Actually, there are 10 types of programmer: those that can count in binary,
and those that can't.
--
~Ethan~
--
https://mail.python.org/mai
https://arstechnica.com/information-technology/2022/03/linux-has-been-bitten-by-its-most-high-severity-vulnerability-in-years/
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
atures are
discussed). This particular desire has come up in the past, so you'll need to do some more research (i.e. find the
previous threads on python-ideas) so you can answer objections already raised, or find new data supporting/refuting
previous arguments.
--
~Ethan~
--
https://mail.pyt
score.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
401 - 500 of 1941 matches
Mail list logo