« first day (2285 days earlier)      last day (2649 days later) » 

12:11 AM
hello
I have a trouble installing scipy module
 
12:30 AM
please be more specific
cabbage
 
12:43 AM
oh yea, I have got pip installed for python 3.5 32-bit version, while my OS is running 64-bit
 
can that just happen?
 
well, python idle shows 32-bit
 
is your pip 32-bit, or your scipy, or...?
I probably won't be able to help, but others who might will probably appreciate some extra input
such as a specific question, along with necessary information
 
yea xD appreciate your concern anyways ^^
 
1:28 AM
Cbg
 
cbg
 
@justastudent It's perfectly fine to run 32 bit Python on a 64 bit OS, but all the Python stuff has to be 32 bit. But the installation procedure should've taken care of that.
 
though, you *will have to ensure that when you install a 3rd party exe package that you use the 32-bit version
that will make for some sadness
 
Isn't pip smart enough to do that if you use the right pip?
 
pip should, yeah
if you have wheels available for windows
typo. while x > 0 and there's nothing that ever decreases x. stackoverflow.com/q/41687582/344286
 
1:41 AM
dat error
 
hmmmmm it seems that pip can't get scipy for widnows, so i've got 2 ways to get around it
#1 install python 3.4, then download scipy package from sourceforge
#2 install python 3.6 and download the scipy and numpy+kml from the Unofficial python windows packages website
 
why won't the scipy package work with 3.5?
 
it should work fine, but as stated here scipy.org/install.html , that pip won't work because pypi packages doesn't have scipy for windows, as far as i understood from that xD
 
@justastudent Ah. You didn't say you were on Windows. Go with option #2, the Gohlke site is highly recommended.
 
whaddup nighthawks
except you, PM. Good afternoon 😛
 
DSM
1:48 AM
Or just install Anaconda, which is well-maintained.
 
:-)
 
@idjaw caw
 
o/
 
I'm impressed that is in your spam folder
Let me go look at mine and see if I can find something.
 
1:53 AM
well, the exact e-mail gave me an opportunity to buy a pair of these:P
 
@PM2Ring, @DSM thnx for suggestions, I think i will go with Gohlke site packages, I hope this third party including doesn't ruin anything xD
 
well holy crap
> This email is to notify you about the release of your outstanding payment which is truly $15.500.000.00 USD.
 
@idjaw I can lend you some of my Nigerian inheritance
oh wait, you're getting money too
wanna lend me some?
 
Definitely. No need to lend. I'll just give you.
I got you, bro
 
yessss
 
1:55 AM
LOL!!
That logo, though. Legit.
 
:D
it says "secure", so it's fine
4
the most annoying kind of spam I get is a Hungarian crackpot impersonating various high-profile (mostly Nobel laureate) physicists in order to debunk the fraudulent status quo in what we call physics
the annoying part is that I know that the guy is harrassing half the world with his crap
 
2:50 AM
thnx for help, gn everyone
 
3:15 AM
oh no.....this service delivers to my neighbourhood
this is horrible amazing
 
4:15 AM
cbg
 
 
3 hours later…
7:03 AM
Python2.7 repl doubt
>>> r'\\'
'\\\\'
>>> '\\'
'\\'
>>>
What's happening here?
>>> print r'\\'
\\
>>> print '\\'
\
More:
>>> print r'\\'
\\
>>> print r'\'
File "<stdin>", line 1
print r'\'
^
SyntaxError: EOL while scanning string literal
mysterious
Martin?
 
@davidism not talking about r'' but the output in repl
 
You're talking about r''.
 
So why does print r'\' fails?
 
You didn't read the linked answer.
 
And r'\\' without print gives '\\\\'
 
7:32 AM
repr vs. str
 
aight. let me check on repr() more. Not clear why r'\' should fail.
 
Re-cbg
@MYGz Consider r'\''
 
cbg :)
That would be a single backlash and a single quote. I was trying a single backslash.
 
7:48 AM
@MYGz And len(r'\\') gives 2
Stupid auto-correct
@MYGz Sure, but the lexer just sees the escaped quote
 
That explains somewhat but still not clear why r'\\' should work then.
So it has to do more with lexer I guess.
Clear now. r'\\\' this would also raise error.
 
user6568562
8:27 AM
Cbg, everybody
 
8:42 AM
cbg, all
 
cbg o/
 
@MYGz yes, raw string literals still treat backslashes as paired characters.
 
8:56 AM
cbg, all
 
hi How to convert old python string formatter into new one
for example :
input == "We expect the %f%% growth this week"
output == "We expect the {}% growth this week"
 
I don't believe there are any automated conversions for that. Is there some specific reason you want to fix something that's not broken?
 
no I just got a challenge to solve this and I am trying to do the same by regex pattern matching but not be able to complete all case
 
9:21 AM
disuncbg
@AmanJaiswal pycharm can do that IIRC
@AmanJaiswal anw, write a regex for all possible % conversions; probably something like %(?:\(.*?))?[#0-9 +-]*[diouxX......andsofotrth%]
I am really worried about Drumpf already
 
Can't see that worrying will do much good, but go ahead and knock yourself out
 
well, not worrying doesn't help either :D
 
10:06 AM
You'll die if you worry.
You''ll die if you don't
So why worry?
 
cbg
 
10:21 AM
o/ @khajvah
 
10:32 AM
Hi there!
How are you?
Need advice in job search.
 
user6568562
11:00 AM
@holdenweb To burn calories, I suppose
 
Hi @randomhopeful Here's a song you might like: South California Purples by Chicago, live at Carnegie Hall in 1971. It's from their 1st album, before they went all soft & commercial.
 
user6568562
Hey @PM2 I will check it right away
 
11:37 AM
@БеляковаАнастасия soo what would you like to know?
 
 
1 hour later…
12:49 PM
cabbagey afternoon y'all
 
@IntrepidBrit brexit cbg
 
Is that the last cabbage sat by itself on the shelf then?
 
yeah
was just reading may's sayings
 
I'm surprised the Tories caved and shared their proposals - but I'm glad they have. Now we can pick at the proposals and see what'll work
 
so their proposal is the middle finger :D
oh well
"Control over immigration and removing Britain from jurisdiction of European court of justice top priorities, speech will say"
I will start advocating the dissolution of United States
 
12:58 PM
I mean, the country did vote to leave the EU, and the European leaders (quite rightly) said that the UK can't cherry pick. It was the one of the few possible outcomes.
 
What a depressing day. Can someone cheer me up, please?
(nothing to do with politics - just work stuff)
 
I am having terribly busy days till the end of the month
trying to release before I leave my current company
and then I am gonna have terribly busy days because I will start a new job
what a shame
 
1:14 PM
@holdenweb Uhh. Uhh. We've passed the winter solstice and the snow seems to have buggered off?
 
hello guys...
are you familiar with mailtester?
 
@vaultah I need a hint of where and how to search for a opening with no previous experience.
 
1:34 PM
This OP is fixated on making variable variables, and won't take "Don't do that!" as an answer...
 
I really want python 3.6 on Fedora 25... looks like I'm going to have to learn how to build it and create a COPR.
On my first day at my first ever programming internship, I walked into my cube to find an extremely realistic drawing of a lobster on the whiteboard, with it telling me to never use PHP's variable variables. I took that advice to heart and have never compromised on it.
 
@KevinMGranger so you are telling that you were a PHP developer
hmm, good to know
my first internship was C++, so I am equally embarrassed
 
I was hired to do python work but I've been doing PHP most of my time here...
 
You fell for the trap
 
The classic "bait & switch"
 
1:40 PM
In my interview I explicitly stated, "I don't want to do anything with websites." :(
Oh well, I'm almost done with it for the time being.
 
The only two programming internships I've ever had were PHP, somehow
 
Is prolog fun?
I am gonna have to use it for a course projecr
 
Ooh prolog is super cool!
Good luck finding help with it, though.
 
no SO prolog ninjas?
gonna write a poker bot
 
There might be. I found that it was difficult to give a proper MCVE for prolog, because building enough understanding to transform your question into a MCVE was the actual difficult part.
 
1:48 PM
cbg
 
oh wow
challenging
 
hi
This is weird: pycharm "suddenly" changed fonts it seems - without updating, and just after opening after 3 months.
 
perhaps it uses system fonts?
 
I love this line from this answer to a recent electronics.SE HNQ Is it really possible to “boost” 6 V DC to above 50 kV? Or even 400 kV? "4. Do not lick the operational terminals."
 
Probably, but now "consolas 10pt" looks really small.
 
1:54 PM
did you change your monitor by any change?
 
Nope still same laptop
Looks a bit zoomed out, ctrl+shift+a which should work according to pycharm's faq doesn't though.
 
I've never used pycharm but a "zoom in/out" option should be there in the menu as well
(in case the shortcut changed)
assuming, of course, that it behaves like any sane GUI
 
morning everyone
 
Majority of world's selfie-shooting accident deaths happen in India
 
purely by numbers or per capita?
 
2:06 PM
I would put that down to a larger "giant plummet points per capita" stat
 
what's selfie-shooting accident death?
 
A death that occurs accidently while shooting a selfie
 
while or because of?
 
so I just saw Manchester by the Sea yesterday, would recommend
 
Let's go with because of
 
2:11 PM
o/
 
\o cbg
 
Has anyone ever used a thesaurus when naming a variable to avoid a reserved word?
 
cbg
 
What reserved word are we talking about? People usually just butcher the spelling or abbreviate if we're talking about something like class -> cls
 
cbg
 
2:23 PM
I often wish I could use from as a variable name.
 
Just use a unicode character that looks similar to one of those letters but isn't. I'm sure people will love that
 
I don't think it would be that hard to allow from, since you can't use names in import statements anyway so there's no ambiguity.
 
I usually just go class_ but I don't know if that's bad habit.
 
I guess it's more of a matter of principle than implementation difficulty. Making a single reserved word not-entirely-reserved sets a bad precedent.
 
I use 'cls' as the argument when declaring a class method.
wait....
let me verify this
 
2:25 PM
I used to use klass until I read in PEP08(?) that you shouldn't dodge reserved words with intentional misspellings
 
Why not?
 
I don't believe they gave a justification.
 
Is there freezing rain where you're at? Just came into work with liek 2-3 cm of ice with rain water on top...
 
Ok, I don't see it in the PEP so maybe I read it in the docs somewhere? Or maybe I dreamed it.
 
Nah, it's in PEP8
And you're right, I can't see a justification
> If your public attribute name collides with a reserved keyword, append a single trailing underscore to your attribute name. This is preferable to an abbreviation or corrupted spelling. (However, notwithstanding this rule, 'cls' is the preferred spelling for any variable or argument which is known to be a class, especially the first argument to a class method.)
 
2:29 PM
Or use a synonym - perhaps type
 
Oh, cool. I didn't see it on my first go-through because it was under "Function and method arguments" but I was expecting it to be a global guideline.
Ok, so no reserved word misspellings specifically for function names and method arguments. Totally acceptable everywhere else.
klass = ... to your heart's content
 
wow. Was just reading an article that mentions that June 8, 2011 was World IPv6 day. And still probably most people have no clue about IPv6 o.O
 
@Kevin from module.from import from
 
I do occasionally use type because I much prefer overshadowing a rarely-used built-in function over having an awkward trailing underscore or obscure word
 
typ
oh wait, python3 allows típus pfft
 
2:31 PM
I'm pretty sure I've used kind in the past.
 
somedescriptorType
 
which_type
the_class_that_the_thing_is
 
headless selenium driver to get tneb reading details..
 
My favourite/most hated python intrepidism is self.sockette = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 
Why is that necessary? There's no time when self.socket would be ambiguous
 
2:36 PM
Sometimes you're just so sick of typing socket
(pay no attention to the fact that you must first type socket before you can type sockette)
self.socket = socket.socket(socket.socket, socket.socket) #socket
 
I usually increase the silliness with a comment. self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # socket
 
You're right, it's not necessary (and to be honest, I should probably just preface it with an underscore anyway to mark it as private), but it makes it clear that we're dealing with the instance after seeing the word socket splashed everywhere.
 
Wow, Kevin'd in practice as well as messaging
 
Helps to prevent semantic satiation
The better way is to do self.dave = socket.socket(socket.AF_INET, socket.SOCK_STREAM), but that only angers future intrepid
 
I was googling for "intrepidism" and only just realized you meant yourself
 
2:46 PM
Is it feasible to use base-ish Python (i.e. urllib and perhaps requests) to 1) fill out and submit a log-in form which takes you to the next page and 2) modify <span> and <input> tags/boxes on the next page? I ask because Selenium (which obviously is the most powerful tool for the job) is a severe PITA to get up-and-running at my workplace.
 
If you were in charge of hiring someone for your company, how much Python knowledge would someone need or can demonstrate before you would consider them to be proficient in Python?
 
@KevinMGranger Oops. Probably should have capitalised it.
 
@MooingRawr It all depends on the nature of the work. If it's a web development position, I wouldn't care so much for proficiency in Python, but proficiency in web development knowledge and motivation to learn and pick up Python quickly
The ability to solve the problem >> knowledge of syntax
 
I'm just casually look at job posting, and a lot of them says "proficient in Python" and it got me wondering, when does one cross the line of proficiency.
 
Never look at those things literally
just apply
 
2:51 PM
These are the same postings that ask for 5 years of experience with a tool that's existed for 3. These are the same recruiters that email Guido looking for a python dev. Just apply, half of what they say doesn't matter / isn't true anyway
 
It's also a way for them to try to get more serious candidates to apply by having people question whether they are "worthy" to apply to the "proficient" requirement.
 
I'd probably be satisfied with two or three shibboleths that demonstrate some involvement in the community, like:
- quoting the Zen of Python without prompting
- Knowing who Gohlke is (Windows positions only)
- being an RO (instant hire)
 
The ritual of the "hiss" is important too
 
Welp I'm never going to work for Kevin anytime soon xD
 
Anything that proves they didn't cunningly memorize the entire text of "learn Python in 21 days" without ever actually using any of it
 
2:52 PM
@idjaw before I got into my current job, I remember being scared of over selling myself. And I was raised to under promise and over deliver which wasn't a good thing lol.
 
"How did you learn python?" "There's a book called 'Learn Python The Har-" "We'll call you. Thanks for your time."
10
 
deleting because knowledge is power
 
:35146601 Thank god I read fast ;3
 
@not_a_robot Depends. If there's no JavaScript involved, it's doable in base Python, but it's not much fun; requests makes it a lot easier (OTOH, I haven't used Python 3's urllib, it might be more pleasant than it was in Python 2). But if the page does client-side JS stuff, you're stuck using something like Selenium that has access to a JS engine.
 
In an ideal world the interviewer would test for general proficiency not necessarily in any language, recognizing that a self-starter can get from 0% proficiency to 80% in a couple weeks.
(I'm assuming these people exist and are common even though I'm not one and I've never met one)
 
2:56 PM
Yes we just need to get a reliable test for "self starter" and we're done!
 
@Kevin fun fact: I taught myself perl from "learn Perl 5 in 21 days"
that said, I wouldn't have hired myself, especially since I was still in middle school
 
"Your interview is in-person at 10 today"
"Great, but what's the address? The company website doesn't say"
"a self-starter should be able to figure that out themselves." _click_
 
@PM2Ring I'm not too familiar with JS, but I'm fairly sure this is JS (which means I should likely use Selenium): <input id='dataPresent' type = 'checkbox' onclick = "toggleDataCategory(this, 'AA');" checked = "checked"
 
That sounds just like something a robot would say
 
2:58 PM
The JS there is only used when you click it. Do you need to know about that behavior, or retrieve information that appears only after clicking?
 
Yeah, toggleDataCategory(this, 'AA'); is a JavaScript function call. But from the name it looks like it just toggles the category of data that's being displayed, so there may be a way around it.
 
Clicking that basically "unlocks" some sliders below. I need to edit the <span> tags in those sliders. Like edit this: <span class="ui-slider-handle ui-state-default ui-corner-all" tabindex = "0" style = "left; 0%;"></span>... I need to edit that percentage on the page.
 
There is almost never an actual need for Selenium unless you need to do interface testing. You can always emulate what the page does by making requests instead. Just watch what it's doing in your browser dev tools network tab.
 
TIL spotify shows you where the bands you follow are most listened to. According to spotify, my tastes most match: Mexico City
 
"modify <span> and <input> tags/boxes on the next page" seems like it only makes sense in the context of Selenium, because your typical web scraping library doesn't actually display anything to the user, so there's nothing to modify.
I mean, once you've got the page as a string, you can absolutely do my_html = my_html.replace("input", "span") or whatever. But it isn't going to affect any text boxes on your screen
 
3:06 PM
Yeah. It's like moving the needle on an old analog speedometer & expecting it to change the speed of your car.
 
Right. So without using Selenium, I can't really edit that HTML and push it back up to the website itself to actually modify the form? Looks like I'm using Selenium, then...
 
I see two possible reasons you might want to modify elements in this way:
1) you want to change the contents of the inputs and other controls because the next page request you make depends on that data
2) you want to get the page into a particular state, and then hand control off to the user so they can perform the rest of the task manually
 
You could definitely modify whatever data you need to submit a form, but it might not be 100% the same as how they do it using js.
I second what davidism said about using the network inspector-- it may be totally obvious how their form submission works, and you could save yourself a lot of work.
 
In the case of #1, it's probably preferable just to look at the page source and see how the next page request is created based on those page elements. Then with that information you can create your own request without actually changing the DOM. (so, basically, I third what davidism said)
#2 seems tricky... Having little experience with Selenium, I don't know whether this is possible.
 
3:11 PM
Here's hoping they're not using AJAX
 
It doesn't matter, you can see the AJAX in your dev tools
 
Ok, so it's not impossible to reverse-engineer, merely annoying
 
9 mins ago, by davidism
There is almost never an actual need for Selenium unless you need to do interface testing. You can always emulate what the page does by making requests instead. Just watch what it's doing in your browser dev tools network tab.
 
Selenium is still convenient and easy to use out of the box, IME
 
teh flask mafia
 
3:13 PM
I'm trying to click that "Cancer Risk" button, and then drag the sliders below to ultimately create a custom report.
 
hmm...I'm starting to suspect that flask is for building stuff, and selenium is for manipulating stuff others have built
 
There's no shame in using Selenium if it's too much of a pain in the butt to reverse-engineer the source and/or parameter-passing protocol
 
@not_a_robot Another alternative is AutoIT but this is for more extreme cases where going through the source is too much of a pain and Selenium isn't working out
 
@AndrasDeak I'm pretty sure both of those things are true yes
 
Selenium is just a PITA to get installed where I work...
 
3:15 PM
According to my exhaustive notes. I only wrote half a page of them, then I was exhausted.
 
Are we all just going to keep assuming they should actually use Selenium? That assumption is most likely wrong.
You keep saying it's a PITA, but then seem to skip over alternatives and just soldier on complaining about Selenium.
 
Feels like upper management when no one listens the guy with a potential solution; instead try to beat an answer from a tool that might not even be fit for the job. Yup feels like a work day
 
@davidism could you elaborate? what's the tool for the job, then? Is it just requests? The network tab in devtools shows a bunch of JS GET calls
 
Yes, it's those things.
 
Is this too snarky?
On a similar note, don't use leading double-underscore names like .__width unless you really need to invoke Python's name-mangling machinery. If you need private attributes (which you probably don't in this case), use a single leading underscore. And if you need to ask if you need Python's name-mangling machinery in a particular case, you probably don't. ;) — PM 2Ring 43 secs ago
 
3:21 PM
@corvid That's pretty cool.
 
@PM2Ring seems fine
 
Ta.
 
A moderate heaping of sass can be neatly cancelled out by a winky emoticon
 
@PM2Ring Oh that question, I misread the question and gave an answer worth -2 rep xD Would not read again....
 
@MooingRawr And the OP mentioned in the question that they already know about repr... But I guess they could eval the tuple-in-a-string. :D
 
3:24 PM
Unrelated. In xkcd.com/378, how is programmer #4 going to use cat to create new programs? If you're starting from nothing, concatenating files together isn't useful because you have no files.
It's unsatisfying to me if the implication is that he's already got 256 files each containing a single ASCII character. You shouldn't bring silly unspoken assumptions to a pedantry fight.
 
He could have--
 
cat reads from stdin if you don't supply any input files.
 
Well damn
 
@Kevin if you just run cat, it will echo what you type in stdin.
 
Oh, ok. That's satisfactory, then. Thanks :-)
 
3:27 PM
You can also supply - as an input file name to indicate that you want to use stdin as an input file, so you can cat stdin with a bunch of other stuff.
That's a pretty common *nix convention. And - in a context where an output file is expected refers to stdout.
 
Can you use cat to enter arbitrary byte values? It might be important if you're locked in a room with a machine code textbook and a computer whose only accessible command is cat.
How you gonna write a nop if you can't write \0
(assuming nops are typically encoded as a zero byte, which I haven't bothered to verify)
 
OTOH, I tend to prefer /dev/stdin& /dev/stdout as they're more readable, but they might not work in some situations.
 
Oh, it's 0x90 in x86 Intel
How you gonna write a nop if you can't write \x90
 
alright room 6, I need your help naming a module. The module's purpose is for performing certain operations for 'operators' in a DC. So far I have 'operational_processes', but something about it does not seem right.
Any creative ideas?
 
@Kevin That's a little tricky, but still doable, because you can enter (most) control characters. There may be a better way, but you hit Ctrl-Q to change modes, then you can enter any other control codes, apart from Ctrl-Q, which toggles you back to normal mode. Oh, you can't hit Ctrl-C either. :)
 
3:35 PM
> DC
 
Another option is to use echo -e, which lets you put \x escape codes into an echoed string.
 
? What's a DC?
 
data center
 
you mean data center
 
that's what I wrote, sheesh.
<3
 
3:37 PM
Depends on where the data centre is ;)
 
We can't let @Ffisegydd's kind win.
 
oh...OH...is this what this is?
are we declaring word-war?
I'm going to be diplomatic on this one, and step back, because I'm severely outnumbered I think.
Plus, Fizzy is the tank in the army. We can't win the war without the tank.
 
@idjaw Monty Python to the rescue: something from the Piranha Brothers skit
When the Piranhas left school they were called up but were found by an
Army Board to be too unstable even for National Service. Denied the
opportunity to use their talents in the service of their country, they
began to operate what they called 'The Operation'. They would select a
victim and then threaten to beat him up if he paid the so-called
protection money. Four months later they started another operation which
the called 'The Other Operation'. In this racket they selected another
victim and threatened not to beat him up if he didn't pay them. One
 
omg......
other_other_operation
I want to...so...badly
 
DSM
Morning cabbage for all.
 
3:40 PM
+1 Canada in the house
morning DSM
 
@DSM \o cbg DSM, how was your commute (if any)?
 
DSM
It was a dangerous trip to the station-- the sidewalks are just ice. Eventually I just started skating.
 
freezing rain, I never leave the house
work from home day
 
Main roads are fine, it's the side roads and the quieter streets that gets you... my house was on a side quiet street.... it was not fun trying to round the corner in my car, let alone getting out of my house and down the stairs (salted and sanded, since it doesn't melt fast enough). Half my team is working from home.... but I don't like to work from home, my stuff in my room distract me too much.
 
Whoops I left a naked try-catch in production code and now the user is experiencing behavior that's supposed to be impossible
 
DSM
3:47 PM
First, obviously a feature. Second, can you modify your deployment process to catch this going forward?
 
"Why am I getting validation failed? My data is fine". It's because I did try: validation_func(row); except: print "Validation failed!"
In theory, validation_func should only ever raise a ValidationFailedException but since I'm suppressing all diagnostic information, it's entirely possible it's throwing something else and I'll never know
 
Hey guys, can someone run this and see if it hangs.
'''
>>> test = False
>>> with open(test) as f:
... fail = f.read()
...
'''
Well that paste was a failure.
 
@DSM Our deployment process is very... Manual.
 
Python3.6 if possible.
 
@MoAli Ok, I'll run it... The cursor is blinking and nothing else is happening.
Oh, I can type. I guess it's reading from stdin?
 
3:50 PM
@Kevin
@Kevin I don't know, it's not the same in 2.7
 
>>> test = False
>>> with open(test) as f:
...     fail = f.read()
...
hello
I'm typing right now
I'm going to try to press ctrl-C

>>>
Aaaaand "Python has stopped working". Oops.
 
@Kevin 2.7 returns a type error.
Which is what I expect.
 
DSM
@MoAli wins today's "crash Python in an impressive way" award!
 
> file is either a text or byte string giving the name (and the path if the file isn't in the current working directory) of the file to be opened or an integer file descriptor of the file to be wrapped.
 
DSM
Who knew fd=0 could be so much trouble?
 
3:52 PM
Welcome to Python where booleans are ints and the stars don't matter
 
False is 0 in an integer context.
 
@davidism So because False/Bool is an subclass of Int it would work?
 
Why would 2.7 give a type error, then? Is it using type(arg) is int instead of isinstance(arg, int)?
 
@Kevin That's what I'm confused about too.
 
Anything that defined __int__ will work.
 
3:54 PM
@davidism
 
OK? Doesn't seem like a bug.
 
I was just trying to understand the response, I still don't understand why it returns type error in 2.7 but not 3.
 
Time to open another bug: "open(False) doesn't work properly in 2.7"
 
They explained why in the bug report you made. open is different than io.open in Python 2.
 
... Unless "can interpret ints as file descriptors" is behavior specific to 3.X, in which case everything is working as intended
I see open(0) also gives a TypeError in 2.7, so I think this is the case
 
3:57 PM
But the both accept unicode strings, byte strings and integers.
 
I suspect it's version-specific
 
2 mins ago, by davidism
They explained why in the bug report you made. open is different than io.open in Python 2.
They do not both accept integers.
 

« first day (2285 days earlier)      last day (2649 days later) »