ce" application we use in our company
instead. It runs as a service, and executes any random series of
programs beneath it, creating JOB's for each so any subprocesses of they
launch all get killed together cleanly, and handling dependencies via
between them through various means, and stuff
lar bit of code must not,
under any circumstances, not ultimately work. Even going so far as to
start having hour long waits between retries until the other side is
finally up :P)
--
Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http
and generally thought of as merely syntactical
sugar for:
n = n + x
... lets one easily think that this should be entirely safe, even with
mutable objects, because if += were merely syntactical sugar, it would
be. But its not! Because += is wiggly. It can do more then one entirely
differe
ecause my criticism isn't about one choosing to do crazy stuff with the
object model. I've never advocated Python be strict about rules.
But for Python, all by itself, with nothing but built-in and basic
types, to have a situation where:
a = a + b
a += b
... does two very dis
On 8/21/11 9:37 PM, Stephen Hansen wrote:
> But, += is Python itself adding an unpredictable behavior into the core
> language, with its own base types behaving
... very differently to fundamental, basic appearing operators.
Editing fail on my part.
Similarly:
> But for Python, all
ject (but
NOT in the case of __*__ methods, usually, which are obtained internally
by a direct struct access, i.e., mytype->tp_new gets mytype.__new__).
If no such attribute exists, it goes along to do its default
attribute-resolution process, including the descriptor protocol and dict
checkin
you'll be able to
re-import apkg.subpkg. I.e:
Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>>
On Mon, Aug 22, 2011 at 12:14 PM, Matthew Brett wrote:
> Yes, sorry, I should have mentioned that I explored these kind of
> variations.
>
> I think I see that there isn't an obvious way for del sys.modules['apkg']
> to know to delete or modify 'apkg.subpkg', because sys.modules is just a
> dict.
nience of customers who want to auto-install via
Group Policy).
In most situations, Python's good at "finding itself", i.e. where the
python.exe is actually located -- and it boostraps the location of
everything else based on that.
--
Stephen Hansen
... Also: Ixokai
t;? That's a kind of odd thing to do, I think. In Python at
least.
Why not just:
debug = defaults.get("debug", None)
(Strictly speaking, providing None to get is not needed, but I always
feel odd leaving it off.)
That's generally how I spell it when I need to do run tim
t.
The entire idea that its hard, time-consuming, effort-draining or
difficult to make code clean and "pretty" from the get-go is just wrong.
You don't need to do a major "prettying up" stage after the fact. Sure,
sometimes refactoring would greatly help a body of code as
= max(ratios)
> owner = usernames[ratios.index(best)]
> print filename,":",owner
It amazes me that I can still find a surprising new tool in the stdlib
after all these years.
Neat.
/pinboards
--
Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (
event people from seeing the code*, they're just regular zip
files and can be unzipped fine.
I almost always install unzip my eggs on a developer machine, because I
inevitably want to go poke inside and see what's actually going on.
--
Stephen Hansen
... Also: Ixokai
... M
and are fairly competitive.
--
Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
On 8/28/11 10:23 PM, Chris Angelico wrote:
> On Mon, Aug 29, 2011 at 3:09 PM, Stephen Hansen
> wrote:
>> Get a new webhost. ...
>>
>> But I don't know if they have a warehouse in Australia, if their latency
>> with any of their various data centers is suitable
around that a long time ago, and now always keep the jobs of managing my
DNS record and hosting my sites /totally/ separate.
--
Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/
signature.asc
Description: OpenPGP digital
arty module; Twisted's asynch dispatching isn't really exactly
concurrency, but it does a better job then concurrency does for some
operations; someone's always working on coroutines in some fashion or
another, which is another kind of concurrency.)
Lots of different ways to go concurren
ole point of that secure sequence is that the OS and
only the OS responds.
--
Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
ke it worth the complication.
--
Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/
* Obvious exaggeration :P
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
is single "sub" dictionary with all instances of your
A class.
If you want to define instance-specific attributes, define them in the
__init__ method, like so:
class A:
def __init__(self):
self.sub = dict()
def sub_add(self, cls):
obj = cls()
self.sub[o
t encourage the petulant little meat-heads to follow
> some sensible styling rules.
My god, I've been away from this list for quite awhile, but we're still
entertaining this fool?
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Mar 30, 2016, at 10:34 PM, tdspe...@gmail.com wrote:
> as you can see the option element was added third but is the first one
> displayed.
>
> Is this just standard - I am using Python 3.5
The order of items in dictionaries is based on the hash value -- which
while stable, should be consi
decisions against. Most code exists outside
the stdlib.
---
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, Apr 9, 2016, at 12:25 PM, Mark Lawrence via Python-list wrote:
> Again, where is the relevance to Python in this discussion, as we're on
> the main Python mailing list? Please can the moderators take this stuff
> out, it is getting beyond the pale.
You need to come to grip with the fact
On Sun, Apr 10, 2016, at 03:51 PM, Fillmore wrote:
>
> let's look at this:
>
> $ python3.4
> Python 3.4.0 (default, Apr 11 2014, 13:05:11)
> [GCC 4.8.2] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> line1 = '"String1" | bla'
> >>> parts1 = line1.split("
x27;t. Your mistake is again -- parens don't make tuples,
commas do.
A one element tuple is:
>>> b = ("hello,)
The parens are optional, I always put them in because:
>>> b = "hello",
The parens group an expression, they don't make a type.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, Apr 10, 2016, at 05:18 PM, Stephen Hansen wrote:
> The parens are optional, I always put them in because:
> >>> b = "hello",
Ahem, "because its easy to miss the trailing comma" is what I meant to
say here.
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, Apr 10, 2016, at 05:22 PM, Fillmore wrote:
> Hold on a sec! it turns up that there is such thing as single-element
> tuples in python:
>
> >>> c = ('hello',)
> >>> c
> ('hello',)
> >>> c[0]
> 'hello'
> >>> c[1]
> Traceback (most recent call last):
>File "", line 1, in
> IndexError
On Sun, Apr 10, 2016, at 05:17 PM, Fillmore wrote:
> On 04/10/2016 07:30 PM, Stephen Hansen wrote:
>
> > There's nothing inconsistent or surprising going on besides you doing
> > something vaguely weird and not really expressing what you find
> > surprising.
at I should
have mentioned the empty tuple exception that proves the rule. The only
time you need parens is to resolve ambiguity.
To suggest that parens do make tuples confuses the issue, given things
like this:
>>> a = 1,2,3
>>> b = (1, 2, 3)
--
Stephen Hansen
m e @ i x o k a
On Sun, Apr 10, 2016, at 05:48 PM, Fillmore wrote:
> On 04/10/2016 08:31 PM, Ben Finney wrote:
> > Can you describe explicitly what that “discontinuation point” is? I'm
> > not seeing it.
>
> Here you go:
>
> >>> a = '"string1"'
Here, "a" is a string that contains a double quoted string. So if
On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote:
> and the (almost always to be avoided) use of eval()
FWIW, there's ast.literal_eval which is safe and there's no reason to
avoid it. You'll still have to deal with the fact that a single string
on a line will return a string while multiples will
th your words: code is
good, show code, don't get me wrong, but you need to express your
expectations and how the difference between what happened and what you
expected surprised you.
Both parts, the code and the expression of your thoughts, are really
important to getting help around here :)
On Sun, Apr 10, 2016, at 10:18 PM, Rustom Mody wrote:
> On Monday, April 11, 2016 at 10:17:13 AM UTC+5:30, Stephen Hansen wrote:
> > On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote:
> > > and the (almost always to be avoided) use of eval()
> >
> > FWIW, there
folder.
If you can't use pip while in the same directory as pip.exe, I don't
even know what is wrong.
That said, you can access pip via 'python -m pip args' instead of using
the pip executable.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
etch a RSS feed from Wunderground. But that was
awhile ago and I don't see the obvious RSS links banymore.
Did you see: https://www.wunderground.com/weather/api/d/docs
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Apr 13, 2016, at 06:51 AM, durgadevi1 wrote:
> I would like to check with you whether using binascii.hexlify() to
> convert the series of bytes into alphabets and integers is correct.
To be clear, they already are integers.The \x notation is how you
naively represent a byte out of the prin
> * You can use named constants from ‘os’ for the purpose of specifying
> exit status numbers.
Only on *nix.
Even then it varies from platform to platform which constants you can
use. I'd prefer to document the return status and use numbers/my own
constants directly, that way supporting any p
the core devs
taste and particular needs, and it goes out of its way to say that it is
only a suggestion and other concerns (especially local consistency)
override its advice.
---
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
bian, it
should come pre-installed.
---
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, Apr 17, 2016, at 12:34 PM, Christopher Reimer wrote:
> if color not in [VARS['COLOR_BLACK'], VARS['COLOR_WHITE']]:
> raise Exception("Require \'{}\' or \'{}\' for input value, got
> \'{}\' instead.".format(VARS['COLOR_BLACK'], VARS['COLOR_WHITE'], color))
Do you think it lik
On Tue, Apr 19, 2016, at 11:09 PM, Ethan Furman wrote:
> On 04/19/2016 10:51 PM, Stephen Hansen wrote:
> > I use 1) more to be less 'nicer' and more, er, 'more specific'. Since I
> > don't like exceptions to rise to the user level where niceness is
> &g
mmandline = r"C:\windows\system32\lpr.exe -S 172.28.84.38 -P RAW
C:\john\myfile"
The r in front of the string makes it a raw string so you don't have to
double up the slashes.
---
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Apr 21, 2016, at 10:46 AM, Allan Leo wrote:
> I need help with this setup error.
> -- Forwarded message --
> From: "Allan Leo"
> Date: Apr 21, 2016 10:06 AM
> Subject: Re: Error 0*80070570
> To:
> Cc:
>
> When running the setup for your 3.5.1(32-bit version), the setup
>
On Thu, Apr 21, 2016, at 06:34 PM, Christopher Reimer wrote:
> class PieceFactory(object):
>
> def factory(color, piece, position):
> if piece == 'Bishop':
> return Bishop(color, position)
> if piece == 'King':
> return King(colo
On Thu, Apr 21, 2016, at 08:33 PM, Christopher Reimer wrote:
> On 4/21/2016 7:20 PM, Stephen Hansen wrote:
> > I... that... what... I'd forget that link and pretend you never went
> > there. Its not helpful.
>
> I found it on the Internet, so it must be true -- and Pytho
ads which is the Anaconda scientific
distribution, which I know does offer 64-bit Python support.
---
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
e tracebacks.
Having a nice description of what you expect to happen is often nice
too, especially if its doing something "wrong" and not giving an obvious
traceback. Seeing specifically what the wrong behavior is, and you
explaining why you think its wrong, can be invaluable.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
)
Python is case-sensitive. "Adjective1" and "adjective1" are separate
things. In your code you're reading into "adjective1".
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
rmatting. I
leave it to you to count and find what's missing or extra, because I'm
seriously not going to do that :)
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Apr 27, 2016, at 10:32 PM, Ben Finney wrote:
> Stephen Hansen writes:
>
> > The error message means there's a mismatch between the number of
> > formatting instructions (ie, %s) and arguments passed to formatting. I
> > leave it to you to count and find wha
On Wed, Apr 27, 2016, at 11:55 PM, Ben Finney wrote:
> Stephen Hansen writes:
>
> > On Wed, Apr 27, 2016, at 10:32 PM, Ben Finney wrote:
> > > Better: when you have many semantically-different values, use named
> > > (not positional) parameters in the format stri
t x.isupper()" you'd get the whitespace in it too (along
with all the lower case characters).
If isupper/islower were perfect opposites of each-other, there'd be no
need for both. But since characters can be upper, lower, or *neither*,
you run into this situation.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Apr 29, 2016, at 06:55 PM, Christopher Reimer wrote:
> On 4/29/2016 6:29 PM, Stephen Hansen wrote:
> > If isupper/islower were perfect opposites of each-other, there'd be no
> > need for both. But since characters can be upper, lower, or *neither*,
> > y
On Sat, Apr 30, 2016, at 09:48 AM, Christopher Reimer wrote:
> On 4/29/2016 11:43 PM, Stephen Hansen wrote:
> > The official documentation is accurate.
>
> That may be true on a technical level. But the identically worded text
> in the documentation implies otherwise.
That
--
Note, for paths on windows you really want to use a rawstring. Ie,
r"D:\file.html".
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
s not fast enough for you? That's less then a second.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, May 1, 2016, at 09:51 PM, DFS wrote:
> On 5/2/2016 12:31 AM, Stephen Hansen wrote:
> > On Sun, May 1, 2016, at 08:39 PM, DFS wrote:
> >> To save a webpage to a file:
> >> -
> >> 1. import url
On Sun, May 1, 2016, at 09:50 PM, DFS wrote:
> On 5/2/2016 12:40 AM, Chris Angelico wrote:
> > On Mon, May 2, 2016 at 2:34 PM, Stephen Hansen wrote:
> >> On Sun, May 1, 2016, at 09:06 PM, DFS wrote:
> >>> Then I tested them in loops - the VBScript is MUCH faster: 0.
rt urllib2;
r = urllib2.urlopen(webpage); f = open(filename, 'w');
f.write(r.read()); f.close();"
10 loops, best of 3: 175 msec per loop
That's a whole lot less the 0.88secs.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
. You haven't shown that.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, May 1, 2016, at 10:08 PM, DFS wrote:
> On 5/2/2016 1:02 AM, Stephen Hansen wrote:
> >> I actually use "D:\\file.html" in my code.
> >
> > Or you can do that. But the whole point of raw strings is not having to
> > escape slashes :)
>
>
>
27;s too much noise to
it, but in general:
Using enumerate increases readability, and I use it whenever the idiom:
for index, item in enumerate(thing):
...
is used.
Enumerate is your friend. Hug it.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
ib.urlretrieve(webpage,webfile) WORKS
>
> webfile = "rD:\econpy001.html"
The r is *outside* the string.
Its: r"D:\econpy001.html"
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
ame constant factor, at which point the difference is
irrelevant.
If you believe otherwise, demonstrate it.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, May 2, 2016, at 12:37 AM, DFS wrote:
> On 5/2/2016 2:27 AM, Stephen Hansen wrote:
> > I'm again going back to the point of: its fast enough. When comparing
> > two small numbers, "twice as slow" is meaningless.
>
> Speed is always meaningful.
>
2']
That said:
list1 = [t.strip() for t in list1 if t and not t.isspace()]
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
rodu_dokumentarni_film/playlist.m3u8?foo=bar";>
>
>
> but I can't come to that point.
Why? As important as it is to show code, you need to show what actually
happens and what error message is produced.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, May 2, 2016, at 11:09 AM, DFS wrote:
> I'd prefer to get clean data in the first place, but I don't know a
> better way to extract it from the HTML.
Ah, right. I didn't know you were scraping HTML. Scraping HTML is rarely
clean so you have to do a lot of cleanup.
-
On Mon, May 2, 2016, at 08:27 PM, jf...@ms4.hinet.net wrote:
> But when I try to get this forum page, it does get a html file but can't
> be viewed normally.
What does that mean?
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
()
Output will be a string, string has a splitlines method, etc.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, May 2, 2016, at 08:57 PM, jf...@ms4.hinet.net wrote:
> Stephen Hansen at 2016/5/3 11:49:22AM wrote:
> > On Mon, May 2, 2016, at 08:27 PM, jf...@ms4.hinet.net wrote:
> > > But when I try to get this forum page, it does get a html file but can't
> > > be vie
, "x and y" is false. If x is
true, though, it'll return y. In this case, "x and y" will be a true
thing if y is a true thing, and a false thing if y is a false thing.
As you can see, all of this logic happens without ever using True or
False.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
hp?group=gmane.comp.db.sqlite.general
> Any ideas?
Sorry, I don't use Access.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
URTS PRIVATE', 'www.lafitness.com', 'GYMNASIUMS', 'HEALTH &
>>> FITNESS CLUBS', 'www.lafitness.com', 'HEALTH & FITNESS CLUBS',
>>> 'www.lafitness.com', 'PERSONAL FITNESS TRAINERS', 'HEALTH CLUBS &
>>> GYMNASIUMS', 'EXERCISE & PHYSICAL FITNESS PROGRAMS', 'FITNESS CENTERS',
>>> 'HEALTH CLUBS & GYMNASIUMS', 'HEALTH CLUBS & GYMNASIUMS', 'PERSONAL FITNESS
>>> TRAINERS', '5', '4', '3', '2', '1', 'Yellow Pages', 'About Us', 'Contact
>>> Us', 'Support', 'Terms of Use', 'Privacy Policy', 'Advertise With Us',
>>> 'Add/Update Listing', 'Business Profile Login', 'F.A.Q.']
Then:
>>> pattern = re.compile(r"^[A-Z\s&]+$")
>>> output = [x for x in list if pattern.match(x)]
>>> output
['PHYSICAL FITNESS CONSULTANTS & TRAINERS', 'HEALTH CLUBS & GYMNASIUMS',
'HEALTH CLUBS & GYMNASIUMS', 'RACQUETBALL COURTS PRIVATE', 'GYMNASIUMS',
'HEALTH & FITNESS CLUBS', 'HEALTH & FITNESS CLUBS', 'PERSONAL FITNESS
TRAINERS', 'HEALTH CLUBS & GYMNASIUMS', 'EXERCISE & PHYSICAL FITNESS
PROGRAMS', 'FITNESS CENTERS', 'HEALTH CLUBS & GYMNASIUMS', 'HEALTH CLUBS
& GYMNASIUMS', 'PERSONAL FITNESS TRAINERS']
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
#x27;m all for the idea that one shouldn't go to regex when Python's
powerful string type can answer the problem more clearly, but this seems
to go out of its way to do otherwise.
I don't even care about faster: Its overly complicated. Sometimes a
regular expression really is the clearest
On Thu, May 5, 2016, at 12:04 AM, Steven D'Aprano wrote:
> On Thursday 05 May 2016 16:46, Stephen Hansen wrote:
> > > On Wed, May 4, 2016, at 11:04 PM, Steven D'Aprano wrote:
> >> Start by writing a function or a regex that will distinguish strings that
> >&g
On Thu, May 5, 2016, at 12:36 AM, Steven D'Aprano wrote:
> Oh, a further thought...
>
> On Thursday 05 May 2016 16:46, Stephen Hansen wrote:
> > I don't even care about faster: Its overly complicated. Sometimes a
> > regular expression really is the clearest way t
On Thu, May 5, 2016, at 10:43 AM, Steven D'Aprano wrote:
> On Thu, 5 May 2016 11:32 pm, Stephen Hansen wrote:
>
> > On Thu, May 5, 2016, at 12:36 AM, Steven D'Aprano wrote:
> >> Oh, a further thought...
> >>
> >> On Thursday 05 May 2016 16:46, Ste
On Thu, May 5, 2016, at 05:31 AM, DFS wrote:
> You are out of your mind.
Whoa, now. I might disagree with Steven D'Aprano about how to approach
this problem, but there's no need to be rude. Everyone's trying to help
you, after all.
--
Stephen Hansen
m e @ i x o k a
input.
Um, no one said that. I was arguing that the *regular expression*
doesn't need to be responsible for validation.
> - Even if you do somehow end up with junk, there couldn't possibly be any
> real consequences to that.
No one said that either...
> - It doesn't matte
list comprehension *build a
list* which is not needed, and wasteful. The above skips building a
list, instead returning a generator, and join pulls items out of it one
at a time as it uses them. No needlessly creating a list only to use it
and discard it.
--
Stephen Hansen
m e @ i x o k a i . i o
On Thu, May 5, 2016, at 07:46 PM, Dan Sommers wrote:
> On Thu, 05 May 2016 18:37:11 -0700, Stephen Hansen wrote:
>
> > ''.join(x for x in string if x.isupper())
>
> > The difference is, both filter and your list comprehension *build a
> > list* which i
ep track of the references in your head to make sure
things will get closed at proper times.
The 'with' statement clearly defines when resources should be closed, so
its preferred (As I see you've adopted from other responses). But its
also needed in other Python implementations whic
the only things you should use 'is' for is when comparing to
singletons like None, True or False (And consider strongly not comparing
against False/True with is, but instead just 'if thing' and if its True,
it passes).
Otherwise, 'is' should only be used when you
them in a disenfranchised position.
Recognizing those faults and taking corrective action is fundamentally
an act in the name of equality.
Correcting for inequalities can not, itself, be a purely "equal" task
done in pure blindness of the contextual reality of what is going on in
the world.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
"Consider using enumerate instead of iterating with range
> and len"
>
> the offending code is:
> for j in range(len(list1)):
>do something with list1[j], list2[j], list3[j], etc.
>
> enumeration would be:
> for j,item in enumerate(list1):
> do something with
on on what
is "good" or "bad" programming habits.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, May 7, 2016, at 12:17 PM, Christopher Reimer wrote:
> On 5/5/2016 6:37 PM, Stephen Hansen wrote:
> > On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote:
> >> Which is one is correct (Pythonic)? Or does it matter?
> > First, pylint is somewhat opinionated,
ist1)) and list1[j] are all
indirection, when item1 is clearly (if given a better name then 'item1')
something distinct you're working on.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
> Aside: I haven't tried, but is 'names' a bad idea or illegal for the
> name of a python list or variable?
Nothing wrong with names. Or 'name', for that matter. Try to avoid
abbreviations.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
examples to comment
>
>
> if ("Please choose a state" in str(matches)):
> if (var == "val" or var2 == "val2"):
Gah, don't do that. You're adding meaningless noise.
Especially in the first case.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
s):
may be sorta vaguely long, but its not that long. Just do it and move
on. Get over whatever makes you not like it.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
an error happens. You
rollback. Or correct the data. Since the data didn't go in, there should
(in theory) be nothing TO commit if an error happens. Or, there should
be partial data in that needs a rollback before you decide to do
something else.
--
Stephen Hansen
m e @ i x o k a i . i o
--
h
its
speaking *only* about *whitespace*.
ALL its saying is, "don't put spaces before commas, colons or
semicolons". You can infer nothing else about it.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, May 8, 2016, at 02:46 PM, DFS wrote:
> On 5/8/2016 5:38 PM, Stephen Hansen wrote:
> > On Sun, May 8, 2016, at 02:16 PM, DFS wrote:
> >> I was surprised to see the PEP8 guide approve of:
> >>
> >> "Yes: if x == 4: print x, y; x, y = y, x"
>
. Your decorator should, IMHO, treat the attribute as private data,
and if something else is using the same thing, something has clearly
gone wrong and raising the error early and clearly is right.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
implementation, it is guaranteed that:
>>> a = "a" "a"
>>> b = "aa"
Are the same. Two+ string literals are implicitly combined into one at
compile time.
> 'master craftswoman' my ass...
Yes, you're being that. Please stop.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
it.
They aren't.
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Jan 20, 2015 at 1:45 AM, Marko Rauhamaa wrote:
> Terry Reedy :
>
> > Others have answered as to why other special-purpose
> > constrained-structure trees have not been added to the stdlib.
>
> Ordered O(log n) mappings are not special-purpose data structures. I'd
> say strings and floats
1 - 100 of 739 matches
Mail list logo