FAQ Database Discussion Community

python sqlite named parameter containing dash

I'm trying to insert a record into an sqlite database using named parameters in python (with the sqlite3 module). The values I want to insert are in a dictionary, but the dictionary keys might contain dashes, for example {'request-id': 100, 'year': '2015'}. I'm trying to execute the following: import sqlite3...

Avoid repeating named argument defaults when calling superclass initializer in Ruby (2.1+)

Say I have parent class whose initializer has an argument with a default value: class Parent attr_reader :foo def initialize(foo: 123) @foo = foo end end I want to create a subclass that has the same default value for foo. I can do this if I repeat the declaration: class...