can be made quickly.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 03/28/2016 05:44 PM, Steven D'Aprano wrote:
http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/
Beautiful. And my deepest sympathies for the OP.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 03/30/2016 06:10 AM, srinivas devaki wrote:
ahh, this is the beginning of a conspiracy to waste my time.
PS: just for laughs. not to offend any one.
It's fair: you waste ours, we waste yours. :) A fair, if not good, trade.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/p
content.
Note: I'm not affiliated with the book, probably won't pledge (only a
couple topics apply to me), but I am a KickStarter fan (having purchased
more games than was probably wise ;) .
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ython users suffer
again with a new major release breaking all their legacy code.
"2016-03-31 23:40"
You're 20 minutes early :)
No, that's a naive datetime. You need to travel to Victor's location to
figure out what that is there.
I sure hope Python 8 doesn't have
object.
for i in range(len(mylist)):
if(mylist[i].startswith(key)):
mylist = [mylist[i]] + mylist[:i] + mylist[i+1:]
And now they are not, as you just assigned the name `mylist` to
something else.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
t;pass-by-value" is being used, even mutation of the passed
object will not show up in the caller.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
n as well.
Besides which, the amount of extra effort someone else is willing to go
to to prove something is directly related to the interestingness of the
topic -- and the various uses of range() isn't that interesting (it
would be more interesting if a PEP was on the line...)
r module is
nowhere near that point.
Well, there should be one more module:
test.py
So in total, two files
bidict/
|-- __init__.py
|-- test.py
will do the trick. Oh, and you want a README, LICENSE, a doc file. And
that should do it. :)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
r that class) then it's okay by itself;
otherwise, combine it with the module it's used in.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
EP, or obviously non-quoted anywhere-close-to-on-topic content, I bounce.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 04/05/2016 12:09 PM, Sven R. Kunze wrote:
On 05.04.2016 20:40, Ethan Furman wrote:
Steven D'Aprano wrote:
Your package is currently under 500 lines. As it stands now, you could
easily flatten it to a single module:
bidict.py
Yup... well, actually you could just stick it in __init
ntent into __init__.py, my tests in test.py, and other
supporting files in that same folder.
So far it has worked well for me.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 04/05/2016 04:38 PM, Steven D'Aprano wrote:
On Wed, 6 Apr 2016 04:40 am, Ethan Furman wrote:
Well, there should be one more module:
test.py
So in total, two files
bidict/
|-- __init__.py
|-- test.py
Your test code shouldn't necessarily be part of the package though. If
t;%v for v in expectedValues] )) +
"Read values nBytes:%02x (%s)"%(nBytesRd,
' '.join( [ "%04x"%v for v in valuesRead] )))
Certainly no more readable, but /maybe/ more performant. (Assuming it
even works.)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
one else: If you see offensive posts from Thomas on the usenet
side, please just ignore them. I have no desire to see his posts in
your replies.
--
~Ethan~
Python List Owners
--
https://mail.python.org/mailman/listinfo/python-list
On 04/08/2016 06:32 PM, Random832 wrote:
Testing posting from an email address other than the one I'm subscribed
in, to determine whether it's possible to post to the list without being
subscribed.
Kinda. :)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
etimes our
temper gets the better of us.
You'll notice I was censored for my outburst, and you'll also hopefully
notice that I later apologized.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
Mark Lawrence is currently being moderated.
If you see offensive posts from him on the Usenet side please do not
respond.
Thank you.
--
~Ethan~
Python List Owners
--
https://mail.python.org/mailman/listinfo/python-list
at/
Informative post, thanks!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 04/13/2016 07:21 AM, Ethan Furman wrote:
On 04/13/2016 07:07 AM, Marko Rauhamaa wrote:
class Color(enum.Enum):
red
blue
green
This last one is to the point but raises a NameError.
Using the aenum library that last one is possible. It also has
ndows. I prefer the latter.
Python code windows go in my portrait mode 27" screens (120 chars),
while xml windows go in landscape mode (220 chars).
Yes, there are many reasons why I don't like xml. :(
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
you are saying.
If you are not receiving emails, how are you reading the list? A news
reader?
If you are subscribed for moderation, how does that help with the lag
time when you do post?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ences of bad data are Bad Bad Things (tm)
If none of those apply, I don't bother sanity checking.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ation of how to either sign-up to the list,
or use a mirror, etc, to interact with the list/newsgroup/mirror/whatever.
If that's not true then I'm more or less happy ;-)
Excellent.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 04/19/2016 12:05 PM, Random832 wrote:
On Tue, Apr 19, 2016, at 15:01, Ethan Furman wrote:
The only thing changing is what happens if someone posts /directly/ to
the mailing list (not through gmane, etc).
Is the mailing list software able to make that distinction? I thought
that was on
On 04/19/2016 10:51 PM, Stephen Hansen wrote:
But that's a fuzzy question, there's no solid and clear answer. Did you
see Ethan's response? I largely agree with his trinity:
On Sun, Apr 17, 2016, at 10:26 PM, Ethan Furman wrote:
I sanity check for three reasons:
1) rais
d be. If you mean
the results are exactly the same you can get that behavior with
yield from iter(x)
which, while being slightly longer, has the advantage of already
working. ;)
--
~Ethan~
[1] https://mail.python.org/mailman/listinfo/python-ideas
--
https://mail.python.org/mailman/listin
ount = 2
(ABCDE) count = 2
F count = 1
(ABC) count = 3
B repeats 1 time
or
ABC ABC ABC D E A B C D E F ABC ABC B
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 04/20/2016 08:57 PM, Ethan Furman wrote:
> [snip same pattern as Steven wrote]
Nevermind. It's obviously time for me to go to bed. :/
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ing and Queen each
have two specific positions. An invalid value will raise an exception.
This will make it so you cannot use your PieceFactory for custom setups.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 04/21/2016 08:33 PM, Christopher Reimer wrote:
On 4/21/2016 7:20 PM, Stephen Hansen wrote:
Keep in mind that I'm coming from a Java background (not by choice) with
a smattering of C programming.
A refugee! Water! Food! import this!! :)
Oh! and Enum!!! ;)
--
~Ethan~
--
?
https://pypi.python.org/pypi/dbf
I'm pretty sure it handles such values.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 04/22/2016 11:28 AM, Ethan Furman wrote:
On 04/22/2016 10:34 AM, Ricardo Aguilar wrote:
Hi there i try to remove to fields in dbf table, how I can remove two
fields?
I wanna to remove because I have this error "ValueError: could not
convert
string to float: " But I no need
On 04/23/2016 06:29 PM, Ian Kelly wrote:
Python enums are great. Sadly, they're still not quite as awesome as Java enums.
What fun things can Java enums do?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
-complete suggestions. I haven't found a good use for them myself, but
I'd been mostly stuck in Python 2 until recently.
enum34 is the backport, aenum is the turbo charged version.
https://pypi.python.org/pypi/enum34
https://pypi.python.org/pypi/aenum
--
~Ethan~
--
https://mail.python.o
7;>,
,
moves: one space forward; attack: one space diagonal'>,
]
--> p = Piece.bishop
--> p in Piece
True
--> p is Piece.rook
False
--> p is Piece.bishop
True
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 04/24/2016 08:20 AM, Ian Kelly wrote:
On Sun, Apr 24, 2016 at 1:20 AM, Ethan Furman wrote:
On 04/23/2016 06:29 PM, Ian Kelly wrote:
Python enums are great. Sadly, they're still not quite as awesome as Java
enums.
What fun things can Java enums do?
Everything that Python enums c
On 04/24/2016 09:10 AM, Chris Angelico wrote:
On Mon, Apr 25, 2016 at 2:04 AM, Ethan Furman wrote:
Unfortunately, the empty tuple tends to be a singleton, so there is no way
to tell that red and default are (supposed to be) the same and blue is
(supposed to be) different:
--> a = b = ()
--
e and hashable.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 04/24/2016 11:27 AM, Chris Angelico wrote:
On Mon, Apr 25, 2016 at 4:12 AM, Ethan Furman wrote:
Values can be anything. The names are immutable and hashable.
I know they *can* be, because I looked in the docs; but does it make
sense to a human? Sure, we can legally do this:
Well, not
before it).
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
layed with both in my code. Doesn't seem to make a
great difference either way. Using object seems to be the most simplest
approach.
Using a dict gets you a bunch of methods for free: keys(), values(),
items(), get(), etc., etc..
If you don't need any of those, subclass object.
--
ccess to" the instances' "dictionary items" I would
say that distinction is pretty thin already. ;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
t the results you
want. pickle is worth looking at for saving/restoring.
Also, your code will give the same notation to Kings and Knights.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ng to make is this: you should never* call
__dunder__ methods in normal code; there is no need to do so:
- use len(), not __len__()
- use next(), not __next__()
- use some_instance.an_attribute, not some_instance.__dict__['an_attribute']
--
~Ethan~
* Okay, maybe /almost/ never. Abo
h to use that in
the meantime until I get a handle on pickle.
If you are saving chess game state, you should look at the Portable Game
Notation format:
https://en.wikipedia.org/wiki/Portable_Game_Notation
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
n the program from the command line, and
b) use the -h / --help switch
that they are proficient enough to efficiently use said help when output
to stdout.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
*:
- not argparse based
- simple to use
- supports flags, options, multioptions
- supports --help (and -h if no other parameter uses that abbreviation)
- supports --verbose (and -v of no other . . .)
- supports --version
- script parameters are global
- (sub)command parameters are local
--
~Ethan
Wow. Thank you for that very informative post!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ager, it will use that. So setting it to "cat"
should work. I've just tested this under Linux, and it works for me:
So I have to cripple my shell to get pydoc help to work nicely? Neat!
Actually, not so much. :(
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 05/01/2016 09:36 AM, Steven D'Aprano wrote:
On Mon, 2 May 2016 02:30 am, Grant Edwards wrote:
It's pretty rare. It is assumed that Unix uses can type " | less"
Is nobody except me questioning the assumption that we're only talking about
Unix users?
Even Windo
aenum 1.4.1
Advanced Enumerations (compatible with Python's stdlib Enum),
NamedTuples, and NamedConstants
aenum includes a Python stdlib Enum-compatible data type, as well as a
metaclass-based NamedTuple implementation and a NamedConstant class.
An Enum is a set of symbolic names (members)
On 04/24/2016 08:20 AM, Ian Kelly wrote:
On Sun, Apr 24, 2016 at 1:20 AM, Ethan Furman wrote:
What fun things can Java enums do?
Everything that Python enums can do, plus:
>
--> Planet.EARTH.value
(5.976e+24, 6378140.0)
--> Planet.EARTH.surface_gravity
9.802652743337129
tive action, a way of getting men accustomed to listening
to women and hearing good ideas and questions from them, and a way to
accustom women to speaking in (currently) male dominated groups.
And it is far more equal opportunity than having 25 males ask questions
and only one or two females.
s.
So it works either way. Good catch.
No, it doesn't. `f.close` simple returns the close function, it doesn't
call it. The "it works" was simply because Python closed the files for
you later.
Not a big deal in a small program like this, but still a mistake.
--
~Ethan~
and that thing may already have the correct attribute, do nothing;
otherwise, raise an exception.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ing to be a master craftsman
- he wasn't being arrogant
I can also assure you that *you* are being hostile, rude, and
discriminatory, and such behaviour is not welcome here.
Any further posts of this nature and you will be placed on moderation.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 05/10/2016 02:21 PM, DFS wrote:
[some inflammatory nonsense]
and is now being moderated. If you see flame-bait in one of the
unmoderated venues please ignore it.
Thanks.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
the object wasn't created the test would
have already failed).
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
test that fools the test runner but doesn't really
test anything...
Some would have, sure.
Either way, it's a solved issue now because we (finally ;) have the
@skip decorator.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 05/18/2016 05:43 PM, Steven D'Aprano wrote:
On Thu, 19 May 2016 09:30 am, Ethan Furman wrote:
On 05/18/2016 03:52 PM, Gregory Ewing wrote:
Ned Batchelder wrote:
I'm not sure how
the test runner could determine that it was empty. I guess it could
introspect the test function
block run
without error) is dwarfed by the semantic difference: a try/else else
block runs if nothing /bad/ happened whereas a for/else else block runs
if something bad /did/ happen; to wit, the thing you were looking for
was not found (or your loop didn't run at all ;) .
But as others
On 06/01/2016 04:39 PM, Lawrence D’Oliveiro wrote:
[multiple apparent trolls redacted]
This thread is dead. Please stop beating it.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
There were many good talks and presentations at PyCon 2016, but if you
can only watch one, this is the one to watch:
https://www.youtube.com/watch?v=bSfe5M_zG2s
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
the code in a class decorator.
--
~Ethan~
[1] https://docs.python.org/3/library/functions.html#locals
Yes, returning the class namespace is a language gaurantee.
--
https://mail.python.org/mailman/listinfo/python-list
aking about what code looks like when output then that
would certainly seem to fit with PEP 8.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 06/16, Random832 wrote:
> On Wed, Jun 15, 2016, at 15:03, Ethan Furman wrote:
>> [1] https://docs.python.org/3/library/functions.html#locals
>> Yes, returning the class namespace is a language gaurantee.
>
> How do you get a guarantee from that text?
Oops, my bad -
-- just have to keep your notations correct*.
--
~Ethan~
* Mine might be 30 years out of date, but maybe not.
--
https://mail.python.org/mailman/listinfo/python-list
:
with ob_b:
.attr_c = 42 # which object are we modifying right now?
The innermost one. Why would it be anything else?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 06/19/2016 04:56 AM, Joonas Liik wrote:
On 18 June 2016 at 23:47, Ethan Furman wrote:
On 06/18/2016 07:05 AM, Joonas Liik wrote:
the leading dot does not resolve the ambiguity that arises from:
with ob_a:
with ob_b:
.attr_c = 42 # which object are we modifying right now
On 06/19/2016 08:14 AM, Michael Torrie wrote:
On 06/19/2016 09:01 AM, Ethan Furman wrote:
On 06/19/2016 04:56 AM, Joonas Liik wrote:
On 18 June 2016 at 23:47, Ethan Furman wrote:
On 06/18/2016 07:05 AM, Joonas Liik wrote:
the leading dot does not resolve the ambiguity that arises from
it's still
jarring trying to use the not-very-pythonic-at-all interface.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
is a problem
currently plaguing the standard library, and probably many other
libraries).
I agree. But lets all do:
from atpublic import public as api
as using 'public' for the name is bound to lead to confusion with other
languages that use public to mean something else, and __all__ is really
defining the public _API_ of that module.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
n't get instantiated.
A well-named decorator/base-class should help with that.
Did you mean for this to go to -Ideas?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 07/01/2016 10:10 AM, Steven D'Aprano wrote:
On Sat, 2 Jul 2016 02:00 am, Ethan Furman wrote:
Did you mean for this to go to -Ideas?
Not yet. I wanted some initial feedback to see if anyone else liked the idea
before taking it to Bikeshedding Central :-)
Besides, I expect Python-
On 07/02/2016 08:34 AM, Kevin Conway wrote:
For the proponents of namespace, what is deficient in the above example
that necessitates a language change?
Adding a new widget is not changing the language.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
blah(text):
... print('blah blah %s blah blah blah' % text)
... blah('whatever')
...
blah blah whatever blah blah blah
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 07/03/2016 03:02 PM, Kevin Conway wrote:
>At some point earlier Ethan Furman declared:
It's not a language change.
Perhaps. My argument is that anything that introduces a new class-like
construct and set of lexical scoping rules is a language change. For
example, if this change w
PEP over
to the dist-utils sig:
https://mail.python.org/mailman/listinfo/distutils-sig
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
k:
# untested
import sys
sys.modules['%s.registry' % __name__] = _Register()
and then elsewhere:
from blah import registery
registry.whatever()
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ay as well be consistent
with them.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 07/09/2016 03:23 AM, Stefan Behnel wrote:
Ethan Furman schrieb am 09.07.2016 um 08:27:
On 07/08/2016 10:49 PM, Random832 wrote:
On Sat, Jul 9, 2016, at 01:26, Steven D'Aprano wrote:
hmean and gmean
harmonic_mean and geometric_mean
The latter, definitely.
My preference is als
sonally know their effectiveness.
Udacity.com is another. They have several free classes, or you can pay
and get access to instructors.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
remember it.
True, but like most things there is a balance -- searching for hours for
an answer is frustrating and discouraging, and the thing most likely
remembered is not the answer the pain in finding it.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 07/09/2016 04:21 PM, Chris Angelico wrote:
Yes, I hear a lot about Udacity. Has anyone taken any of the pay-for
classes? Are the instructors helpful, skilled, etc? Did it seem like
good value for money?
Yes. Yes, yes. Yes. :)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo
hat to do we gain by saying
such a thing?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
?) communicated by a representation.
Nope, still not clear to me. :(
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
significant figures"?
174.0, because those last tenths of a millimeter could be very
important, while knowledge that there are no thousands of millimeters is
already present.
So, so far there is no explanation of why leading zeroes make a number
more precise.
--
~Ethan~
--
https://mail
On 07/11/2016 03:17 PM, Ethan Furman wrote:
So, so far there is no explanation of why leading zeroes make a number
more precise.
An example of what I mean:
174 with a precision of 3 tells us that the tenths place could be any of
0-9, or, put another way, the actual number could be anywhere
On 07/11/2016 04:47 PM, Gregory Ewing wrote:
Ethan Furman wrote:
I will readily admit to not having a maths degree, and so of course to
me saying the integer 123 has a precision of 5, 10, or 99 digits seems
like hogwash to me.
Seems to me insisting that the number after the dot be
called
On 07/13/2016 05:54 AM, Nir Cohen wrote:
On Thursday, July 7, 2016 at 7:47:22 AM UTC+3, Nir Cohen wrote:
On Wednesday, July 6, 2016 at 10:09:01 PM UTC+3, Ethan Furman wrote:
On 07/06/2016 11:43 AM, Nir Cohen wrote:
We decided that we want to package sets of wheels together created or
On 07/15/2016 09:04 PM, Rustom Mody wrote:
Just that suggesting that python's bool notion is straightforward is an
unnecessary lie – especially to newbies.
Python's boolean concept is as simple as it gets -- what is not straightforward
about it?
--
~Ethan~
--
https://mail.python.o
ging those types of objects harder.
__slots__ is a memory optimization, and like most optimazations you shouldn't
use
it until you know you need it.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
tead; it does
not risk conflict with enum, but has the same basic behavior (plus lots of
advanced behavior you can opt in to).
--
~Ethan~
[1] https://pypi.python.org/pypi/aenum
--
https://mail.python.org/mailman/listinfo/python-list
Greetings!
I may have a need in the immediate future to work with SOAP and WSDL services,
and a quick search
turned up Zeep (http://docs.python-zeep.org/en/latest/) -- does anyone have any
experience with it?
Or any other libraries that can be recommended?
Thanks.
--
~Ethan~
--
https
nts.
How is this related to Python?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
10:55 AM, Muhammad Rizwan wrote:
> Yes please ignore. Don't need any help from you either.
This behavior is not acceptable. Any more posts like this and you will
be suspended from Python List.
--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list
ttribute 'shape'
It seems to me the problem only exists because you are trying to print
`self.shape` -- stop printing it, and everything works normally.
What problem are you actually trying to solve?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
601 - 700 of 1941 matches
Mail list logo