On 05/13/2019 08:06 AM, Abdur-Rahmaan Janhangeer wrote:
Confirmation mails require only some words to be replied but that one asks
for passwords in plain text. Wonder if you guys also got it!
Already discarded it.
Thanks for the warning, though!
--
~Ethan~
--
https://mail.python.org/mailman
You have been subscribed. Welcome to Python List!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 05/17/2019 11:37 AM, Irv Kalb wrote:
self.x = self.x + 1
I have never run across this issue because I would never use the same name as
an instance attribute and a class attribute.
So you treat your class attributes as if they were static?
--
~Ethan~
--
https://mail.python.org/mailman
for Python Dev.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
than Python 3.4
Class NonTerminal(Enum):
Term = 1
Factor = 2
...
The docs [3] also have a lot of information.
Does that answer your question?
--
~Ethan~
[1] https://pypi.org/project/aenum/
[2] I am the author of Enum, aenum, and the enum34 backport.
[3] https://docs.python.
nal, non_terminal, index)
See also:
- https://stackoverflow.com/a/33680929/208880
- https://stackoverflow.com/a/35899963/208880
- https://stackoverflow.com/a/36918171/208880
- https://stackoverflow.com/a/43004033/208880
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
7;ll get a NameError
So, what's the issue?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
y3 not 2.n
except PythonVersionError:
print( more illuminating errmsg )
This is why tests should check for the exact error raised, not that any error
was raised. (That testing bug bit me a couple times before I learned that
lesson.)
--
~Ethan~
--
https://mail.python.org/mailma
the typing!
It's not just typing, but reading. Long names, when used over and over, become
noise.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
:
raise ValueError('%s members are neither True nor False' %
self.__class__.__name__)
The default Enum always returns True because the default Enum starts counting
at 1.
Perhaps you could share your Enum definition and what you expected to happen
when you used it in a boole
n specifically
discussing the implementation -- so CPython is an implementation detail while
Python is the language.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
:
raise ValueError('this shouldn't happen!)
else:
raise ValueError('unhandled Status: %r' % status)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 08/01/2019 01:06 PM, Daniel Okey-Okoro wrote:
[an idea]
Two things:
1) please do not cross-post.
2) a PEP is a very particular thing* -- please do not say you have one unless
you do. ;)
--
~Ethan~
* https://www.python.org/dev/peps/pep-0001/
--
https://mail.python.org/mailman/listinfo
On 09/17/2019 09:45 AM, Eko palypse wrote:
else:
class FOO():
def __init__(self, metaclass=Singleton):
In your test code, the `metaclass=Singleton` should be in `class Foo`:
class FOO(metaclass=Singleton):
...
--
~Ethan~
--
https://mail.python.org/mailman/listinfo
enums have a bunch of limitations and restrictions that make them
quite unusable for our more general use case :(
Out of curiosity, which limitations?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
your sqrt function can pass in whatever values they
want (float, int, fraction, whatever) and either get a good result, or deal
with the raised exception.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
Dear person reading this,
I was using Python 3.7.4 for a project, and I needed to install the
*playsound* function. I looked through online and saw that I needed to use
pip. However, it didn't work. I looked online and saw that I needed to
install it through the application, however, now th
Hi everyone,
I am currently using Python 3.7.4, and have used pip to install python
docx. I have looked up on many tutorials on how to use it, but they are all
mostly the same.
doc.add_heading("Test")
when i type that line, i get this:
KeyError: "no style with name 'Heading 1'"
can help?
--
https
n remain silent. If you don't want to
be frustrated, stop reading the thread.
Rude behavior will not be tolerated. Consider this your one warning.
--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list
https://groups.google.com/forum/#!forum/cython-users
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
might be part of a multiple
inheritance hierarchy, not just the derived one.
[Pieter van Oostrum]
Just for safety, also add it* to the Userfamily class.
* a call to super() (in case anybody else misreads that like I did)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
lutions to the Python 3 aspect of the problem here:
https://stackoverflow.com/q/908331/208880
If those answers do not work on Python 2 you'll need to detect which version
you are on and act appropriately, perhaps hiding that bit of complexity in a
function or class.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
one true way
- the way to end all ways ;)
- etc
It is also `preferable`, not:
- absolute
- eternal
- fixed
- exclusive
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 01/21/2020 10:55 AM, Michael Torrie wrote:
Slicing
returns a new object whether one is slicing a tuple, list, or a string,
the latter two are mutable objects.
Strings are not mutable.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
and converting to the G-code required for
my machine...
Hopefully you sent this email to the wrong place. python-list@python.org is
for discussion of things related to the Python Programming Language.
Also, please start a new thread instead of piggy-backing on an existing thread.
--
~Ethan
hashable.
If I do not intend my class to be hashable, I will set __hash__ to None
(according to the documentation).
If you define your own __eq__ method, __hash__ is automatically set to None.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
the code
written.
I think an oft overlooked aspect of technical debt is the affect on the
programmers dealing with it: frustration, burn-out, and job-seeking.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
lures:
raise PartialFailure(failures)
# in the calling code
try:
code_that_may_raise_partial_failures
except PartialFailure as e:
for failure in e.failures:
handle_failure
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ntion to the problem)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
noticed it.
When the mailing list software received your post, the python-list address was
not in the To: nor Cc: headers. Try the same steps you did before and I'll
keep a copy of the message for further debugging.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 03/02/2020 05:31 PM, Makoto Kuwata wrote:
Can anyone explain about difference between above two?
Why it is possiable to change local var via `locals()` only in class
definition?
My Stackoverflow answer (https://stackoverflow.com/q/7969949/208880):
Each of `globals()`, `locals()`, and `var
. If you have evidence of wrong-doing then
email the list owners and do what you can to contact the appropriate
authorities.
Asking the list to not help someone because you disagree with their beliefs
will not be tolerated. Consider this your warning.
--
~Ethan~
--
https://mail.python.org
e list owners. If you have evidence of wrong-doing then
email the list owners and do what you can to contact the appropriate
authorities.
Asking the list to not help someone because you disagree with their beliefs
will not be tolerated. Consider this your warning.
--
~Ethan~
--
https://mail.pyth
e list owners. If you have evidence of wrong-doing then
email the list owners and do what you can to contact the appropriate
authorities.
Asking the list to not help someone because you disagree with their beliefs
will not be tolerated. Consider this your warning.
--
~Ethan~
--
https://mail.pyth
.
--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list
e list owners. If you have evidence of wrong-doing then
email the list owners and do what you can to contact the appropriate
authorities.
Asking the list to not help someone because you disagree with their beliefs
will not be tolerated. Consider this your warning.
--
~Ethan~
--
https://mail.pyth
least.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
7;s shopping at the grocery store 100 miles away from me is useless.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
-time.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
': 'fal...@ibm.com'
}
>>> fname, lname, _ = d
>>> fname, lname
('first_name', 'last_name')
I disagree -- the ordered dict would have to be small (maybe five entries) and
one would have to know the insertion order.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
https://autoclasstoc.readthedocs.io/en/latest/
This sounds pretty cool! You should also post this on
python-announce-l...@python.org
to reach a wider audience.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 05/19/2020 11:40 AM, Joel Goldstick wrote:
I thought triple quotes are for docstrings?
It's the recommendation, but double and single quotes work just fine, too -- at
least for docstrings that fit an one line.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
27;nets already.
According to Kushal's link:
The most interesting thing about Enum members is that they are singletons.
The only time using `==` is necessary is for mixed-Enums, such as IntEnum, and
you need to compare what could be an IntEnum member in code that could be using
actual `int`s.
p property names as they are in the json file... is there
a workaround?
There is no workaround that allows a keyword to be used except as a keyword, other than making it a
string. When faced with this kind of situation myself I use a synonym, like "since", or
a translation, like
On 06/05/2020 03:15 PM, MRAB wrote:
On 2020-06-05 22:50, Ethan Furman wrote:
There is no workaround that allows a keyword to be used except as a keyword, other than making it a
string. When faced with this kind of situation myself I use a synonym, like "since", or
a transla
:-), I would like to formally ask the
Steering Council to answer the following questions.
An issue asking basically the same thing has been created:
https://github.com/python/steering-council/issues/31
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
conflation is going on. I have
asked for links that would support her view as expressed in the commit message,
but haven't yet seen any.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 07/02/2020 07:42 PM, Jon Ribbens via Python-list wrote:
She didn't - you did.
Please keep the discourse civil. Petty taunts are not helpful.
--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list
, conflated the
names.
Your mistake is to assume that since the author did not make that mistake that
Michael must have made it.
I'm sure somebody will point out what my mistake was.
Can we now drop this subthread?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
because the information is out there, doesn't mean everybody has
seen it.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 7/22/20 2:57 PM, Jeff Linahan wrote:
Subscribing to the mailing list as per the bot's request and resending.
*beep* *whir*
WE ARE NOT
*click* *whi*
A BOT.
*bzzzt*
WE ARE
*bzzzt* *click*
ADVANCED LIFE
*whi*
FORMS
*click*
*beep*
.
--
~eTHAN~
pYTHON lIST mODERATO
]
You can do horrid things like that clear back in Python 2, but the fault
lies with the programmer for misusing the __dunders__.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ient words.
I have not read S&W myself, and my requests for WS examples have gone
unanswered, so I do not know about the WS aspect.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
An excellent summary. Thank you.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
,
Unless you know Karen personally, you don't know what her world view is.
Poking holes in arguments or observing what is being said does not
require an opposing world view.
As you yourself said:
The sole relevant
demand should be civility.
Let's make sure we stay that course.
This thread is now closed.
Thank you for your cooperation.
--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list
tend to use both as it makes it stand out a bit more:
>>> still_a_tuple = ('first', )
>>> type(still_a_tuple)
The only time the parentheses are required for tuple building is when
they would otherwise not be interpreted that way:
some_func('first', '
On 9/17/20 10:43 AM, MRAB wrote:
On 2020-09-17 17:47, Ethan Furman wrote:
The only time the parentheses are required for tuple building is when
they would otherwise not be interpreted that way:
They're needed for the empty tuple, which doesn't have a comma.
Ah, right. Thanks.
e's no reason not to allow
it to be created.
Put another way: if ABC is anywhere in a class' parentage, then it is "abstract" -- the only way to tell if
instantiating it is okay is by the presence/absence of abstract pieces in the class.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 10/29/20 11:30 AM, Igor Korot wrote:
If you have any further questions you can contact me directly.
Please do not. By keeping the discussion on the list many people can
participate and learn.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
s" is right out.
Why is using preferences "right out"? Is that not the user saying where they
want the app to be positioned?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
t. I hate overlapping windows.)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 11/2/20 9:32 AM, Karsten Hilbert wrote:
because .encode() does not operate in-place.
Yeah, none of the string operations do, and it's embarrassing how many times
that still bites me. :-/
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
aving said that,
it looks like datetime.py was so designed. So, if I had a module making extensive use of the datetime contents, and
wasn't using the time module, I would have no problem with "from datetime import *". On the other hand, if datetime was
only a small portion of
From: Caleb Gattegno
Date: Fri, Dec 11, 2020 at 5:02 PM
Subject: How to specify JSON parameters in CallBack?
Please can you suggest where should I look for advice on converting a old style web app which vends whole pages of html
with a cgi-bin/python script invoked bypython3 server.py, into one
one way to get the behavior
you're looking for is:
D.get('a') or get_default()
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ded
default :-)
Yep! That's what defaultdict can do - or if you need more flexibility,
subclass dict and add a __missing__ method.
Or, if the computationally massively expensive call uses potentially
different arguments for each invocation:
some_var = d.get('a') or cme(arg1,
On 12/16/20 3:08 AM, Peter J. Holzer wrote:
On 2020-12-15 13:07:25 -0800, Ethan Furman wrote:
On 12/15/20 9:07 AM, Mark Polesky via Python-list wrote:
D = {'a':1}
def get_default():
print('Nobody expects this')
return 0
print(D.get('a', get_
list.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
tions and ignores answers he's acting like a bully.
Every time he declares that what he wants is the most important and so he is going to ignore our culture and the topic
of this forum/ml/ng he is acting like a bully.
If you haven't seen those posts, I have. Now you know.
--
~Ethan~
need to use an editor/IDE that will highlight the matching
parens for you...
I have one of those, and I still sometimes miss one. :/
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 11/12/2013 03:27 PM, Ian Kelly wrote:
On Tue, Nov 12, 2013 at 2:59 PM, Ethan Furman wrote:
Every time he uses foul language against somebody he's acting like a bully.
Every time he reposts questions and ignores answers he's acting like a
bully.
Every time he declares that what h
could tell the thread was his just from the subject title.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
xcellent, thanks fro the link. And is that a book by Ethan Furman next to it??
Nope, 'fraid not. If I actually write a book it will be on the One True
Python, not a merely corporeal imposter! ;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
before the line
child = Popen(cmd)
You are suggesting I edit /usr/lib/python2.6/subprocess.py?
Yup. Just make sure and change it back after you figure out what's going on.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
nice.
I think so. Is it a bug? Should I request a bugfix? How
do I go about doing that?
Check out bugs.python.org. Search for multiprocessing and tracebacks to see if anything is already there; if not,
create a new issue.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
function?
If you mean to access them from within the same method, someone
else has already shown it using locals(). But you cannot access
locals from a method that's already terminated. They no longer exist.
Also, accessing is fine, but not all pythons support changing them.
--
~Ethan~
--
s can be easily misunderstood? Please share that with us, it would be quite helpful.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
es all together:
input = ...
output = ...
with input, output:
...
works just fine. (At least on 2.7 where I tested it. ;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
by Serhiy
Storchaka, who appears to have forgotten more about Python than I'll ever know,
grrr!!! :)
The initial complaint came, unsurprisingly, from jmf. But don't worry much, even a stopped clock has a better track
record... it's at least right twice a day. ;)
--
~Ethan~
-
s doing it correctly. If I want to operate on "clusters" I'll
normalize the string first.
Thanks for this excellent post.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
an unfriendly place to be.
Terry, would it be appropriate to share some of what the moderators do do for us on this list and the others? And what
does the Code of Conduct have to say about trolls and help-vampires?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
scii(unicodedata.normalize("NFKD", "ä")))
'a\u0308'
Well, Stephen was right then! There's room for a library to handle this
situation. Or is there one already?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
posts. Please keep a light-hearted and respectful tone. When light-hearted doesn't cut it, you can
still be respectful (of the other readers, even if the offender doesn't deserve it).
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
3 the default version
and having everybody be cool with unicode."
Hear, Hear!
+1000! :D
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 12/02/2013 07:22 PM, Terry Reedy wrote:
On 12/2/2013 4:25 PM, Ethan Furman wrote:
jmf is certainly a troll
No, he is a person who discovered a minor performance regression in the FSR,
which we fixed. Unfortunately, he then
continued for a year with a strange troll-like anti-FSR crusade
On 12/02/2013 12:38 PM, Ethan Furman wrote:
On 11/29/2013 04:44 PM, Steven D'Aprano wrote:
Out of the nine tests, Python 3.3 passes six, with three tests being
failures or dubious. If you believe that the native string type should
operate on code-points, then you'll think that Pytho
along the line of
my_object.'valid-attribute-name-but-not-valid-identifier'?
When would you have attribute names that are not valid identifiers?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
saved 3 keystrokes. That is not a significant enough savings to
create new syntax. Remember the Python philosophy that there ought to be
one way to do it.
That should be "one obvious way".
On my keyboard, at least, those are an important three keystrokes! ;)
To be clear, I am
mplementing suitable underscored methods?
No. It is possible to provide attribute access along with key access, but not currently possible to provide attribute
access with quoted values -- which is what the OP wants.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 12/04/2013 12:07 PM, Piotr Dobrogost wrote:
If there ought to be only one way to access attributes then it should
be dot notation.
Not "only one way", it's "one obvious way".
The obvious way to deal with objects that do not have legal identifier names is
ject, 'bar', 100)
setattr(my_object, 'foo-bar', 1000)
print(my_object.foo-bar)
Actually, under his proposal it would be:
print(my_object."foo-bar")
and it would print 1000, while yours would still print 9.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 12/04/2013 12:55 PM, Mark Lawrence wrote:
On 04/12/2013 20:22, Ethan Furman wrote:
On 12/04/2013 12:07 PM, Piotr Dobrogost wrote:
If there ought to be only one way to access attributes then it should
be dot notation.
Not "only one way", it's "one obvious way"
ly with attributes,
right?
Correct. It is looking very unlikely that you are going to get enough support for this change. Perhaps you should look
at different ways of spelling your identifiers? Why can't you use an underscore instead of a hyphen?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 12/04/2013 03:57 PM, Piotr Dobrogost wrote:
On Thursday, December 5, 2013 12:09:52 AM UTC+1, Ethan Furman wrote:
Perhaps you should look at different ways of spelling your identifiers?
Why can't you use an underscore instead of a hyphen?
So that underscore could be left for use i
ob's your uncle, job
done.
I think the latter would be foolish. Syntax changes have a high bar for
acceptance. They should do more than save a few
keystrokes.
+1
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
t dateStrs.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
head.
*facepalm* Yep, it did. Completely missed what you said there.
Doh. I see what you did there... now.
Heh. It was too subtle for me, too. 'Course, I've been fighting OpenERP all
day...
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
that stuff to Get Things Done.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
stuff! ;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
701 - 800 of 1941 matches
Mail list logo