« first day (1848 days earlier)      last day (3326 days later) » 
00:00 - 21:0021:00 - 00:00

21:00
Well it almost is I think... I was thinking that I could have something like the 'B' typecode but then tests such as pytest.raises(TypeError, a.append, 7) won't actually pass. Should I just change my tests here as well?
Thinking about it more I guess I really should change to 'B' because the old python 2 style strings aren't a good idea in this context.
Okay - so use bytearray ?
long time no see btw - where ya been hiding?
Been a prisoner in .NET land.... :(
Actually could be worse, I could have been writing Java!
or even PHP!?
shiver
ha yeah
So I'm back to writing some Python again, just trying to write a library that gives you mmap backing to arrays.
21:06
@idjaw That'd be an awesome Halloween costume... "What is your child dressed up as?" - "Oh, they're dressed up as PHP!" :p
hello there
@JonClements Did you mean they're messed up as PHP! :D
@JonClements hahah...you know it makes me wonder how one would properly portray PHP as a halloween costume.
Can someone tell me what Python function/syntax is used here: [c.lower(),c.upper()][c in 'aeiouy'] ? It capitalizes vowels but I have absolutely no idea how that works
@idjaw randomly put any crap you could find together using anyway you can think of it to stick them together
21:09
@LeGrandDODOM [c in 'aeiouy'] returns [True] id it is a vowel. Which is interpreted as 1
@JonClements :)
@LeGrandDODOM arghghg... horrible
hello again :)
@hmmmbob hi...
umm... mis-read that name as "mmmbop" and was suddenly reminded of a group called "Hanson" - does anyone else remember them?
Then it reduces to [c.lower(),c.upper()][1]. So finally c.upper() is executed.
Ugly code though :P
21:10
@BhargavRao oh, very witty I like that
have a dict called nodes, it only has 2 key value pairs.. i wanna check if any value of any key is equal to the other key
mmmbop bipy dop ba woo wap or something like that right? :P
Weren't you asking that earlier?
yes
but the problem is, i had the following
@JonClements now that I understand it, it looks very code-golf like
21:11
for key in nodes:
	if nodes[key] in nodes.keys():
the small problem is, it does not work :(
@hmmmbob you already posted this, and we already responded
oh then i must have misread your replies.. i thought people told me mine was ok but just not efficent
Post more context about why it doesn't work. Did you try debugging it yourself?
Yours is "fine", except all you've posted is two lines, we don't know anything about the data or why it's not working.
i looked at the dict entries to make sure that there are in fact values that are equal to the other key
so i know that it has to return true
I'm switching to python 3 from 2 and was wondering what the \n equivalent is in python 3
21:14
Same
Umm.... where the hell have I put my phone
Call up someone and ask :P
I'm hoping I don't have to resort to logging in online and using the "Find my Phone" service as I have no idea what the email/login is for that
get someone local to you to call your phone :P
it's on silent :)
21:17
well...good luck, sir.
i think i found the mistake
nodes.keys() is a list
with 2 entries
nodes[key] is also a list.. that at most contains 1 element of nodes.keys(), so when i ask my if statement, its never true
Well, tis time for me to go to bed. Rhubarb all.
Still not sure what's wrong with just: nodes.viewkeys() & nodes.itervalues()...
Then you'll get a set of the overlapping values
of course nothing, and i will look at documentation for that up right now
but i did not know these commands and tried to solve the problem with my limited tools
21:38
cbg all
22:17
anybody know a pythonic way to check if a matrix has identical elements? lots of info on list and 1 d arrays but almost none on 2d!
the only way I can think of is len(set(myArray.flatten())) ==1
@Sudh what about using np.unique ?
eg: np.unique(myArray).size == 1 instead... then you don't have to worry about the shape and building a set etc...
 
1 hour later…
user559633
23:35
Lining myself up for a "what happens when you try it," but am I right in assuming that the backref/relationship system in sqlalchemy does an enforcement of FKs in code vs at the DB layer?
you don't need foreign keys for relationships, they're just the default way for sqlalchemy to autodetect the join
I'm not sure what you mean by enforce though.
Also, what happens when you try it? ;-)
user559633
@davidism :) Yeah, the laziness came from using sqlite as my db for this.
user559633
__tablename__ = "group"
uid = db.relationship("User", secondary=uid_gid_association, backref="group")
...
user559633
nothing in the group table for it, so yeah, it's all in sqlalchemy/code
Someone just asked me to post my clarifying comment as an answer so they could accept it. So what do I do? I find an existing question with a more robust answer, and dupehammer. >=}
user559633
23:46
by "enforce" i meant enforcement of the FK constraint
user559633
@TigerhawkT3 Yeah, way to show that person looking to reward you for your help. TALK ABOUT OWNED
user559633
also, sorry in advance @davidism, the little respect and patience you have for me is about to go out the window this month as i try to actually understand what i'm doing with sqlalchemy instead of copy/paste idioms until the pain stops
To be fair, my clarifying comment worked, but it would have been brittle. The linked answer was more reliable.
hey, who's an expert on packages?
hint it's not me.
@tristan sqlalchemy doesn't enforce foreign keys generally, although it lets you specify cascades for them
this may have changed, but sqlite doesn't enforce them either by default
user559633
23:52
@AaronHall sniggers
user559633
@davidism Yeah, exactly, I wasn't sure if I was looking at a sqlite thing or a sqlalchemy thing.
user559633
@AaronHall To actually be helpful, please just ask the question
user559633
The room rule is there both so the regulars aren't annoyed and because it helps you get answers faster
user559633
Say that I use the relationship system and declare a backref. I assume that it's not going to create a many-to-many mapping table automagically, but in postgres (or mysql), will this do a FK constraint or is it just enforced in python?
I'm trying to use a __main__.py in my package. I'm trying to get my imports correct. I tweak, tweak, tweak, and it seems like it works and then it doesn't.
user559633
23:56
Python 2/3? Can you share an example?
I try to run both 2 and 3, seems fairly consistent behavior across both(probably because I do from __future__ import absolute_import)
user559633
are you relative importing? calling something deeper inside the dir structure?
Oooh - there are some fun quirks of importing during initialisation from your own package. Patrick investigated them fairly recently iirc. Have you got some deep nesting going on?
uh... so the package structure looks like this: github.com/aaronchall/HTML5.py
Ah - not that then. (crosses off guess 1 from the chalk board)
23:59
@tristan no, the relationship doesn't create the foreign key, you still have to declare the column separately
00:00 - 21:0021:00 - 00:00

« first day (1848 days earlier)      last day (3326 days later) »